Maths Olympiad Prep

Library / /2 of 2

Combinatorics Difficulty 7.7 National olympiad, round 2 Prove it Romania

Let kk be a positive integer. Determine the least integer nk+1n \ge k + 1 for which the game below can be played indefinitely:

Consider nn boxes, labelled b1,b2,,bnb_1, b_2, \dots, b_n. For each index ii, box bib_i contains initially exactly ii coins. At each step, the following three substeps are performed in order:

(1) Choose k+1k+1 boxes;

(2) Of these k+1k+1 boxes, choose kk and remove at least half of the coins from each, and add to the remaining box, if labelled bib_i, a number of ii coins.

(3) If one of the boxes is left empty, the game ends; otherwise, go to the next step.

Solution

The required minimum is n=2k+k1n = 2^k + k - 1.

In this case the game can be played indefinitely by choosing the last k+1k+1 boxes, b2k1,b2k,,b2k+k1b_{2^k-1}, b_{2^k}, \dots, b_{2^k+k-1}, at each step: At step rr, if box b2k+i1b_{2^k+i-1} has exactly mim_i coins, then mi/2\lceil m_i/2 \rceil coins are removed from that box, unless ir1(modk+1)i \equiv r-1 \pmod{k+1}, in which case 2k+i12^k + i - 1 coins are added. Thus, after step rr has been performed, box b2k+i1b_{2^k+i-1} contains exactly mi/2\lceil m_i/2 \rceil coins, unless ir1(modk+1)i \equiv r-1 \pmod{k+1}, in which case it contains exactly mi+2k+i1m_i + 2^k + i - 1 coins. This game goes on indefinitely, since each time a box is supplied, at least 2k12^k - 1 coins are added, so it will then contain at least 2k2^k coins, good enough to survive the kk steps to its next supply.

We now show that no smaller value of nn works. So, let n2k+k2n \le 2^k + k - 2 and suppose, if possible, that a game can be played indefinitely. Notice that a box currently containing exactly mm coins survives at most w=log2mw = \lceil \log_2 m \rceil withdrawals; this ww 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 2k22^k - 2 boxes strictly decreases the total weight.*

Since the total weight cannot strictly decrease indefinitely, n>2k2n > 2^k - 2, and from some stage on none of the first 2k22^k - 2 boxes is ever supplied. Recall that each step involves a (k+1)(k+1)-box choice. Since n2k+k2n \le 2^k + k - 2, from that stage on, each step involves a withdrawal from at least one of the first 2k22^k - 2 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 n2k+k1n \ge 2^k + k - 1.

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 kk; and if the latter is amongst the first 2k22^k - 2 boxes, then its weight increases by at most k1k-1. Let the box to be supplied be bib_i and let it currently contain exactly mim_i coins, to proceed by case analysis:

If mi=1m_i = 1, the weight increases by log2(i+1)log2(2k+k1)log2(2k+12)k\lfloor \log_2(i+1) \rfloor \le \lfloor \log_2(2^k + k - 1) \rfloor \le \lfloor \log_2(2^{k+1} - 2) \rfloor \le k; and if, in addition, i2k2i \le 2^k - 2, then the weight increases by log2(i+1)log2(2k1)=k1\lfloor \log_2(i+1) \rfloor \le \lfloor \log_2(2^k - 1) \rfloor = k - 1.

If mi=2m_i = 2, then the weight increases by log2(i+2)log22log2(2k+k)1k1\lfloor \log_2(i+2) \rfloor - \lfloor \log_2 2 \rfloor \le \lfloor \log_2(2^k + k) \rfloor - 1 \le k - 1.

If mi3m_i \ge 3, then the weight increases by
log2(i+mi)log2milog2(i+mi)log2mi+1log2(1+2k+k23)+1k, \begin{aligned} \lfloor \log_2(i + m_i) \rfloor - \lfloor \log_2 m_i \rfloor &\le \lfloor \log_2(i + m_i) - \log_2 m_i \rfloor + 1 \\ &\le \lfloor \log_2 \left( 1 + \frac{2^k + k - 2}{3} \right) \rfloor + 1 \le k, \end{aligned}
since 1+13(2k+k2)=13(2k+k+1)<13(2k+2k+1)=2k1 + \frac{1}{3}(2^k + k - 2) = \frac{1}{3}(2^k + k + 1) < \frac{1}{3}(2^k + 2^{k+1}) = 2^k.

Finally, let i2k2i \le 2^k - 2 to consider the subcases mi=3m_i = 3 and mi4m_i \ge 4. In the former subcase, the weight increases by
log2(i+3)log23log2(2k+1)1=k1, \lfloor \log_2(i + 3) \rfloor - \lfloor \log_2 3 \rfloor \le \lfloor \log_2(2^k + 1) \rfloor - 1 = k - 1,
and in the latter by
log2(i+mi)log2milog2(i+mi)log2mi+1log2(1+2k24)+1k1, \begin{aligned} \lfloor \log_2(i + m_i) \rfloor - \lfloor \log_2 m_i \rfloor &\le \lfloor \log_2(i + m_i) - \log_2 m_i \rfloor + 1 \\ &\le \lfloor \log_2 \left( 1 + \frac{2^k - 2}{4} \right) \rfloor + 1 \le k - 1, \end{aligned}
since 1+14(2k2)=14(2k+2)<2k2+11 + \frac{1}{4}(2^k - 2) = \frac{1}{4}(2^k + 2) < 2^{k-2} + 1. This ends the proof and completes the solution.

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 and solution reproduced as published; topic and difficulty added by this site.