Browse · MathNet
PrintInternational Mathematical Olympiad
counting and probability
Problem
Let be a prime number. Eduardo and Fernando play the following game making moves alternately: in each move, the current player chooses an index in the set that was not chosen before by either of the two players and then chooses an element of the set . Eduardo has the first move. The game ends after all the indices have been chosen. Then the following number is computed: The goal of Eduardo is to make the number divisible by , and the goal of Fernando is to prevent this. Prove that Eduardo has a winning strategy.
Solution
If or then Eduardo chooses and in the first move, and wins, since, independently of the next moves, will be a multiple of .
Now assume that the prime number does not belong to . Eduardo chooses and in the first move. By Fermat's Little Theorem, , so . Since is prime, either or . Thus we have two cases:
Case a:
In this case, for each move of Fernando, Eduardo immediately makes the move , if , or , if . We will have , and so . Notice that this move by Eduardo is always possible. Indeed, immediately before a move by Fernando, for any set of the type with , either no element of this set was chosen as an index by the players in the previous moves or else both elements of this set were chosen as indices by the players in the previous moves. Therefore, after each of his moves, Eduardo always makes the sum of the numbers corresponding to the already chosen pairs divisible by , and thus wins the game.
Case b:
In this case, for each move of Fernando, Eduardo immediately makes the move , if , or , if . The same argument as above shows that Eduardo can always make such move. We will have , and so . Therefore, at the end of the game, the sum of all terms will be congruent to and Eduardo wins the game.
Now assume that the prime number does not belong to . Eduardo chooses and in the first move. By Fermat's Little Theorem, , so . Since is prime, either or . Thus we have two cases:
Case a:
In this case, for each move of Fernando, Eduardo immediately makes the move , if , or , if . We will have , and so . Notice that this move by Eduardo is always possible. Indeed, immediately before a move by Fernando, for any set of the type with , either no element of this set was chosen as an index by the players in the previous moves or else both elements of this set were chosen as indices by the players in the previous moves. Therefore, after each of his moves, Eduardo always makes the sum of the numbers corresponding to the already chosen pairs divisible by , and thus wins the game.
Case b:
In this case, for each move of Fernando, Eduardo immediately makes the move , if , or , if . The same argument as above shows that Eduardo can always make such move. We will have , and so . Therefore, at the end of the game, the sum of all terms will be congruent to and Eduardo wins the game.
Techniques
Games / greedy algorithmsInvariants / monovariantsFermat / Euler / Wilson theorems