Maths Olympiad Prep

Library / /32 of 32

Combinatorics Difficulty 7.0 National Olympiad, round 2 Prove it Romania

Two players, AA and BB, remove alternatively stones from a heap initially containing n2n \ge 2 stones. The first to move is AA who takes at least one stone and at most n1n-1 stones. Next, each player to move has to take at least one stone and at most as many stones as his opponent took in his previous move. The winner is the player who takes the last stone. Which player has a winning strategy?

Solution

Let us label (a,b)(a, b) the position meaning "the player who has to move finds aa stones in the heap and can take at most bb stones".

We prove that the losing positions are those of the forms (0,r)(0, r) and (2k(2m+1),r)(2^k(2m+1), r), where k,mNk, m \in \mathbb{N}, r{1,2,,2k1}r \in \{1, 2, \dots, 2^k - 1\}.

The initial position being (n,n1)(n, n-1), the losing initial positions are those with m=0m=0, i.e. the powers of 22. The conclusion will be that if nn is a power of 22, the second player has a winning strategy, while in the other cases, the first player has a winning strategy. Let us notice that:

- the game ends only in positions of the form (0,r)(0, r)

- from a position of the form (2k(2m+1),r)(2^k(2m+1), r), 0<r<2k0 < r < 2^k, there is no move that could leave the opponent in a position of similar form

- from any position that is not one of the above form, there exists a move that leaves the opponent in a position of the form (2k(2m+1),r)(2^k(2m+1), r), 0<r<2k0 < r < 2^k.

• If from (2k(2m+1),r)(2^k(2m+1), r), 0<r<2k0 < r < 2^k, one could move to (2s(2p+1),t)(2^s(2p+1), t), 0<t<2s0 < t < 2^s, that move would consist in removing tt stones, hence 2k(2m+1)2s(2p+1)=t2^k(2m+1) - 2^s(2p+1) = t. As tr<2kt \le r < 2^k, it follows that s<ks < k, hence 2s2k(2m+1)2s(2p+1)2^s \mid 2^k(2m+1) - 2^s(2p+1). Then 2st2^s \mid t, which contradicts 0<t<2s0 < t < 2^s. In conclusion, such a move does not exist.

Obviously, there is no move to a position (0,x)(0, x) either.

• From any of the remaining positions, that is (2k(2m+1),r)(2^k(2m+1), r) with r2kr \ge 2^k, there is a move that leaves the opponent in position (2k2m,2k)(2^k \cdot 2m, 2^k), obviously a losing one. Simply take 2k2^k stones.

From the above, it is easy to see what the appropriate winning strategy is for the player that has such a strategy: always take 2k2^k stones, where 2k2^k is the largest power of 22 that divides the number of the remaining stones.

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.