- How to explain recursion?
Tower of Hanoi is one of the classic problems to look at if you want to learn recursion. It is good to understand how recursive solutions are arrived at.
Tower of Hanoi consists of three towers with n disks placed one over the other. The objective of the puzzle is to move the stack to another tower following these simple rules.
- Only one disk can be moved at a time.
- No disk can be placed on top of the smaller disk.
It is a method of solving problems that involves breaking a problem down into smaller and smaller sub problems until you get to a small enough problem that it can be solved trivially – if you look around you can find the use of recursion in a simple way like in the movie Inception- Leonardo had a dream, in that dream he had another dream, in that dream he had yet another dream, and that goes on.
Recursion is useful in solving problems which can be broken down into smaller problems of the same kind.
Here is another example that the simple concept of recursion can be applied to- the Russian nesting doll which is a set of wooden dolls of decreasing size placed one inside another.
Your assignment is to try and find a way to explain the concept of recursion.
Discuss your ideas with your teammates in the group; search the internet for information and inspiration, ask people around you, look for recursion in different cultures.
Try to come up with a model (such as a game) that from your perspective can explain the concept of recursion.