image.

The Towers of Brahma and the End of the Universe

Lucas.

The Towers of Hanoi actually have very little to do with the city of Hanoi in present day Vietnam. The earliest recorded reference is from Édouard Lucas (in Récréations Mathématiques, Vol. 3, pp. 55–59, Gauthier-Villars, Paris, 1893), who reports that: In the temple of Kashi Vishwanath in Varanasi, Uttar Pradesh, India, a set of 64 gold disks on 3 diamond needles called the Towers of Brahma which monks have been trying to solve since the beginning of time. Supposedly the Universe will end when they succeed in moving the 64 discs from the start needle to the end needle without breaking any of the rules.

Although this story is most likely the product of the fevered imagination of a French mathematician, the claim about the Universe ending isn't as far-fetched as it sounds. The Towers of Hanoi with 64 discs will take 264−1 = 1.84 × 1019 moves to solve. At one move per second, that will take about 5.85x1011 years. The current age of the Universe is reputed to be, according to various sources, between a few thousand and 1.38x1010 years. Therefore, it will take the monks at least 42 times the current age of the Universe to complete their task. So perhaps 42 really is the answer to Life, the Universe, and Everything and the Universe will end when the Towers of Brahma is solved.

Being nit-picky for a moment, the monks clearly couldn't have been working on the Towers of Brahma since the beginning of time because at the beginning of time there weren't any monks. There weren't any people. We're told that the Earth didn't form until 4.6 billion years ago, modern humans only appeared 2.2 million years ago, and the first human settlement in India was supposedly only about 70,000 years ago.

temple

The temple of Kashi Vishwanath very probably hasn't existed since the beginning of time either. The date of its construction is unclear, but it is apparently mentioned in the Skanda Purana, which is itself difficult to date but is generally though to have been written in the 6th or 7th Century. We do know that the temple of Kashi Vishwanath was demolished in 1194, rebuilt in the 1200s, demolished again in the 1400s, and rebuilt again in 1585. In 1669 it was demolished yet again and replaced by a mosque. In 1780 the present temple was constructed adjacent to the mosque. It is difficult to imagine the monks being able to concentrate on their task with all this destruction and construction going on, but perhaps they persevered grimly nonetheless.

If this is some concern to you, please observe the monks' progress on the Towers of Brahma below, assuming that they somehow managed to start around the time of the Big Bang, that they've made one move per second, that they haven't taken any breaks whatsoever (perhaps they work in shifts), and of course that they haven't made a mistake and had to start over. We've made a guess at the exact time of the Big Bang and we've ignored inconvenient things like leap years and time dilation due to Einstein's General Theory of Relativity, but as you can see, we still appear to have a very long time to go until the end of the Universe. Check back in a few months and see how much progress has been made. While you are waiting for this calamitous event to occur, you may as well play with Ian Parberry's online Towers of Hanoi or tackle one of the associated learning activities.

Bishop James Ussher

If you don't subscribe to Big Bang theory, or if you are just curious, you can change the start date by using the radio buttons below the puzzle. One of the choices is October 23, 4004 BC, the date of Creation according to Bishop James Ussher (The Annals of the Old Testament, 1650), pictured at right.

The black arrow on the left of the puzzle points out the smallest disc that hasn't yet been moved. It serves as a rough measure of how much progress has been made, on a logarithmic scale, because each disc takes twice as long to get started as the one on top of it. Unfortunately, some inconsiderate person or persons seem to have stolen the diamond needles and replaced the gold discs with cheap colored plastic ones, but this shouldn't interfere with your viewing pleasure.

Show the Towers of Brahma right now, assuming that it was started:
Now
An hour ago
Yesterday
A week ago
A month ago
A year ago
00:00 1/1/2000 (start of 21st Century)
00:00 1/1/1970 (Unix Epoch Zero)
1780 (Temple of K. V. last rebuilt)
500 AD (Temple of K. V. built)
October 23, 4004 BC (Biblical Creation)
70,000 years ago (first humans in India)
2.2 million years ago (first hominids)
230 million years ago (first dinosaurs)
3.5 billion years ago (first life on Earth)
4.6 billion years ago (Earth formed)
13.8 billion years ago (The Big Bang)
Whatever, just travel in time to the end

About This Animation

The animation of the Towers of Brahma is written in HTML5 and JavaScript. The JavaScript includes implementation of the algorithms from Algorithm Design Activity 4 and Theory of Algorithms Activity 3 in Active Learning with Ian Parberry's Towers of Hanoi.

Acknowledgement

This app uses bignumber.js by Jonas Raoni Soares Silva because JavaScript can't handle 64-bit integers and I'd rather not write my own long integer code right now.

image.
Created February 5, 2016 by Ian Parberry. Written in HTML 5, Javascript and CSS 3. Last updated March 7, 2016.