 # The Tower of Hanoi. 11 21 11231123 31 112337112337.

## Presentation on theme: "The Tower of Hanoi. 11 21 11231123 31 112337112337."— Presentation transcript:

The Tower of Hanoi

11

21 11231123

31 112337112337

41 23 37 415 7+8=15

1 23 37 415 531 663 7127 8255 2 4 8 16 32 64 128 256 DATA2n2n x n =2 n -1 If x= min number of moves:

Recursion Assume the formula for the minimum number of moves to achieve the goal is: X n =2 n -1 for all values up to n Prove true for X n+1 X n+1 =X n +1+X n =(2 n -1)+1+(2 n -1) =2(2 n -1)+1 =2 n+1 -1 Proof By Induction

Goal: to arrange the disks such that each of the towers is all one color. The two largest disks must also swap positions. Rules: A larger disk may never be placed on a smaller disk, but disks of equal size may be placed on top of each other. Bicolor Variation

Multiple Post Variations With more posts, transferring the disks should require fewer moves.

nt=4Increase 11 232 352 494 5134 6174 7258 8338 9418 10498 116516 128116 139716 1411316 1512916 Here is some data we came across regarding the minimum number of moves required to transfer n disks to another post: