Monday, January 23, 2006

Math 1: Tower of Hanoi Facts ( Problem of Recursion )

According to the legend of the Tower of Hanoi (originally the "Tower of Brahma" in a temple in the Indian city of Benares), the temple priests are to transfer a tower consisting of 64 fragile disks of gold from one part of the temple to another, one disk at a time. The disks are arranged in order, no two of them the same size, with the largest on the bottom and the smallest on top. Because of their fragility, a larger disk may never be placed on a smaller one, and there is only one intermediate location where disks can be temporarily placed. It is said that before the priests complete their task the temple will crumble into dust and the world will vanish in a clap of thunder. Interested in knowing the reason?

The formula to find number of steps it takes to tranfer "n" disk is 2^n - 1

Even if it only takes the priests one second to make each move, it will be 2^64 - 1 seconds before the world will end. This is 590,000,000,000 years (that's 590 billion years) - far, far longer than some scientists estimate the solar system will last. That's a really long time!

Click here to see detalied explanation

Posted by selvan at 5:23 PM 0 comments