Skip to main content
OlympiadHQ

Browse · MathNet

Print

Argentine National Olympiad 2016

Argentina 2016 counting and probability

Problem

Alex and Bibi play the following game. Alex chooses a natural number not exceeding . Then Bibi chooses a collection of integers in , not necessarily distinct, where . Now Alex is allowed to apply repeatedly the following operation on : choosing numbers from and changing them as follows. For each the number is replaced by if and by if .

Alex wins if via several operations he succeeds in making all numbers in equal to ; if he fails then Bibi wins. Find all that guarantee Alex a win, regardless of the collection chosen by Bibi.
Solution
The winning values of are the numbers in that are coprime with , i.e., not divisible by , or .

Despite the repetitions in Bibi's collection for brevity we call it a set in the solution and denote the number of its elements by . The allowed operation is choosing a -element subset of and increasing each of its elements by modulo .

Let us show that a winning number is coprime with . Assume on the contrary that and consider any set chosen by Bibi. Let the elements of have sum . Suppose Alex chooses numbers from of which are . Then the operation increases by , a number divisible by in view of . Hence the operation does not change modulo , for any choice of . Let contain one number and zeros. Then persists after each operation, while the desired "all zeros" final state requires . The contradiction proves that is a necessary condition for to be winning.

Conversely, is sufficient. For a proof consider the unique integer in such that . Let any set chosen by Bibi and an arbitrary element. It is enough to show that there is a sequence of operations that adds modulo to without affecting the remaining numbers in .

Take a -element subset of that contains . This is possible as . Apply the operation times to each -element subset of . Each element of is contained in exactly such subsets, so the procedure increases it times modulo . Because , the result is that each element of is increased by modulo . Now take the -element subset of and apply the operation times. After all described operations each element of is increased by modulo with respect to its initial state, meaning that the operations do not change it. Clearly the elements of do not change either. The only change concerns which is increased by modulo , as needed. Hence is a sufficient condition, and the solution is complete.
Final answer
All integers k with 1 ≤ k ≤ 1000 that are coprime to 1001; equivalently, k not divisible by 7, 11, or 13.

Techniques

Invariants / monovariantsGames / greedy algorithmsCounting two waysInverses mod nGreatest common divisors (gcd)