History and Background of Tower of Hanoi

"Legend has it that a group of Eastern monks are the keepers of three towers on which sit 64 golden rings. Originally all 64 rings were stacked on one tower with each ring smaller than the one beneath. The monks are to move the rings from this first tower to the third tower one at a time but never moving a larger ring on top of a smaller one. Once the 64 rings have all been moved, the world will come to an end."


The tower of Hanoi (commonly also known as the "towers of Hanoi"), is a puzzle invented by a French mathematician Edouard Lucas in 1883. It is also known as the Tower of Brahma puzzle.

There are many variations on this legend. For instance, in some tellings, there is a story about an Indian monastery in Kashi Vishwanath which contains a large room with three time-worn posts in it surrounded by 64 golden disks. The temple or monastery may be said to be in different parts of the world 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.

Edouard Lucas (1841-1891)


Original copy of the "Tower of Hanoi"


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 move 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.


  4. Given a stack of n disks arranged from largest on the bottom to smallest on top placed on a rod, together with two empty rods, 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 puzzle with n=4 pegs and n disks is sometimes known as Reve's puzzle.



    The game also appeared as an intelligence test for apes in the film Rise of the Planet of the Apes (2011) under the name "Lucas Tower."