Skip to main content
OlympiadHQ

Browse · MathNet

Print

Mathematical Olympiad Rioplatense

Argentina counting and probability

Problem

Let be a fixed integer. Two players and write down numbers, each number in continuation to the previous expression. First writes or , then writes or , then writes or etc.; at step the player to move must write or . The objective of each one is that after a move of his several consecutive numbers in the obtained expression, taken with their signs, have sum divisible by . For each determine which of the players has a winning strategy, if any.
Solution
The first player has a winning strategy if is congruent to or modulo , otherwise the second player has one.

Let where and . Then starts with and in the sequel negates all moves of until writes . Here "negates" means that writes or according as writes or . We may assume that the first move of is or else wins by writing ( is divisible by for all ). Moreover we may assume that also negates each move of up to step . If does not do so at step then the expression ends or after step . So wins at step by writing or respectively, because for all . Thus the sum is obtained at step , after a move of .

Neither player has won the game by that moment. Indeed denote , then for odd and for even. It follows that if then for of the same parity and for of different parity. In particular . So there is no winner yet if . This is the case here, with and . Note that the argument works for () where is not present in the sum but can be assumed.

Now wins by writing . If then the sum of the last two numbers is divisible by ; if then so is the sum of the last four numbers .

Player has an analogous winning strategy for where and . Without loss of generality starts the game with (if has a winning strategy for a game starting , he can just negate his moves in this strategy if 's opening move is ). Now answers and in general negates 's moves up to step . One may suppose again that also negates 's moves, due to the identity . Thus the sum is obtained at step , after a move of . It was shown above that whenever , so that there is no winner yet by that time. The next move of is winning. If then ; if then .
Final answer
Player A wins if and only if N ≡ 0 or 1 (mod 4); otherwise, for N ≡ 2 or 3 (mod 4), player B wins.

Techniques

Games / greedy algorithmsInvariants / monovariantsOther