Professional Documents
Culture Documents
Tower of Hanoi Solution
Tower of Hanoi Solution
Binary Number
01000
01011
11001
10010
11010
10001
Interpretation
Move disk 4 to empty peg.
Move disk 1 to cover disk 2.
Move disk 1 to cover disk 4.
Move disk 2 to cover disk 5.
Move disk 2 NOT to cover disk 4.
Move disk 1 NOT to cover disk 5.
The table below lists the 25- 1 = 31 sequential moves required for a tower
with five disks. Try it with the interactive tower in Towers of Hanoi
Puzzle. Before you begin, reset the number of blocks (disks) to five (5).
Move
1
2
3
4
5
6
7
8
9
Binary Number
00001
00010
00011
00100
00101
00110
00111
01000
01001
Interpretation
Move disk 1 to empty peg.
Move disk 2 to empty peg.
Move disk 1 to cover disk 2.
Move disk 3 to empty peg.
Move disk 1 NOT to cover disk 3.
Move disk 2 to cover disk 3.
Move disk 1 to cover disk 2.
Move disk 4 to empty peg.
Move disk 1 to cover disk 4.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
01010
01011
01100
01101
01110
01111
10000
10001
10010
10011
10100
10101
10110
10111
11000
11001
11010
11011
11100
11101
11110
11111