Monday, October 23, 2006

Tower of Hanoi

What I've learned, thus far, about the Tower of Hanoi is that it is all about observeable patterns. Firstly, when you start out with an odd number of pieces, it is most effiecient if your first move is to place the top piece on the farthest peg. However, when you have an even number of pieces it is best to move the first piece to the center peg. Secondly, and probably most important, is the pattern that is visible if you make the following chart.

piece(s) | move(s)
_________________
1 | 1
2 | 3
3 | 7
4 | 15
5 | 31
6 | 63

From this pattern one may infer that the formula 2*-1, where * is equal to the number of pieces, will give the number of moves necessary to complete the puzzle.

0 Comments:

Post a Comment

<< Home