Maths Olympiad Prep

Library / /120 of 397

Combinatorics Difficulty 5.4 AIME, harder Prove it Taiwan

There are several positive integers arranged in a row. A person each time selects two adjacent numbers xx and yy, where x>yx > y, and xx is to the left of yy; then he replaces this pair (x,y)(x, y) with (y+1,x)(y + 1, x) or (x1,x)(x - 1, x). Then he repeats such choosing and replacing operations. Prove that he can only perform finitely many such operations.

Solution

Solution 1 Note that the operation in the problem does not change the maximum value MM of the original sequence. Let the sequence obtained after some operation be a1,a2,,ana_1, a_2, \dots, a_n. Consider the following sum
S=a1+2a2++nan. S = a_1 + 2a_2 + \dots + n a_n.
We claim: after each operation, SS always increases by some positive integer amount. Suppose some operation replaces the pair (ai,ai+1)(a_i, a_{i+1}) with (c,ai)(c, a_i), where ai>ai+1a_i > a_{i+1}, and cc is either ai+1+1a_{i+1} + 1 or ai1a_i - 1. Then the difference between the new value and the old value of SS is
d=(ic+(i+1)ai)(iai+(i+1)ai+1)=aiai+1+i(cai+1). d = (i c + (i + 1)a_i) - (i a_i + (i + 1)a_{i+1}) = a_i - a_{i+1} + i(c - a_{i+1}).
Since aiai+11a_i - a_{i+1} \ge 1, and cai+10c - a_{i+1} \ge 0, dd must be a positive integer.

On the other hand, since each aiMa_i \le M, we get S(1+2+3++n)MS \le (1+2+3+\cdots+n)M. Since SS increases by at least 1 after each operation, and never exceeds the fixed value (1+2++n)M(1+2+\cdots+n)M, the operation must terminate after finitely many steps.

Solution 2 As in Solution 1, note that the maximum value MM of the sequence never changes. Now consider the reverse lexicographic order on sequences of nn positive integers: we write (x1,x2,,xn)<(y1,y2,,yn)(x_1, x_2, \dots, x_n) < (y_1, y_2, \dots, y_n) when xn<ynx_n < y_n, or when xk=ykx_k = y_k holds for all k=j+1,j+2,,nk = j + 1, j + 2, \dots, n but xj<yjx_j < y_j. Under this order, every operation makes the sequence larger, and throughout the process the same sequence never appears twice.

On the other hand, since each term is a positive integer with a fixed maximum value, there are only finitely many possible sequences. Therefore this operation cannot proceed indefinitely.

Solution 3 Suppose the current sequence is a1,a2,,ana_1, a_2, \dots, a_n. Let sis_i denote the number of terms in this sequence that are less than aia_i. Call the sequence s1,s2,,sns_1, s_2, \dots, s_n the score sequence of the sequence a1,a2,,ana_1, a_2, \dots, a_n.
For two sequences x1,x2,,xnx_1, x_2, \dots, x_n and y1,y2,,yny_1, y_2, \dots, y_n, if at the index ii with the largest value such that xiyix_i \neq y_i we have xi<yix_i < y_i, we say the sequence x1,x2,,xnx_1, x_2, \dots, x_n beats the sequence y1,y2,,yny_1, y_2, \dots, y_n. We claim: after each operation, the new score sequence will beat the original score sequence. Once this property is proven, since the score sequence never repeats, and there are only finitely many possible score sequences, the operation must terminate after finitely many steps.
Consider the operation that changes (x,y)(x, y) into (a,x)(a, x), where a=y+1a = y + 1 or a=x1a = x - 1. Suppose xx originally appeared at the ii-th position. For every j<ij < i, sjs_j does not increase after the operation, because yay \le a and xxx \le x. If for some j<ij < i, sjs_j decreases, then the new score sequence beats the original score sequence. If for every j<ij < i, sjs_j remains unchanged, look at sis_i: since x>yx > y and yaxy \le a \le x, we get that sis_i decreases by at least 1. This completes the proof.

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 zh; metadata (topic, difficulty) added by this project.