1. Intro
‘Tower of Hanoi’ is a well-known puzzle presented in many CS textbooks. These the rules:
– The are 3 poles A, B, and C.
– n disks are on pole A with the conical shape (the largest disk is at the bottom, then the smaller ones upper, and the smallest on top).
– You job is to move the entire n disks from pole A to pole C (the same conical shape as the final result) using 3 poles while obeying the rules:
+ only one disk is moved at a time + no disk is allowed to be placed on top of a smaller one
2. Tips to solve the game
This simple and easy-to-follow guide will guarantee you the least moves (and time if you practice) to achieve the result:
[ Don’t look at this if you prefer trying the game first ]
+ Focus on the smallest disk and the number n is even or odd + Move alternatively between the smallest and other disk + Assume pole A is on the left, B middle, and C right side. When move the smallest disk, always in the same direction [to the right if n is even, and to the left if n is odd]. In case there is no pole in this direction, move to the opposite far end. Then resume the normal direction. While you follow this way of the smallest disk's movement, there is only one way to move the non-smallest disk + Continue this until the job is done
3. The Legend
There are different stories about this puzzle. The common idea is that with n = 64 disks, the world will end if anyone can solve this game (!!)
Assume that each move takes 1 second. It is proved that the least number of moves required is 2n — 1 to achieve the result. With n = 64, it would take… 585 billions of years (!!)
4. Intro to Recursion concept
5. The Relationship between “Tower of Hanoi” and Recursion
6. Algorithms to solve this game
7. Final thoughts
To be continued
updated 25 Sept. 2011
