Let and be positive integers. We consider lines on the plane such that no two of them are parallel and no three of them intersect in a single point. On each of the intersection points of these lines there are coins. Ana and Beto play the following game: each player, in their turn, chooses a point that does not lie on the same line as the point chosen in the previous turn by the other player, and discards one coin from that point. Ana makes the first move and she can choose any point. The player who cannot make a move loses the game.
Determine, for each value of and , which player has a winning strategy.
Solution
We will prove that Ana has a winning strategy if and only if the total number of coins is odd. It is easy to see that this happens if and only if is odd and or \pmod{4}$.
For the rest of the solution we think of the lines as numbered from to and denote by the intersection of lines and .
We will say that a pairing of a family of coins is good if coins in the same pair are not in the same line. We claim that there is a good pairing that leaves at most one coin out.
If we proceed by induction. For we can pair coins according to the following pairs of points
and for we can do it according to
For the inductive step we assume that we already have lines and we add two new lines and . We use the inductive hypothesis to pair coins in intersections between old lines and to pair coins at intersections of old and new lines. It remains to be decided what to do with the coin at and with zero or one coins, the discarded one among the old lines. In the first case we discard and in the second we pair the two of them.
For the general case we paint the coins with colors in such a way that any two coins on the same point of intersection have different color. In particular, there are the same number of coins of each color. We consider two cases.
If this number is even, we use the case to find a pairing among the coins of each color and we are done.
If this number is odd, we use the case to find a pairing of all coins but one of each color. The discarded coins are chosen to be at and so that we can find a pairing among them that leaves at most one out as desired. Now that the claim is proved let's fix a good pairing that leaves at most one coin out. If the number of coins is even then there is no coin left out and if it is odd then there is one.
In the first case Beto has a winning strategy: every time that Ana chooses a coin he chooses the other coin in the same pair of our fixed good pairing.
In the second case Ana has a winning strategy: she first chooses the coin left out and then she proceeds as Beto in the previous case.