Maths Olympiad Prep

Library / /11 of 14

Combinatorics Difficulty 7.8 National Olympiad, round 2 Prove it European Girls' Mathematical Olympiad (EGMO)

Problem:

Let nn be a positive integer. We have nn boxes where each box contains a nonnegative number of pebbles. In each move we are allowed to take two pebbles from a box we choose, throw away one of the pebbles and put the other pebble in another box we choose. An initial configuration of pebbles is called solvable if it is possible to reach a configuration with no empty box, in a finite (possibly zero) number of moves. Determine all initial configurations of pebbles which are not solvable, but become solvable when an additional pebble is added to a box, no matter which box is chosen.

Solutions — 2

Solution 1

Solution:

Number the boxes from 11 through nn and denote a configuration by x=(x1,x2,,xn)x = (x_{1}, x_{2}, \ldots, x_{n}) where xix_{i} is the number of pebbles in the iith box. Let
D(x)=i=1nxi12 D(x) = \sum_{i=1}^{n} \left\lfloor \frac{x_{i} - 1}{2} \right\rfloor
for a configuration xx. We can rewrite this in the form
D(x)=12N(x)n+12O(x) D(x) = \frac{1}{2} N(x) - n + \frac{1}{2} O(x)
where N(x)N(x) is the total number of pebbles and O(x)O(x) is the number of boxes with an odd number of pebbles for the configuration xx.

Note that a move either leaves DD the same (if it is made into a box containing an even number of pebbles) or decreases it by 11 (if it is made into a box with an odd number of pebbles). As DD is nonnegative for any configuration which does not have any empty boxes, it is also nonnegative for any solvable configuration. On the other hand, if a configuration has nonnegative DD, then making mi=(xi1)/2m_{i} = \left\lfloor (x_{i} - 1) / 2 \right\rfloor moves from the iith box into mim_{i} empty boxes for each ii with mi>0m_{i} > 0 fills all boxes as D(x)0D(x) \geq 0 means mi>0mi\sum_{m_{i} > 0} m_{i} \geq (number of empty boxes).

As N(x)N(x) and O(x)O(x) have the same parity, a configuration xx is solvable exactly when O(x)2nN(x)O(x) \geq 2n - N(x), and unsolvable exactly when O(x)2n2N(x)O(x) \leq 2n - 2 - N(x). In particular, any configuration with 2n12n - 1 pebbles is solvable, and a configuration with 2n22n - 2 pebbles is unsolvable if and only if all boxes contain even numbers of pebbles.

Suppose that xx' is obtained from xx by adding a pebble in some box. Then O(x)=O(x)+1O(x') = O(x) + 1 or O(x)=O(x)1O(x') = O(x) - 1. If xx is unsolvable and xx' is solvable, then we must have O(x)2n2N(x)O(x) \leq 2n - 2 - N(x) and O(x)2nN(x)=2n1N(x)O(x') \geq 2n - N(x') = 2n - 1 - N(x), and hence O(x)=O(x)+1O(x') = O(x) + 1. That is, the pebble must be added to a box with an even number of pebbles. This can be the case irrespective of where the pebble is added only if all boxes contain even numbers of pebbles, and 0=O(x)2n2N(x)0 = O(x) \leq 2n - 2 - N(x) and 1=O(x)2n1N(x)1 = O(x') \geq 2n - 1 - N(x); that is, N(x)=2n2N(x) = 2n - 2.

Solution 2

Solution:

Let xx be a configuration and x~\tilde{x} be another configuration obtained from xx by removing two pebbles from a box and depositing them in another box.

Claim 1: x~\tilde{x} is solvable if and only if xx is solvable.

Let us call two configurations equivalent if they have the same total number of pebbles and parities of the number of pebbles in the corresponding boxes are the same. (It does not matter whether we consider this equivalence for a fixed ordering of the boxes or up to permutation.) From Claim 1 it follows that two equivalent configurations are both solvable or both unsolvable. In particular, any configuration with 2n12n - 1 or more pebbles is solvable, because it is equivalent to a configuration with no empty boxes.

Let us call a configuration with all boxes containing two or fewer pebbles scant. Every unsolvable configuration is equivalent to a scant configuration.

Claim 2: A scant configuration is solvable if and only if it contains no empty boxes.

By Claim 1 and Claim 2, addition of a pebble to a scant unsolvable configuration makes it solvable if and only if the configuration has exactly one empty box and the pebble is added to the empty box or to a box containing two pebbles. Hence, the addition of a pebble makes an unsolvable scant configuration into a solvable configuration irrespective of where it is added if and only if all boxes have even numbers of pebbles and exactly one of them is empty. Therefore, the addition of a pebble makes an unsolvable configuration into a solvable one irrespective of where the pebble is added if and only if the configuration has 2n22n - 2 pebbles and all boxes have even numbers of pebbles.

Proof of Claim 1: Suppose that the two pebbles were moved from box BB in xx to box B~\tilde{B} in x~\tilde{x}, and xx is solvable. Then we perform exactly the same sequence of moves for x~\tilde{x} as we did for xx except that instead of the first move that is made out of BB we make a move from B~\tilde{B} (into the same box), and if there was no move from BB, then at the end we make a move from B~\tilde{B} to BB in case BB is now empty.

Proof of Claim 2: Any move from a scant configuration either leaves the number of empty boxes the same and the resulting configuration is also scant (if it is made into an empty box), or increases the number of empty boxes by one (if it is made into a nonempty box). In the second case, if the move was made into a box containing one pebble, then the resulting configuration is still scant. On the other hand, if it is made into a box containing two pebbles, then the resulting configuration is equivalent to the scant configuration which has one pebble in the box the move was made into and exactly the same number of pebbles in all other boxes as the original configuration. Therefore, any sequence of moves from a scant configuration results in a configuration with more or the same number of empty boxes.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.