Lab 12: Simple Recursion
Summary
We'll wrap up the non-turtle parts of Lecture 20 and then move on to notebooks B and C from Exercises 10.
Table of Contents
- Lab 11 Home
- Part 1: We'll complete the non-turtle parts of the lecture notebook from Lec 20: Fruitful Recursion
-
Part 2: Exercises (B notebook; start C notebook if there is time)
- Reference: Case-by-case recursion strategy
- Reference: Recursive design patterns
- Knowledge Check
Big Questions
- How has your understanding of loops and repetitive actions changed since you started this class?
Show "Answer"
There's no right answer here, but we hope that you feel you have a more refined and explicit understanding of how repetitive processes start and stop, and what kinds of patterns they might exhibit. It may not be obvious (which is why we're asking this question), but by thinking a lot about loops, and where they should start and stop, what should happen in each iteration, etc., you are developing a new way to think about certain problems. And we're about to do that again with recursion. - What is "wishful thinking?"
Show Answer
Wishful thinking is when you assume that you have already solved a problem before starting to solve it. It's a process of willing suspension of disbelief, just like when you get absorbed in a good story and are willing to excuse inaccuracies or exaggerations for the sake of the plot (except maybe a little less entertaining and a little more deliberate). If used carefully and with precision, it can be helpful in solving recursive problems.