Maths Olympiad Prep

Library / /19 of 23

, 2003

Combinatorics Difficulty 8.9 Shortlist Prove it United States

Let n0n \neq 0. For every sequence of integers
a=a0,a1,a2,,an a = a_0, a_1, a_2, \dots, a_n
satisfying 0aii0 \le a_i \le i, for i=0,,ni = 0, \dots, n, define another sequence
t(a)=t(a)0,t(a)1,t(a)2,,t(a)n t(a) = t(a)_0, t(a)_1, t(a)_2, \dots, t(a)_n
by setting t(a)it(a)_i to be the number of terms in the sequence aa that precede the term aia_i and are different from aia_i. Show that, starting from any sequence aa as above, fewer than nn applications of the transformation tt lead to a sequence bb such that t(b)=bt(b) = b.

Solutions — 2

Solution 1

First Solution. Note first that the transformed sequence t(a)t(a) also satisfies the inequalities 0t(a)ii0 \le t(a)_i \le i, for i=0,,ni = 0, \dots, n. Call any integer sequence that satisfies these inequalities an *index bounded sequence*.
We prove now that ait(a)ia_i \le t(a)_i, for i=0,,ni = 0, \dots, n. Indeed, this is clear if ai=0a_i = 0. Otherwise, let x=ai>0x = a_i > 0 and y=t(a)iy = t(a)_i. None of the first xx consecutive terms a0,a1,,ax1a_0, a_1, \dots, a_{x-1} is greater than x1x-1, so they are all different from xx and precede xx (see the diagram below). Thus yxy \ge x, that is, ait(a)ia_i \le t(a)_i, for i=0,,ni = 0, \dots, n.

01x1iaa0a1ax1xt(a)t(a)0t(a)1t(a)x1y \begin{array}{c|cccccc} & 0 & 1 & \dots & x-1 & \dots & i \\\hline a & a_0 & a_1 & \dots & a_{x-1} & \dots & x \\ t(a) & t(a)_0 & t(a)_1 & \dots & t(a)_{x-1} & \dots & y \end{array}

This already shows that the sequences stabilize after finitely many applications of the transformation tt, because the value of the index ii term in index bounded sequences cannot exceed ii. Next we prove that if ai=t(a)ia_i = t(a)_i, for some i=0,,ni = 0, \dots, n, then no further applications of tt will ever change the index ii term. We consider two cases.

* In this case, we assume that ai=t(a)i=0a_i = t(a)_i = 0. This means that no term on the left of aia_i is different from 0, that is, they are all 0. Therefore the first ii terms in t(a)t(a) will also be 0 and this repeats (see the diagram below).

01ia000t(a)000 \begin{array}{c|cccc} & 0 & 1 & \dots & i \\\hline a & 0 & 0 & \dots & 0 \\ t(a) & 0 & 0 & \dots & 0 \end{array}

* In this case, we assume that ai=t(a)i=x>0a_i = t(a)_i = x > 0. The first xx terms are all different from xx. Because t(a)i=xt(a)_i = x, the terms ax,ax+1,,ai1a_x, a_{x+1}, \dots, a_{i-1} must then all be equal to xx. Consequently, t(a)j=xt(a)_j = x for j=x,,i1j = x, \dots, i-1 and further applications of tt cannot change the index ii term (see the diagram below).

| | 0 | 1 | ... | x1x - 1 | xx | x+1x + 1 | ... | ii |
|---|---|---|-----|---------|-----|---------|-----|-----|
| aa | a0a_0 | a1a_1 | ... | ax1a_{x-1} | xx | xx | ... | xx |
| t(a)t(a) | t(a)0t(a)_0 | t(a)1t(a)_1 | ... | t(a)x1t(a)_{x-1} | xx | xx | ... | xx |

For 0in0 \le i \le n, the index ii entry satisfies the following properties: (i) it takes integer values; (ii) it is bounded above by ii; (iii) its value does not decrease under transformation tt; and (iv) once it stabilizes under transformation tt, it never changes again. This shows that no more than nn applications of tt lead to a sequence that is stable under the transformation tt.

Finally, we need to show that no more than n1n-1 applications of tt is needed to obtain a fixed sequence from an initial n+1n+1-term index bounded sequence a=(a0,a1,,an)a = (a_0, a_1, \dots, a_n). We induct on nn.

For n=1n=1, the two possible index bounded sequences (a0,a1)=(0,0)(a_0, a_1) = (0, 0) and (a0,a1)=(0,1)(a_0, a_1) = (0, 1) are already fixed by tt so we need zero applications of tt.

Assume that any index bounded sequence (a0,a1,,an)(a_0, a_1, \dots, a_n) reach a fixed sequence after no more than n1n-1 applications of tt. Consider an index bounded sequence a=(a0,a1,,an+1)a = (a_0, a_1, \dots, a_{n+1}). It suffices to show that aa will be stabilized in no more than nn applications of tt. We approach indirectly by assuming on the contrary that n+1n+1 applications of transformations are needed. This can happen only if an+1=0a_{n+1} = 0 and each application of tt increased the index n+1n+1 term by exactly 1. Under transformation tt, the resulting value of index ii term will not be effected by index jj term for i<ji < j. Hence by the induction hypothesis, the subsequence a=(a0,a1,,an)a' = (a_0, a_1, \dots, a_n) will be stabilized in no more than n1n-1 applications of tt. Because index nn term is stabilized at value xnx \le n after no more than min{x,n1}\min\{x, n-1\} applications of tt and index n+1n+1 term obtains value xx after exactly xx applications of tt under our current assumptions. We conclude that the index n+1n+1 term would become equal to the index nn term after no more than n1n-1 applications of tt. However, once two consecutive terms in a sequence are equal they stay equal and stabilize together. Because the index nn term needs no more than n1n-1 transformations to be stabilized, aa can be stabilized in no more than n1n-1 applications of tt, which contradicts our assumption of n+1n+1 applications needed. Thus our assumption was wrong and we need at most nn applications of transformation tt to stabilize an (n+1)(n + 1)-term index bounded sequence. This completes our inductive proof.

Solution 2

Second Solution. We prove that for n2n \ge 2, the claim holds without the initial condition 0aii0 \le a_i \le i. (Of course this does not prove anything stronger, but it's convenient.) We do this by induction on nn, the case n=2n=2 being easy to check by hand as in the first solution.

Note that if c=(c0,,cn)c = (c_0, \dots, c_n) is a sequence in the image of tt, and dd is the sequence (c1,,cn)(c_1, \dots, c_n), then the following two statements are true:

(a) If ee is the sequence obtained from dd by subtracting 1 from each nonzero term, then t(d)=t(e)t(d) = t(e). (If there are no zero terms in dd, then subtracting 1 clearly has no effect. If there is a zero term in dd, it must occur at the beginning, and then every nonzero term is at least 2.)

(b) One can compute t(c)t(c) by applying tt to the sequence c1,,cnc_1, \dots, c_n, adding 1 to each nonzero term, and putting a zero in front.

The recipe of (b) works for computing ti(c)t^i(c) for any ii, by (a) and induction on ii.

We now apply the induction hypothesis to t(a)1,,t(a)nt(a)_1, \dots, t(a)_n to see that it stabilizes after n2n-2 more applications of tt; by the recipe above, that means aa stabilizes after n1n-1 applications of tt.

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.