Frieren and a mimic use treasure chests to play a game. At the beginning, all chests are empty and unlocked. In each year, Frieren adds a gem in an unlocked chest, then the mimic acts according to the following rules:
- If there is only one unlocked chest, unlock all chests;
- If there are more than one unlocked chests, the mimic chooses to lock one of the unlocked chests.
Prove that there exists a constant such that, no matter how the mimic acts, Frieren can always guarantee that, at the end of any year, the difference between the number of gems in any two chests never exceeds . (Remark. The mimics are not allowed to eat Frieren.)
Solution
In general, for chests, we may take . Frieren's strategy is simple: in each year, among the unlocked chests, choose one with the fewest gems and add a gem to it. (Remark. This is not the only feasible strategy.)
To prove that this strategy works, let be the number of gems in the chests at the end of year , and let . We have the following observations:
(a) For any , there exists a unique such that ;
(b) For any , ;
(c) Since the number of locked chests at the end of year equals the remainder of divided by , if , there must exist an unlocked chest with a number of gems not exceeding , so .
Our goal is to prove that holds for all . To do this, we will construct an increasing sequence satisfying , together with
If this holds, then by (1) we have and by (2) we have , so , which completes the proof.
To this end, let us construct . Let , then it is easy to see that is increasing and . We then define
Then it is easy to see that , and
Now, (2) clearly holds, so we only need to prove that (1) holds. We proceed by induction on . Suppose the original statement holds for , and suppose we have
Note that from to , both sides of the inequality increase by at most , so (4) implies that the following three things must occur simultaneously:
(d) There must exist such that , that is, ;
(e) For all , , that is, ;
(f) .
However:
- By the induction hypothesis and (f), ;
- By (d), the remainder of modulo is at most , so by the previous point and (3), ;
- By (d), the remainder of modulo is at most , so by (c), ;
- But by (e), , together with the non-decreasing property, gives ; combined with the previous point, we get .
Combining the above, we have , so by (f)
which contradicts the induction hypothesis. Therefore (1) holds. This completes the proof.