0% found this document useful (0 votes)
420 views5 pages

Tower of Hanoi

The document describes the Tower of Hanoi puzzle. It consists of three pegs and disks of different sizes that must be moved according to rules: only one disk can be moved at a time, and a larger disk can never be placed on top of a smaller disk. The goal is to move all disks from the starting peg to another peg in as few moves as possible. The minimum number of moves required increases exponentially based on the number of disks. While originally a mathematical puzzle, the Tower of Hanoi can be used to assess brain function and develop problem solving skills useful for jobs like programming.

Uploaded by

johny english
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
420 views5 pages

Tower of Hanoi

The document describes the Tower of Hanoi puzzle. It consists of three pegs and disks of different sizes that must be moved according to rules: only one disk can be moved at a time, and a larger disk can never be placed on top of a smaller disk. The goal is to move all disks from the starting peg to another peg in as few moves as possible. The minimum number of moves required increases exponentially based on the number of disks. While originally a mathematical puzzle, the Tower of Hanoi can be used to assess brain function and develop problem solving skills useful for jobs like programming.

Uploaded by

johny english
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

I.

INTRODUCTION

Tower of Hanoi also called Towers of Hanoi or Towers of Brahma, puzzle involving three
vertical pegs and a set of different sized disks with holes through their centers. The Tower
of Hanoi is widely believed to have been invented in 1883 by the French mathematician Édouard
Lucas, though his role in its invention has been disputed. Ever popular, made of wood or plastic,
the Tower of Hanoi can be found in toy shops around the world.
The typical toy set consists of three pegs fastened to a stand and of eight disks, each
having a hole in the center. The disks, all of different radii, are initially placed on one of the
pegs, with the largest disk on the bottom and the smallest on top. The task is to transfer the stack
to one of the other pegs subject to two rules: only individual disks may be moved, and no disk
may be placed on a smaller disk.

History of Tower of Hanoi

There is a story about an Indian temple in Kashi Vishwanath which contains a large room
with three time-worn posts in it surrounded by 64 golden disks. Brahmin priests, acting out the
command of an ancient prophecy, have been moving these disks, in accordance with the
immutable rules of the Brahma, since that time. The puzzle is therefore also known as the Tower
of Brahma puzzle. According to the legend, when the last move of the puzzle is completed, the
world will end.

It is not clear whether Lucas invented this legend or was inspired by it.

If the legend were true, and if the priests were able to move disks at a rate of one per second,
using the smallest number of moves it would take them toughly 585 billionyears to finish, which
is about 42 times the current age of the Universe.

There are many variations on this legend. For instance, in some stories, the temple is
a monastery and the priests are monks. The temple or monastery may be said to be in different
parts of the world — including Hanoi, Vietnam, and may be associated with any religion. In
some versions, other elements are introduced, such as the fact that the tower was created at the
beginning of the world, or that the priests or monks may make only one move per day.

What is the game of Tower of Hanoi?

Tower of Hanoi consists of three pegs or towers with n disks placed one over the other.
The objective of the puzzle is to move the stack to another peg following these simple rules.

1. Only one disk can be moved at a time.


2. Each move consists of taking the upper disk from one of the stacks and placing it on
top of another stack or on an empty rod.
3. No larger disk may be placed on top of a smaller disk.

Mechanics of the game

1. The Towers of Hanoi is an ancient puzzle played with three stacks and any number
of differently-sized disks. At the start, all the disks are in the leftmost stack, with the
largest disk on the bottom and the smallest on the top. The object is to get all the
disks over to the rightmost stack.
2. You can only move one disk per move, and you can only move the top disk on a
stack. The top disk of any stack can be moved to the top disk of any other stack, with
the restriction that you can't move a larger disk on top of a smaller disk . Disks can
only be moved to empty stacks or on top of larger disks.
3. If there is only one place the disk can be moved to, it will be moved there
automatically.

Modes of Play

You can choose the number of disks you start out with by selecting an option from the
drop-down list before you start your game. There is actually no limit to the number of disks
you can start out with and still be able to solve the puzzle. However, the number of moves
required to solve the puzzle increases exponentially as the number of disks increases;
therefore we have limited the maximum number of disks to six, as six disks provides a nice
challenge without being overly tedious to solve.

 STEPS IN SOLVING TOWER OF HANOI (0DD and EVEN)


Odd Number of Disks Even Number of Disks
1. Move Disk 1 to the 1. Move Disk 1 to the
LEFT RIGHT
2. Move Disk 2 (only move) 2. Move Disk 2 (only move)
3. Move Disk 1 to the LEFT 3. Move Disk 1 to the RIGHT
4. Move Disk 3 (only move) 4. Move Disk 3 (only move)
5. Move Disk 1 to the LEFT 5. Move Disk 1 to the RIGHT
6. Move Disk 2 (only move) 6. Move Disk 2 (only move)
7. Move Disk 1 to the LEFT 7. Move Disk 1 to the RIGHT
8. Move a Big Disk 8. Move a Big Disk
II. OBJECTIVE

We have a formula for the minimum moves with the Tower of Hanoi. It is actually powers of
2 with one subtracted: 2n− 1, where n is the number of disks.

Tower of Hanoi math explained you might have identified that to move N disks from one peg
to another. The number of steps almost double every time you insert another disk in the stack.

