Browse · MathNet
PrintMathematical Olympiad Rioplatense
Argentina counting and probability
Problem
Players and play a game as follows. Initially arranges the numbers in a row as he wishes; is a given positive integer. Next, chooses one number and puts a stone on it. Then moves the stone to an adjacent number, does the same and so on. The stone can be placed on number at most times, ; the initial move of is counted. The one who cannot move loses. For each determine who has a winning strategy.
Solution
Player has a winning strategy if is or modulo , otherwise has one.
Putting the stone on a number can be viewed as subtracting from it. We may assume that chooses a number in 's arrangement and subtracts from it; then must subtract from an adjacent number etc. Operating on a number (subtracting ) is allowed only if the number is positive. Note that each player always moves at positions with the same parity.
Let be an arrangement of nonnegative integers, not necessarily distinct. We call it balanced if there exist nonnegative integers such that
We show that can win if and only if his initial arrangement is balanced. This applies not only to but to any given collection of nonnegative integers (zeros and repetitions are allowed).
Suppose that has a move in a balanced arrangement , subtracting from . Then or as the move is possible, say . So is able to respond: he can subtract from since . Moreover the resulting arrangement is balanced. Only and have changed, replaced by and with , and due to . Hence if has a move in a balanced arrangement then has an answering move leading to a balanced arrangement again. Since the game always terminates, it will be therefore to end up without a legal move.
Suppose next that 's initial arrangement is not balanced. Then can win by reducing the game to a balanced case like above where he plays the winning rôle. Define Set and observe that for some . Indeed let for all . Then by the definition of the . Now notice that . Otherwise the equalities would hold with nonnegative 's and the arrangement would be balanced. In conclusion .
Let start at the first position such that , that is, . Note that for by the minimum choice of . Since holds after the opening move, can play at position at least more times, regardless of 's moves on or . (For assume .) So let keep moving at until has to move at for the st time. Call such a move of move M. It is forced since has at most moves at .
Right before move M the first positions are occupied by as was decreased times and no moves at previous positions were made. Observe now that is a balanced arrangement. Indeed it was noted that for all . So we see that conditions hold for the numbers at the first positions: it is enough to redefine and as and .
Consequently 's move M, if possible, can be regarded as the opening move in a balanced arrangement. So can apply the winning strategy of the first player for the balanced case. The only further remark needed is that has no escape from positions . Wherever plays at these positions (following the strategy mentioned), it will be at a position with the parity of , hence . Thus the game is confined to the first positions and the strategy does apply; so wins.
A collection of integers has a balanced arrangement only if its total sum is even. Indeed by the definition. Therefore there is no balanced arrangement of for where is odd. So has a winning strategy if is or modulo . On the other hand a balanced arrangement of exists if or , . Write the odd numbers in in ascending order, then the even numbers in descending order. For the arrangement is
For just ignore . Thus has a winning strategy if is or modulo .
Putting the stone on a number can be viewed as subtracting from it. We may assume that chooses a number in 's arrangement and subtracts from it; then must subtract from an adjacent number etc. Operating on a number (subtracting ) is allowed only if the number is positive. Note that each player always moves at positions with the same parity.
Let be an arrangement of nonnegative integers, not necessarily distinct. We call it balanced if there exist nonnegative integers such that
We show that can win if and only if his initial arrangement is balanced. This applies not only to but to any given collection of nonnegative integers (zeros and repetitions are allowed).
Suppose that has a move in a balanced arrangement , subtracting from . Then or as the move is possible, say . So is able to respond: he can subtract from since . Moreover the resulting arrangement is balanced. Only and have changed, replaced by and with , and due to . Hence if has a move in a balanced arrangement then has an answering move leading to a balanced arrangement again. Since the game always terminates, it will be therefore to end up without a legal move.
Suppose next that 's initial arrangement is not balanced. Then can win by reducing the game to a balanced case like above where he plays the winning rôle. Define Set and observe that for some . Indeed let for all . Then by the definition of the . Now notice that . Otherwise the equalities would hold with nonnegative 's and the arrangement would be balanced. In conclusion .
Let start at the first position such that , that is, . Note that for by the minimum choice of . Since holds after the opening move, can play at position at least more times, regardless of 's moves on or . (For assume .) So let keep moving at until has to move at for the st time. Call such a move of move M. It is forced since has at most moves at .
Right before move M the first positions are occupied by as was decreased times and no moves at previous positions were made. Observe now that is a balanced arrangement. Indeed it was noted that for all . So we see that conditions hold for the numbers at the first positions: it is enough to redefine and as and .
Consequently 's move M, if possible, can be regarded as the opening move in a balanced arrangement. So can apply the winning strategy of the first player for the balanced case. The only further remark needed is that has no escape from positions . Wherever plays at these positions (following the strategy mentioned), it will be at a position with the parity of , hence . Thus the game is confined to the first positions and the strategy does apply; so wins.
A collection of integers has a balanced arrangement only if its total sum is even. Indeed by the definition. Therefore there is no balanced arrangement of for where is odd. So has a winning strategy if is or modulo . On the other hand a balanced arrangement of exists if or , . Write the odd numbers in in ascending order, then the even numbers in descending order. For the arrangement is
For just ignore . Thus has a winning strategy if is or modulo .
Final answer
A wins if and only if n ≡ 0 or 3 (mod 4); otherwise B wins.
Techniques
Games / greedy algorithmsInvariants / monovariants