Maths Olympiad Prep

Library / USAMO /111 of 156

USAMO, 2010

Combinatorics Difficulty 7.6 National Olympiad, round 2 Prove it United States

There are nn students standing in a circle, one behind the other. The students have heights h1<h2<⋯<hnh_1 < h_2 < \dots < h_n. If a student with height hkh_k is standing directly behind a student with height hk−2h_{k-2} or less, the two students are permitted to switch places. Prove that it is not possible to make more than (n3)\binom{n}{3} such switches before reaching a position in which no further switches are possible.

(This problem was suggested by Kiran Kedlaya, Travis Schedler, and David Speyer.)

Solutions — 2

Solution 1

(By Kiran Kedlaya). Let hih_i also denote the student with height hih_i. We prove that for 1≤i<j≤n1 \le i < j \le n, hjh_j can switch with hih_i at most j−i−1j - i - 1 times. We proceed by induction on j−ij - i, the base case j−i=1j - i = 1 being evident because hih_i is not allowed to switch with hi−1h_{i-1}.

For the inductive step, note that hi,hj−1,hjh_i, h_{j-1}, h_j can be positioned on the circle either in this order or in the order hi,hj,hj−1h_i, h_j, h_{j-1}. Since hj−1h_{j-1} and hjh_j cannot switch, the only way to change the relative order of these three students is for hih_i to switch with either hj−1h_{j-1} or hjh_j. Consequently, any two switches of hih_i with hjh_j must be separated by a switch of hih_i with hj−1h_{j-1}. Since there are at most j−i−2j - i - 2 of the latter, there are at most j−i−1j - i - 1 of the former.

The total number of switches is thus at most
∑i=1n−1∑j=i+1n(j−i−1)=∑i=1n−1∑j=0n−i−1j=∑i=1n−1(n−i2)=∑i=1n−1[(n−i+13)−(n−i3)]=(n3). \begin{aligned} \sum_{i=1}^{n-1} \sum_{j=i+1}^{n} (j-i-1) &= \sum_{i=1}^{n-1} \sum_{j=0}^{n-i-1} j \\ &= \sum_{i=1}^{n-1} \binom{n-i}{2} \\ &= \sum_{i=1}^{n-1} \left[ \binom{n-i+1}{3} - \binom{n-i}{3} \right] \\ &= \binom{n}{3}. \end{aligned}

Solution 2

(By Warut Suksompong). For i=1,2,…,n−1i = 1, 2, \dots, n-1, let sis_i be the number of students hjh_j with j<ij < i such that hi+1,hjh_{i+1}, h_j, and hih_i appear in that order on the circle. Note that si≤i−1s_i \le i-1 for all ii. Now we take a look what happens when two students switch places.

* If hnh_n is involved in the switch, sn−1s_{n-1} decreases by 1, while all the other sis_i's remain the same.
* Otherwise, suppose hah_a and hbh_b are switched. Then, we have a+1<b<na+1 < b < n, so sb−1s_{b-1} decreases by 1, while sbs_b increases by 1. All other sis_i's remain the same.

Therefore, we see that the quantity M=∑i=1n−1(n−i)siM = \sum_{i=1}^{n-1} (n-i)s_i decreases by exactly 1 after every switch. The number of switches until no more are possible is therefore at most the initial value of MM. Because si≤i−1s_i \le i-1 for 1≤i≤n−11 \le i \le n-1, this value is at most ∑i=1n−1(n−i)(i−1)=(n3)\sum_{i=1}^{n-1} (n-i)(i-1) = \binom{n}{3}.

Note. With this solution, it is also easy to see that the number of switches until no more are possible depends only on the original ordering.

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

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