Let us prove that the number of steps in 2n −1. The question is what the minimum number of
moves (an) is required to move all the n− disks to another peg. Let’s look at a recursive solution

One can already see that a1 =1,a2 =3, a3 =7 and so on

Therefore, the recurrence relation for this puzzle would become:

a1 =1, a2 =3; an =2an−1 +1; n≥2

III. DISCOVERY AND EXPLORATIONS

Tower of Hanoi is a mathematical puzzle. It consists of three poles and a number of disks of
different sizes which can slide onto any poles. The disks are arranged in order, no two of them
the same size, with the largest on the bottom and the smallest on top. A larger disk may never be
placed on a smaller one, and there is only one intermediate location where disks can be
temporarily placed.

We observe that if you have placed the first disc to the wrong pole, you have to repeat it until
the beginning. There is a simple solution for the toy puzzle like for, you should alternate moves
between the smallest piece and a non-smallest piece. When moving the smallest piece, always
move it to the next position in the same direction (to the right if the starting number of pieces is
even, to the left if the starting number of pieces is odd). If there is no tower position in the
chosen direction, move the piece to the opposite end, but then continue to move in the correct
direction. For example, if you started with three pieces, you would move the smallest piece to the
opposite end, and then continue in the left direction after that. When the turn is to move the non-
smallest piece, there is only one legal move. Doing this will complete the puzzle in the fewest
moves. In the results of this, we actually move all the disks from the leftmost peg to the
rightmost peg, adhering to the following rules.

IV. CONCLUSION

Before starting solution of any problem, at first, we have to find out existence of solution of
the problem. So we must show the generalized “Tower of Hanoi” puzzle is soluble for any
number of pegs. At first, we prove the original “Tower of Hanoi” puzzle of three pegs can be
solved for any number of disks. Then it follows that generalized “Tower of Hanoi” is soluble
completely.

If we consider the original “Tower of Hanoi” with number of disks, n = 1, 2, 3, … then


minimum number of moves required 1, 3, 7, … respectively. Let for n = m disks, the tower is
transferable.

Now we consider a tower of n = m+1 disks and show that it is also transferable. As for n = m
disks, the tower is transferable, for n = m+1 disks, we can transfer first m disks to any other peg
than Source, leaving behind the last biggest disk. Now Source has the last biggest disk only, one
peg is empty, and last peg is equipped with first m disks sequentially. Hence we transfer the
biggest disk to empty peg and transfer the first m disks over the biggest disk. It is possible
because all pegs are identical as per rule of puzzle. So the original “tower of Hanoi” is soluble
for any number of disks.

So we can conclude that the four pegs “Tower of Hanoi” is soluble for any number of disks.
Eventually, it ensures the existence of solution of the generalized “Tower of Hanoi” puzzle.

V. REFLECTION

While the Tower of Hanoi’s past and present mainly involve recreational math, its future
involves major real world applications. The Tower of Hanoi game can be used to assess the
extent of various brain injuries and it also acts as an aid to rebuild neural pathways in the brain
and to forge new connections in the prefrontal lobe. Attempting to solve the Tower of Hanoi
exercises parts of the brain that help to manage time, present a business plan or make complex
arguments. Even without actually solving the puzzle, anyone who attempts to solve the Tower of
Hanoi can benefit.

Not only is the Tower of Hanoi beneficial in physical and mental terms, but also in terms of
certain jobs. The Tower of Hanoi is commonly used by psychologists to research and examine
problem solving skills. Problem solving skills can be acquired by calculating moves and
strategies while at the same time predicting possible outcomes. The recursive rule of the Tower
of Hanoi is studied and applied in computer programming and algorithms which helps to reduce
the amount of time it takes to create a program.

VI. BIBLIOGRAPHY

(n.d.). From weebly: https://towerofhanoi.weebly.com/real-world-


applications.html?fbclid=IwAR3LLeJwwOZlpRnN8QgIOwdFH2_qAhPRJsDhLzcNmjSLB
k9jRJrzROkqT0s
(n.d.). From Mathematics SL and HL teacher support material:
http://library.tedankara.k12.tr/IB/2012/mathesh/EX(9)/example09_e.pdf?fbclid=IwAR0YW
KfNHUWEV8SCREDysKo4BWjEtTXRfxetHPp1TSJplM2AKQeD4a5NDRE

Anjum, I. (2014, October 28). From LinkedIn: https://www.slideshare.net/IffatAnjum/tower-of-


hanoi-40851735?fbclid=IwAR0TQqGhm274j4VCYzizkhTCbSmSY-
OAZd47pLcrg5uqlXMqBQaLCmMMrFE

Bogomolny, A. (2010, January 04). "Tower of Hanoi from Interactive Mathematics Miscellany
and. From Cut The Knot: https://www.cut-the-knot.org/recurrence/hanoi.shtml

Math, D. (n.d.). From The Math Forum:


http://mathforum.org/dr.math/faq/faq.tower.hanoi.html?fbclid=IwAR35MxzC27DhJVynB_l
GGPiRE6HIJNbNtXJIUrtDlhm4_IKwDQRg5FWZ9bU

Mishra, A. (2016, December 26). From hackerearth:


https://www.hackerearth.com/blog/algorithms/tower-hanoi-recursion-game-algorithm-
explained/

You might also like