Wednesday, 5 February 2020


Last week I witnessed the birth of a wonderful new verb. One of my colleagues had borrowed his girlfriend's car to get to work. When he bought a new car he had to drive his girlfriend's car home and then get his dad to pick him up and take him to his new car so that he could then use that to give his girlfriend a lift home so that eventually she would be re-united with her car and he would be in the same place as his new car. He said "I'm off to towers of Hanoi my new car".  Most of my readers are computer programmers so you're probably already thinking how perfect it is. If you're not familiar with it, the Towers of Hanoi is a little puzzle with three pegs and a stack of different sized disks. You have to move the stack of disks from one peg to another. The rules are that you move one disk at a time, and that you can never put a bigger disk on top of a smaller one.

Computer programmers have almost always studied it because it's a beautiful example of recursion. The recursive solution is:
1) Move all but the biggest disk onto the spare peg. 2) Move the biggest disk to the destination peg. 3) Put the rest of the stack on top of it.
In step 1 and 3 How do you move the "rest of the stack" – you're only allowed to move one disk at a time? Just follow steps 1) 2) and 3)

Yesterday a friend drove from his house to an MOT station so that he could pick ne up there and take me home, leaving my boring car at the MOT station. This morning, after pushing my scooter out of its way I drove my sports car to the MOT station so that I could leave it there and get in my boring car to get to work.

Richard "Bring on the self-driving cars" B

No comments:

Post a Comment