Maths Olympiad Prep

Library / /83 of 86

Combinatorics Difficulty 7.7 National Olympiad, round 2 Prove it United States

Problem:

A game is played with two players and an initial stack of nn pennies (n3n \geq 3). The players take turns choosing one of the stacks of pennies on the table and splitting it into two stacks. The winner is the player who makes a move that causes all stacks to be of height 1 or 2. For which starting values of nn does the player who goes first win, assuming best play by both players?

Solutions — 2

Solution 1

Solution:

Player 1 wins if and only if n=3n=3 or nn is even; player 2 wins for all odd n>3n>3. We can easily check this for the first few cases, say up to n=6n=6, and then we can proceed by induction.

- If n>6n>6 is even, player 1 creates a pile of size 1 and a pile of size n1n-1. Since n1n-1 is odd, player 1 will win by the inductive hypothesis (since player 1 is now going second and the "starting position" has an odd number of pennies).

- If n7n \geq 7 is odd, player 1 will create one odd and one even pile. Player 2 can then divide the even pile into two odd piles. Continuing in this way, player 2 can always answer player 1's move and present player 1 with only odd piles. When the piles reach size 1, they are irrelevant. The critical value is size 3: the only way that player 2 can lose is if player 2 presents player 1 with a single 3-pile (and many 1-piles). But for this to happen, player 1 would have to have produced either a single 2-pile and one 3-pile, or a single 4-pile. In either case, player 2 wins on the next move by reducing, in the first case, the 3-pile to a 1- and 2-pile, and in the second case, breaking the 4-pile into two 2-piles. In sum, player 2's winning strategy is to always produce only odd piles unless this will produce all 1's and a single 3; in which case the "terminal" strategy above is employed.

Solution 2

Solution:

At each stage of the game, let SS be the sum of one less than each pile height. For example, if the piles are 8,6,2,2,18,6,2,2,1, then S=7+5+1+1+0S=7+5+1+1+0. Observe that SS is also equal to the total number of pennies minus the number of piles, and thus, SS always decreases by 1 each turn. We shall analyze the parity of SS.

The only way a player will win is if on their turn, one pile has 3 or 4 pennies, with the other piles (if there are any) of height 2 or 1. We call such a position "penultimate." For example, 4, 2, 2, 2, 1 is penultimate (and the winning move will split the 4 into two piles).

If a position is not penultimate, but can be turned into a penultimate position in one move, we call it "antepenultimate." For example, 4, 3, 2, 2, 2, 1 is antepenultimate (if the 4 is split). Notice that an antepenultimate position doesn't always have to become a penultimate position in one move. For example, with the position above, instead of splitting the 4, we could split one of the 2-piles.

The antepenultimate positions fall into 2 cases:
- A 5 or 6, and the rest (if any) are 22's and 11's.
- Two piles that are 3 or 4, and the rest (if any) are 22's and 11's.

We make two observations:
- The number of 1's are irrelevant (since they cannot be changed, and also they do not alter the value of SS).
- Without loss of generality, the number of 22's in a pile (if there are any) is either 1 or 2. If a position had more than two 2's, they can be removed and it would not change the parity of SS, nor would it affect who wins the game (since the only thing that can be done with a 2-pile is either to leave it alone or split it into two 1-piles).

Thus there are only a few cases to check, and in all of them, we discover that:
If a position is antepenultimate and SS is odd, then the player who has this position will win. If a position is antepenultimate and SS is even, then the player who has this position will lose.

For example, 5, 2, 1 is antepenultimate and S=5S=5. The player splits the 2, and then her opponent has no choice but to split the 5, handing the penultimate position to the first player, who wins.

Now we can use this analysis to look at what happens from the very start of the game.
- If n=3n=3 or n=4n=4, the first player already has a penultimate position and wins.
- If n=5n=5, then the starting position is antepenultimate and SS is even. Clearly the second player wins.
- If n=6n=6, then the starting position is antepenultimate and SS is odd. Clearly the first player wins.
- If n>7n>7, then the starting position is not antepenultimate. If SS is odd to start, it will always be odd when it is player 1's turn (since SS drops by 1 each time). So at some point, player 1 will either get the penultimate position and will win, or will get the antepenultimate position with odd SS, and will win. By similar reasoning, if nn is odd, SS starts out even, and player 1 will lose.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.