Skip to main content
OlympiadHQ

Browse · MathNet

Print

IMO Team Selection Test 2

Netherlands counting and probability

Problem

Let be a fixed positive integer. There are boxes , each with a number of stones in it such that . A move consists of the following operations: choose a box and distribute all the stones in the box among the boxes (including the box that was chosen) such that for every two boxes the numbers of stones added to those boxes differ by at most 1. For a distribution , we define as the least number of moves required to get all the stones into a single box. Let be the maximum of for all possible distributions such that . Determine and all distributions for which .

Example. If and the boxes contain 2, 6, 0, 4 stones in that order, then we can distribute the 2 stones from box by putting in each box in order 1, 0, 1, 0 stones. After this move, the number of stones in each box in order is 1, 6, 1, 4.
Solution
Answer: and if and only if .

First of all, we note that for every distribution, there exists a move such that increases by at least 1, unless all the stones are in a single box. To see this, pick a box containing the highest number of stones, pick a different non-empty box and distribute the stones from that box such that at least one stone goes into the box containing the highest number of stones. It follows that . Specifically, if , then . The rest of the proof will follow from the following four claims.

Claim 1. If , then . Proof. Let be the box containing the highest number of stones, and be the box containing the second-highest number of stones. Note that we must have and . Since is integer and , that means . While there exists a box other than or containing 2 or more stones, do the move consisting of distributing the stones in that box in such a way that and each receive a stone. The distribution we obtain by performing these moves has the properties that and that . Therefore we have , from which it follows that . Since is integer, we therefore have . Now we can do a move consisting of distributing 's stones in such a way that receives 2 stones. After that, while there exists a box other than that contains stones, we do a move consisting of distributing the stones in that box in such a way that receives 1 stone. Since receives at least two stones during one of the moves, and at least one during each of the other moves, the number of moves needed to make all boxes except empty is at most .

Claim 2. If , then . Proof. We make a random move and apply Claim 1 to the result. Then we are done in at most moves.

Claim 3. There are no moves so that the maximum increases by 3 or more. Proof. We proceed by contradiction. To make a move in which a box receives more than 3 stones, the box that was distributed from in that move would have to contain at least stones. This contradicts the fact that there are only stones. To make a move in which a box receives exactly 3 stones, the box that was distributed from should contain at least stones. Any box that contains the highest number of stones after this move, must contain at least stones, as the maximum has increased by at least 3. That box therefore must also have contained at least stones before this move. This requires stones and is therefore a contradiction.

Claim 4. If , then . Proof. Suppose for a contradiction that we can move all the stones into a single box in or fewer moves. Because of Claim 3, there are no moves where the maximum increases by 3 or more. That means there are at least two moves where the maximum increases by 2. Such moves we will call large moves. Note that each box receives at least 1 stone on a big move. Let move be the first large move, and let move be the last large move. Since a large move can only be performed with a box containing at least stones and each box starts with 3 stones , or equivalently . Let be the number of empty boxes at the beginning of move . Since each box contains at least 1 stone after move , we must have made at least one move per box that is empty by the beginning of move . Therefore . Since each box receives at least 1 stone again, after move there are at most boxes containing exactly 1 stone; the other boxes contain at least 2 stones each. Since we don't make any more large moves after move , it therefore takes at least moves afterwards to empty of the boxes. So the total number of moves is at least which contradicts our assumption that we could put all the stones into a single box in or fewer moves.
Final answer
Mn = 3n − 4, achieved if and only if all boxes initially contain three stones each.

Techniques

Invariants / monovariantsGames / greedy algorithmsColoring schemes, extremal arguments