Problem #90
Capture of Cerberus
The story
Hercules now has to bring back Cerberus, the three headed dog from the underworld. Cerberus being an intelligent beast, lures Hercules to a game of gates. If Hercules wins, he will come back with him, otherwise, Hercules has to spend the rest of his days in the underworld.
The game
Rules:
- There are a total of N = 18 gates, some of which are open and some which are closed.
- At each turn, the player has to open a closed gate first, and choose to close/open upto 4 gates to the left of the first chosen gate. (Here total number of changed gates c=5). He can either open a closed gate or close an open one.
The player to open the last closed gate wins the game.
The trial match
Hercules requests for a trial match and Cerberus agrees to play a toned down version of the above game, with N = 5 and c = 3. He sets up the initial configuration as this:
CCCCO (C = closed, O = open)
Cerberus urges Hercules to go first. Now, no matter what Hercules does, it is easy to see that Cerberus will always be the one to open the last closed gate. Such a position will always cause Hercules to lose, that is, if he goes first.