Tower of Hanoi
Tower of Hanoi
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.
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.
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. 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.
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
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.
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
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