The Tower of Brahma (also called the Tower of Hanoi or Lucas’ Tower) is a mathematical game or puzzle. It consists of three rods and a number of disks of different sizes, which can slide onto any rod. The disks are in a neat stack in ascending order of size on one rod, the smallest at the top, thus making conical shape. The towers of Hanoi puzzle asks for the minimum number of moves required to move the stack from one rod to another, where moves are allowed only if they place smaller disks on top of larger disks.
The objective of the puzzle is to move the entire stack to another rod, obeying the following 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 i.e. a disk can only be moved if it is the uppermost disk on a stack.
3)No disk may be placed on top of a smaller disk.
The puzzle was invented by the French mathematician Édouard Lucas in 1883.
There is a story about an Indian temple in Kashi Vishwanath, which contains a large room with three needles in it. Brahma placed 64 disks of pure gold on one of these needles at the time of Creation. Each disk is a different size, and each is placed so that it rests on top of another disk of greater size, with the largest resting on the brass plate at the bottom and the smallest at the top. Within the temple are priests whose job it is to transfer all the gold disks from their original needle to one of the others, without ever moving more than one disk at a time. No priest can ever place any disk on top of a smaller one, or anywhere else except on one of the needles. 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 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 2(power 64) − 1 seconds, or roughly 585 billion years to finish, which is about 42 times the current age of the Universe.
There are many variations on this legend. For instance, in some tellings, 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 anyreligion. 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.
Source: Tower of Hanoi