Maths Olympiad Prep

Library / /29 of 36

Combinatorics Difficulty 7.4 National Olympiad, round 2 Prove it Italy

Problem:

Sia nn un intero positivo. Su una lavagna Bobo scrive nn interi maggiori o uguali a zero. Successivamente, ad ogni mossa Bobo
- per ogni i=1,,ni=1, \ldots, n calcola il numero aia_{i} di interi scritti in quel momento sulla lavagna e minori o uguali a ii,
- cancella tutti i numeri scritti,
- scrive sulla lavagna i numeri a1,a2,,ana_{1}, a_{2}, \ldots, a_{n}.
Ad esempio, se n=5n=5 e i numeri scritti inizialmente sono 0,7,2,6,20,7,2,6,2, dopo la prima mossa saranno 1,3,3,3,31,3,3,3,3, dopo la seconda mossa saranno 1,1,5,5,51,1,5,5,5, e così via.

a. Dimostrare che, per ogni nn e per ogni configurazione iniziale, da un certo punto in poi i numeri scritti sulla lavagna non cambiano più.

b. Determinare, in funzione di nn, il minimo intero positivo kk con la proprietà che, per qualsiasi configurazione iniziale, le mosse dalla kk-esima in poi non cambiano più i numeri scritti sulla lavagna.

Problem:

Let nn be a positive integer. On a blackboard, Bobo writes a list of nn non-negative integers. He then performs a sequence of moves, each of which is as follows:
- for each i=1,,ni=1, \ldots, n, he computes the number aia_{i} of integers currently on the board that are at most ii,
- he erases all integers on the board,
- he writes on the board the numbers a1,a2,,ana_{1}, a_{2}, \ldots, a_{n}.
For instance, if n=5n=5 and the numbers initially on the board are 0,7,2,6,20,7,2,6,2, after the first move the numbers on the board will be 1, 3, 3, 3, 3, after the second they will be 1, 1, 5, 5, 5, and so on.

a. Show that, whatever nn and whatever the initial configuration, the numbers on the board will eventually not change any more.

b. As a function of nn, determine the minimum integer kk such that, whatever the initial configuration, moves from the kk th onwards will not change the numbers written on the board.

Solution

Solution:

We call a configuration stable if the numbers written on the board are exactly the numbers from 1 to nn, each appearing once, and we observe that such a configuration no longer changes when Bobo applies the procedure described in the statement.

We show that 2n2n moves always suffice to reach the stable configuration, whatever the initial configuration, and that 2n2n moves can indeed be needed for suitable choices of the initial configuration (and hence k=2n+1k=2n+1).

2n2n moves suffice to reach the stable configuration. First of all, observe that the numbers computed during any move always satisfy the relations
0a1a2ann 0 \leq a_{1} \leq a_{2} \leq \ldots \leq a_{n} \leq n
Indeed aiai+1a_{i} \leq a_{i+1} for every admissible index ii (this is because if xix \leq i, then xi+1x \leq i+1), and there are nn numbers on the board, so anna_{n} \leq n. For simplicity, we assume that after each move Bobo writes the numbers a1,,ana_{1}, \ldots, a_{n} on the board in increasing order.

By what we have just remarked, from the second move onward, the last number written on the board is always nn (that is, one computes an=na_{n}=n). In carrying out the third move, since the numbers written on the board are integers at most nn and the last one is nn, one will compute an1n1a_{n-1} \leq n-1. But then, since the numbers written after the third move satisfy the relations
0a1a2an1n1<an 0 \leq a_{1} \leq a_{2} \leq \ldots \leq a_{n-1} \leq n-1 < a_{n}
in carrying out the fourth move one finds an1=n1a_{n-1}=n-1, and this holds from then on. In the computation of the fifth move we will have an2n2a_{n-2} \leq n-2 (since the list at this point contains nn and n1n-1), and in the sixth move an2=n2a_{n-2}=n-2.

More generally, after move 2h2h the last numbers written on the board will be the numbers from nh+1n-h+1 to nn, so in move 2h+12h+1 we will compute anhnha_{n-h} \leq n-h, and we will write exactly nhn-h numbers less than or equal to nhn-h. Hence in move 2h+22h+2 the last numbers written will be nh,nh+1,,nn-h, n-h+1, \ldots, n.

After move 2n2n, the numbers written will be 1,2,3,,n1,2,3, \ldots, n, and they will remain so from then on.

2n2n moves can be needed to reach the stable configuration. Suppose that the initial numbers are all strictly greater than nn. We will show that in this case 2n2n moves are necessary to reach the stable configuration. When n=1n=1 this is an easy check (after one move the board has the number 0, after two moves the number 1).

In general, after the first move, the numbers on the board will all be 0, and hence after the second move they will all be equal to nn. As in the first part of the proof, in all subsequent moves one will compute an=na_{n}=n, while the computation of aia_{i} for i<ni<n is not influenced by the presence of an=na_{n}=n (since nn is not i\leq i for any i<ni<n). In particular, the game proceeds acting only on the n1n-1 smallest among the nn numbers present, and in the situation after the second move these n1n-1 numbers are all equal to nn.

Let us then consider only the numbers a1,,an1a_{1}, \ldots, a_{n-1}, ignoring ana_{n} (which from now on will always remain equal to nn). The game continues as if it involved only n1n-1 numbers, which are initially all greater than n1n-1 (since they are equal to nn). We then repeat the same analysis just carried out: after one move all these numbers will be replaced by 0, and after two moves they will all be equal to n1n-1. From this point on, for the same reason as before, we will always have an1=n1a_{n-1}=n-1, and hence the game will continue as if it involved only a1,,an2a_{1}, \ldots, a_{n-2} (which will first all become zeros, and then all n2n-2). In particular, after 2 moves the number ana_{n} becomes equal to nn for the first time (and then never changes again), after 4 moves the number an1a_{n-1} becomes equal to n1n-1 for the first time (and then never changes again), and so on: after 2h2h moves, the number an+1ha_{n+1-h} becomes equal to n+1hn+1-h for the first time, and then never changes again. The number a1=an+1na_{1}=a_{n+1-n} then becomes equal to 1 for the first time after 2n2n moves: hence 2n2n moves are indeed necessary to reach the stable configuration.

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 translated into English from it; metadata (topic, difficulty) added by this project.