Browse · MathNet
PrintBalkan Mathematical Olympiad
Romania counting and probability
Problem
Let be a positive integer. Determine the least integer for which the game below can be played indefinitely:
Consider boxes, labelled . For each index , box contains initially exactly coins. At each step, the following three substeps are performed in order:
(1) Choose boxes;
(2) Of these boxes, choose and remove at least half of the coins from each, and add to the remaining box, if labelled , a number of coins.
(3) If one of the boxes is left empty, the game ends; otherwise, go to the next step.
Consider boxes, labelled . For each index , box contains initially exactly coins. At each step, the following three substeps are performed in order:
(1) Choose boxes;
(2) Of these boxes, choose and remove at least half of the coins from each, and add to the remaining box, if labelled , a number of coins.
(3) If one of the boxes is left empty, the game ends; otherwise, go to the next step.
Solution
The required minimum is .
In this case the game can be played indefinitely by choosing the last boxes, , at each step: At step , if box has exactly coins, then coins are removed from that box, unless , in which case coins are added. Thus, after step has been performed, box contains exactly coins, unless , in which case it contains exactly coins. This game goes on indefinitely, since each time a box is supplied, at least coins are added, so it will then contain at least coins, good enough to survive the steps to its next supply.
We now show that no smaller value of works. So, let and suppose, if possible, that a game can be played indefinitely. Notice that a box currently containing exactly coins survives at most withdrawals; this will be referred to as the weight of that box. The sum of the weights of all boxes will referred to as the total weight. The argument hinges on the lemma below, proved at the end of the solution.
Lemma. Performing a step does not increase the total weight. Moreover, supplying one of the first boxes strictly decreases the total weight.
Since the total weight cannot strictly decrease indefinitely, , and from some stage on none of the first boxes is ever supplied. Recall that each step involves a -box choice. Since , from that stage on, each step involves a withdrawal from at least one of the first boxes. This cannot go on indefinitely, so the game must eventually come to an end, contradicting the assumption.
Consequently, a game that can be played indefinitely requires .
Proof of the Lemma. Since a withdrawal from a box decreases its weight by at least 1, it is sufficient to show that supplying a box increases its weight by at most ; and if the latter is amongst the first boxes, then its weight increases by at most . Let the box to be supplied be and let it currently contain exactly coins, to proceed by case analysis:
If , the weight increases by ; and if, in addition, , then the weight increases by .
If , then the weight increases by .
If , then the weight increases by since .
Finally, let to consider the subcases and . In the former subcase, the weight increases by and in the latter by since . This ends the proof and completes the solution.
In this case the game can be played indefinitely by choosing the last boxes, , at each step: At step , if box has exactly coins, then coins are removed from that box, unless , in which case coins are added. Thus, after step has been performed, box contains exactly coins, unless , in which case it contains exactly coins. This game goes on indefinitely, since each time a box is supplied, at least coins are added, so it will then contain at least coins, good enough to survive the steps to its next supply.
We now show that no smaller value of works. So, let and suppose, if possible, that a game can be played indefinitely. Notice that a box currently containing exactly coins survives at most withdrawals; this will be referred to as the weight of that box. The sum of the weights of all boxes will referred to as the total weight. The argument hinges on the lemma below, proved at the end of the solution.
Lemma. Performing a step does not increase the total weight. Moreover, supplying one of the first boxes strictly decreases the total weight.
Since the total weight cannot strictly decrease indefinitely, , and from some stage on none of the first boxes is ever supplied. Recall that each step involves a -box choice. Since , from that stage on, each step involves a withdrawal from at least one of the first boxes. This cannot go on indefinitely, so the game must eventually come to an end, contradicting the assumption.
Consequently, a game that can be played indefinitely requires .
Proof of the Lemma. Since a withdrawal from a box decreases its weight by at least 1, it is sufficient to show that supplying a box increases its weight by at most ; and if the latter is amongst the first boxes, then its weight increases by at most . Let the box to be supplied be and let it currently contain exactly coins, to proceed by case analysis:
If , the weight increases by ; and if, in addition, , then the weight increases by .
If , then the weight increases by .
If , then the weight increases by since .
Finally, let to consider the subcases and . In the former subcase, the weight increases by and in the latter by since . This ends the proof and completes the solution.
Final answer
n = 2^k + k - 1
Techniques
Invariants / monovariantsGames / greedy algorithms