Picking apart Towers of Hanoi

1. Background As a legend goes, there’s a spacious room in Kashi Vishwanath, India that consists of 64 golden disks, each smaller than the other, with three time-worn posts. Priests at the temple have been moving the disks according to the perpetual rules of Brahma. It is believed that once the last move of this…

The Halting Problem

Picture Credits: xkcd Infinite Loops. We all know them. A simple program like – while (true) { System.out.print(“Hello, world”); } will continue forever; whereas the program – System.out.print(“Hello, world”); will execute that line and stop. Sometimes, it is too obvious as in the example above. Other times, we have to rack our brains figuring out…