Torres de Hanoi



No grande templo de BENARES, na INDIA, debaixo da cupula que assinala o centro do mundo, existe uma placa de bronze na qual estao fixas 3 agulhas de diamante com pouco mais do que um pe' de altura e a espessura do corpo de uma abelha.
Ao criar o mundo, DEUS enfiou, numa destas agulhas, 64 discos de ouro.
ESTA E' A TORRE DE BRAMA!
Dia e noite, os sacerdotes ocupam-se na transferencia dos discos dessa agulha para uma das outras conforme as leis impostas por BRAMA.
Quando a torre tiver assim sido transferida para outra agulha, desfar-se-a' em po' com o templo e os BRAMANES e sera' chegado O FIM DO MUNDO.


Há alguma maneira de resolver as Torres de Hanoi para qualquer número de torres? Há alguma equação para determinar o número mínimo de movimentos necessários, dado o número de discos e torres?

Se cada movimento demorar 1 segundo, quanto tempo levará a mover 64 discos?

Hanoi


This bit of ancient folklore was invented by De Parville in 1884.

``In the great temple at Benares, says he, beneath the dome which marks the centre of the world, rests a brass plate in which are fixed three diamond needles, each a cubit high and as thick as the body of a bee. On one of these needles, at the creation, God placed sixty-four discs of pure gold, the largest disc resting on the brass plate, and the others getting smaller and smaller up to the top one. This is the Tower of Bramah. Day and night unceasingly the priests transfer the discs from one diamond needle to another according to the fixed and immutable laws of Bramah, which require that the priest on duty must not move more than one disc at a time and that he must place this disc on a needle so that there is no smaller disc below it. When the sixty-four discs shall have been thus transferred from the needle on which at the creation God placed them to one of the other needles, tower, temple, and Brahmins alike will crumble into dust, and with a thunderclap the world will vanish.''

Move the discs to another pole.


Is there an algorithm for solving the Hanoi tower puzzle for any number of towers? Is there an equation for determining the minimum number of moves required to solve it, given a variable number of disks and towers?