Skip to main content
OlympiadHQ

Browse · MathNet

Print

National Olympiad of Argentina

Argentina counting and probability

Problem

The numbers are written in a row. Two players take turns in writing or between two consecutive numbers for as long as this is possible. The first player wins if the obtained algebraic sum is divisible by ; otherwise the second player wins. Find a winning strategy for one of the players.
Solution
The first player has a winning strategy.

One may reduce modulo , so assume that the initial numbers are (670 triples ).

Let divide the gaps between numbers into one group of (a double), corresponding to the initial , and groups of (triples), each corresponding to consecutive . makes his first move in a triple. Then he can ensure to be the one making the last move in each group as follows:

a) If moves in the double, repeats the same move with the second gap in the double.

b) If is the one to move first in a triple, moves first in another triple.

c) If is the one to move second in a triple, makes the third remaining move in the same triple.

Observe that can always stick to these rules because there are an odd number of triples () and his initial move is in one of them. Hence if several moves were made according to a)–c) and it is 's turn to play, there are an even number of triples where no move was made; and or moves were made in each remaining triple.

In case b) 's move can be arbitrary. In case c), where completes a triple , he plays to ensure the following. If eventually has the form then the two are the same; and if has the form then one of the two is . This is always possible by direct verification.

After all moves are complete we obtain the sum of several products, some of them possibly with one factor. If a product in does not contain then it can be , or ; however is excluded. Indeed, such a cannot come from a triple because by the previous paragraph one of the two is . Similarly if a comes from the double then is .

So a product in without a is either a or a , meaning that it is contained in a part or of . If the and the are in a triple then the triple is as the two are the same, and one is a . If the and the are in the double then the double is (by a)). We conclude that the products without a in come in pairs of the form or (for the double). It follows that is divisible by , so wins.

Techniques

Games / greedy algorithmsOther