
Drunken Tower of Hanoi
Bob is very familiar with the famous mathematical puzzle/game, "Tower of Hanoi," which consists of three upright rods and disks of different sizes that can slide onto any of the rods. The game begins with a stack of
- Only one disk can be moved at a time.
- A valid move consists of taking the top disk from one stack and placing it onto another stack (or an empty rod).
- No disk can be placed on top of a smaller disk.
Moving on to a variant of this game, consider a long room
Bob begins the game standing at square
Unfortunately, Bob is also drunk. On a given move, Bob will either stumble one square to the left or one square to the right with equal probability, unless Bob is at either end of the room, in which case he can only move in one direction. Despite Bob's inebriated state, he is still capable of following the rules of the game itself, as well as choosing when to pick up or put down a disk.
The following animation depicts a side-view of a sample game for
Let
Interestingly enough, the result is always an integer. For example,
Find the last nine digits of