Linked lists are indeed beautiful. Recursion also for me, when I finally wrapped my brain around what it means to write a recursive function.- What was the thing? What was one that taught you?
And that's good enough. certain recursion relations that turn out to be identical to the recursion relations we wanted at the beginning to solve our problem about sums of k
And I realized in that moment, I'm like, I actually understand recur... I've understood recursion this whole time, I just never had a problem in which it actually made sense to use. And that was my big downfall, is that I was measuring my understanding with the problems that I had available, which were just list traversal,
- I mean, you are a Lisp guy. You're probably pretty used to the recursion . - Yeah, all I remember is just surrounded by sea of parentheses.
I'm not going to make it." And I sat there in the lab for 8 hours, 10 hours doing these things, so worried. It's the week of recursion , we have to do a lab assignment. I'm not going to be able to do it.
And that was my big downfall, is that I was measuring my understanding with the problems that I had available, which were just list traversal, which is not a good use of recursion . And so I just remember that freeing...
and why you might even care. Let's talk a little bit about recursion . And before I get to that, I would have had to say something about names and names as a basis of computation.
And so you have this phenomenon that something that is quite familiar, even to children, turns out to have a mechanism lurking inside it that's this relatively interesting computer science concept of recursion . And we also have the observation here that in addition to allowing you to produce a phrase of arbitrary size through this recursion , that we don't have
come out of the school that are really good, then you do one thing. If you wanna have a hundred come out that are really good, then you have to do some other things. And so for-for-for-for recursion it takes, it takes three years. And then there's a, we do some-some animation basically in the first semester the-the animations there are set up for like a simple pong game or a breakout, one of those types-types of
can you can do this right so eventually we got to the root of the problem was we found a headhunter who owned the problem who we trusted in and then the recursion unwrapped and I thought oh my god here's Tom Mendoza the complete technical idiot applying a management algorithm recursively and so that was kind of what i felt like i was doing in reverse
is using in an abstract way the idea of diagonalization. It was really the start of so many other observations that were made, including Russell's paradox and the halting problem and the recursion theorem, and so many other principles are using diagonalization at their core. So... - Can we just step back a little bit?
So it says, if this is true, then the result is simply that. Otherwise it continues. And the dell is a recursion , so it's calling itself again. Let's see, how are we doing for time?
Like, maybe I'm not a programmer. Maybe I'm not worthy enough to enter into this circle of people who can figure out what the heck recursion means. And Deitel and Deitel's, I still remember this, their exact phrase was, "Every young budding developer solves this recursion program,"
Why not use a for loop? I don't understand. What's the purpose of recursion ? I don't understand it, yet it's so powerful. Why?
And so I just remember that freeing... Oh, man. Recursion . It was a great moment in my life. - I mean it does require, to be fair, a leap of faith, because people will tell you, those conformist, dogmatic,
- I think it was dev first search for one of the games. Maybe Othello, something like that, and for that implementing recursion . Understand that you can search trajectories through the space of states and do that recursively?
But I don't really use that much math when coding. I think coding is really logical, and it's based off of principles like loops and recursion . Yeah. Thank you. I mean, it's so true.
this relatively interesting computer science concept of recursion . And we also have the observation here that in addition to allowing you to produce a phrase of arbitrary size through this recursion , that we don't have to worry about the infinite expansion that we had with the XINU example, because this rule involves two choices.
of what the Greeks called the "atom." You know, a-tom, "that which cannot be cut." They were in search of that final particle that of computer science-- the magnificational constructs, the iteration, the recursion and so on and so forth, applied to very basic specifications--
a little turtle drawing-drawing the tree there. This is one of our first sort of serious a-attempts to-to teach the students recursion . In my experience it takes about three years of-of-of periodically coming back to try to teach recursion before most students are pretty good at it. It's not something that's-that's simple just from an instructional perspective. Some students get it instantly, but if you're tryin' to get -- there are all these issues with scale. If you wanna have five students
- Yeah. - I'm in this cold, rigid environment with my Microsoft keyboard, programming away in Java. And I still have just such, this memory of despair, because I love programming, this was after the linked list, and I cannot figure out recursion . And so I go to the university store and I buy a book and it's Deitel and Deitel learn Java and it has a section, Recursion ,
And I still have just such, this memory of despair, because I love programming, this was after the linked list, and I cannot figure out recursion . And so I go to the university store and I buy a book and it's Deitel and Deitel learn Java and it has a section, Recursion , so I open it up and I start reading it, and it just doesn't hit home. And I'm spiraling into this.
Maybe I'm not worthy enough to enter into this circle of people who can figure out what the heck recursion means. And Deitel and Deitel's, I still remember this, their exact phrase was, "Every young budding developer solves this recursion program," and it was the Tower of Hanoi.
- I mean it does require, to be fair, a leap of faith, because people will tell you, those conformist, dogmatic, Java instructors will tell you, that this is important, to understand recursion . But it takes a leap of faith that is something, this is a different way of looking at the world, and it's a powerful way of looking at the world.
That's when Karshner obviously came up with the more rigorous definition, that a googolplex was a 1 followed by a googol zeros. And you can sort of go beyond that, of course, and use this idea of recursion . You can talk about a googolduplex, which is a 1 followed by googolplex zeros, and a googoltriplex, which is a 1 followed by a googolduplex
But I'm going to skip past that. And we're instead just going to start with this notion of acronyms as a kind of a humorous way of bringing up ideas involving recursion . Now it's common to have acronyms.
And so is that sort of this mind-altering fact in the context of noughts and crosses? Not really. But it does get to say that very, very simple things, when iterated upon, when dealt with recursion , can create tremendous complexity.
and unique at so many different levels, to me is pretty amazing. And the two ingredients of that, of course, are the specification and the iteration and the recursion . And that gets me to one of the points that I make in the book also about the universe being computable in a different way.
Most humorously, somebody sent me a clipping from a paper in Oxford, UK one saying, "Harvard professor advocates humility." So that's one kind of point, I think, to wrestle with the need for more recursion in policy making.
And the, this tree turtle, this is sort of a-a- an homage to log-the old logo system a little turtle drawing-drawing the tree there. This is one of our first sort of serious a-attempts to-to teach the students recursion . In my experience it takes about three years of-of-of periodically coming back to try to teach recursion before most students are pretty good at it. It's not something that's-that's
that and just kept teaching the-the-the same topics. And so this is on the, on the screen there, it's another recursion it's a flood filled recursion problem, learning about binary trees and heaps. I mean these things it's probably similar, very similar to-to-to-to some of the problems you first learned it your-yourselves.