Towers of Hanoi

585 Words2 Pages

Towers of Hanoi

Introduction

============

We have been asked during this piece of coursework to investigate the

Towers of Hanoi. The Towers of Hanoi is a simple game whereby you must

move of a pile of 3, 4, 5 or any other number of discs (1, 2, 3, etc)

of decreasing radii from 1 of 3 poles to another pole (A, B, C).

You are only able to move one disc at a time and cannot place a larger

disc on top of a smaller disc. You must also complete this task in the

smallest amount of moves possible.

Our ultimate task was to complete the game with 4 discs and then 5

discs using the smallest amount of moves, then to find a formula to

find the smallest amount of moves for any number of discs.

Simple cases:

=============

4 discs

=======

After having tried to solve the puzzle with 4 discs I found that the

smallest amount of moves possible was 15. (See fig. 1)

5 discs

To try and make things slightly easier for myself I decided to use the

first 15 moves I had used for 4 discs and then proceed from there.

This method was effective and led me to find that the smallest number

of moves was 31. (See fig. 2)

Results and Formulas

====================

Number of discs

---------------

Number of moves

1

1

2

3

3

7

4

15

5

31

When placing all the results into a table I noticed that if you take a

certain number of moves for example 3 and then double it you end up

with 6. You only then need to add another 1 to make 7, which is the

next amount of moves. This works for any number of moves for finding

the next amount of moves. To simplify my findings I produced a formula

as shown below.

More about Towers of Hanoi

Open Document