You and a friend play a game in which there are an odd number of rocks. You can take 1, 2 or 3 rocks on your turn (alternating turns with your opponent); when all rocks have been taken, the person who has taken an odd number of rocks is the winner.
If you are the first to go, what strategy should you use in order to have the best chance of winning?
(In reply to
re: strategy by SilverKnight)
But as for a request in the second part, the following table should help:
The following table makes the strategy more straightforward. It shows, according to the number left to you, mod 8, and the parity of the number you've collected so far, how many rocks to take:
What remains mod 8: 0 1 2 3 4 5 6 7
You have an even number:  1 1 3 3  2 2
You have an odd number: 3  2 2  1 1 3
When the game begins you have zero rocks so far, an even number, so if you are presented with a number that is congruent to either 0 or 5 mod 8, you don't have a winning strategy.

Posted by Charlie
on 20040420 20:31:22 