You are on page 1of 7

TOWERS OF HANOI

Background
Towers of Hanoi is one of the most known and interesting puzzles. The characteristic of the
game that intrigues me is that Towers of Hanoi is a game for all a

Rules and Purpose of the game


While playing Towers of Hanoi, one can make very important observations about the patterns
of the puzzle. However, the rules of the game are very simple. The game contains three poles
and at least one disk. The task is to move all of the disks from the first pole to the third, making
the least moves possible. The game has only two very simple rules. First, the player cannot
move more than one disk at a time and second, a smaller disk cannot be placed over a bigger
one.

Minimum Number of Moves


As we already mentioned, the purpose of the game is to transfer all disks from the first to the
third pole making the minimum number of moves possible. Experimentally we can count the
least possible number of moves. The following figures show the steps for solving the Towers of
Hanoi puzzle with the minimum number of moves with 1, 2 and 3 discs respectively.

With 1 disc (minimum number of moves is 2)

Step 1

Step 2

With 2 discs (minimum number of moves is 3)

Step 1

Step 0

Step 3

Step 2

With 3 discs (minimum number of moves is 7)

Step 0

Step 1

Step 2

Step 4

Step 6

Step 3

Step 5

Step 7

Observations
Although the investigation of the Towers of Hanoi puzzle is at an early stage, we can make
some very important observations. While drawing the figure, I realized that each opposite steps
are mirror images of each other. This observation stands for all three cases. In the first case,
step 0 and step 1 are mirror images. In the second case, step 0 is mirror image with step 3 and
step 1 with step 2. Last, in the third case, the mirror image pairs are 0-7, 1-6, 2-5, 3-4. In this
way, we can guess that all numbers of minimum steps will be odd numbers, so that all figures
(number of steps + 1) have a mirror image. If we make this observation more general, we reach
conclusion that there is one unique move, which is obviously the middle one and the others are
opposite to each other. In case three, we can see that we reach mirror images by making
opposite moves. In order, to move from step 6 to step 7, we have to do the opposite move of
the one that we did when moving from step 0 to step 1. This also stands for the rest mirror
images. However, since the moves are 7, there is a unique move, the middle one, so in this case
the move number 4. If we pay attention to the middle moves in all three cases, they are exactly
the same, as the biggest disc moves from the first pole to the last. As we go from case 1 to case
3, moves increase, steps increase, but the unique move remains constant and equal to 1.

Table of minimum numbers of moves

I will
draw
the
figures
and
add
them

Number of discs

Minimum
Number of Moves

Opposite Repetitive moves

Unique Move(s)

Arrangement Of
Moves

1
2
3
4
5

1
3
7
15
31

0
1
3
7
15

1
1
1
1
1

0+1+0
1+1+1
3+1+3
7+1+7
15+1+15

Graphing the minimum number of moves as one more disc is added

In order to find the pattern of the minimum number of moves I added a best fit line. However,
this attempt wasnt particularly successful. This is kind of normal since the minimum number of
moves doesnt increase uniformly but in an increasing rate. As a result, in my opinion an
exponential would fit better.

In the previous graph, starting with the least possible base of an exponential function
we can see that the curve increases exactly with the same rate as the points. However there is a
constant different between all points and the curve. So, we can try to transform the curve by 1
unit downwards and see the result.

We can see that the function fits perfectly to our points and so the function that we can use to
calculate the minimum number of moves for each number of discs is M(x) = 2x 1.

Proving the formula


In order to prove the formula found, we are going to use the principle of mathematical
induction. The principle of mathematical induction, also known as the Domino Effect, is a
method of proof, where if you prove that the statement hold for the first term and also prove
that it also holds for any consecutive number we have proven that it is true for all natural
numbers. Using the Domino parallelism, if we prove that the first Domino can fall and also that
every domino that falls will push the next one, then we have proved that all dominos will fall.
M(x) = 2x 1
For n=1,

M(1) = 21 -1 = 1, so the function is valid for 1 disc

Suppose that it is also valid for k, M(k) = 2k 1 , we will prove that it is also valid for the next
term k + 1.
M(k+1) = 2k+1 1
M(k+1) = 2 x M(k) + 1
M(k+1) = 2(2k-1) + 1
M(k+1) = 2 x 2k 2 + 1
M(k+1) = 2k+1 1

The legend
The legend of Towers of Hanoi is very interesting. It is said that in the beginning of time, the
priests of the Hindu Temple were given the Towers of Hanoi puzzle with 64 discs! So, the
legend says that when the priests complete the Towers of Hanoi puzzle with 64 discs, the world
will end. Using the formula found, we can calculate the minimum number of moves that are
required to complete the purpose.
264 1 = 18,446,744,073,709,551,615
To understand the magnitude of this number. This number in second is a lot more that the life of earth.

You might also like