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?
You must take an amount such that one of the following holds:
1. All you have taken so far, including the latest move, is odd and you leave 1 mod 8 for your opponent.
2. All you have taken so far, including the latest move, is odd and you leave 0 mod 8 for your opponent.
3. All you have taken so far, including the latest move, is even and you leave 4 mod 8 for your opponent.
4. All you have taken so far, including the latest move, is even and you leave 5 mod 8 for your opponent.
Any of the parities and mod values the opponent is forced to leave (that is, any set as viewed by your opponent, that's not on the list) allows you to return to one of the four winning types of move.
Edited on January 14, 2024, 9:45 am