Maths Olympiad Prep

Library / NMO Selection Tests /4 of 23

NMO Selection Tests

Algebra Difficulty 8.0 Shortlist Prove it Romania

Let n∈Nn \in \mathbb{N}, n≥2n \ge 2, and let a1,a2,…,ana_1, a_2, \dots, a_n be real numbers. Denote
S=∑1≤i<j≤n∣aj−ai∣andd=max⁡{∣aj−ai∣∣1≤i,j≤n}. S = \sum_{1 \le i < j \le n} |a_j - a_i| \quad \text{and} \quad d = \max\{|a_j - a_i| \mid 1 \le i, j \le n\}.

Prove that
(n−1)d≤S≤n2d4 (n-1)d \le S \le \frac{n^2 d}{4}

Solution

Without loss of generality, we can assume that a1≤a2≤⋯≤ana_1 \le a_2 \le \dots \le a_n, and denote dk=ak+1−akd_k = a_{k+1} - a_k, for k=1,2,…,n−1k = 1, 2, \dots, n-1. Then we have:
* d1+d2+⋯+dn−1=dd_1 + d_2 + \dots + d_{n-1} = d;
* ∣aj−ai∣=di+di+1+⋯+dj−1|a_j - a_i| = d_i + d_{i+1} + \dots + d_{j-1}, for any i<ji < j with i,j∈{1,…,n}i, j \in \{1, \dots, n\}.
Denote by nkn_k the number of pairs (i,j)(i, j), with 1≤i<j≤n1 \le i < j \le n, such that the interval [ak,ak+1][a_k, a_{k+1}] is contained in [ai,aj][a_i, a_j]. Then the conditions imply i≤k<k+1≤ji \le k < k+1 \le j, so there are kk possible choices for ii and n−kn-k possible choices for jj. Thus, nk=k(n−k)n_k = k(n-k). Consequently,
S=∑k=1n−1nkdk=∑k=1n−1k(n−k)dk.(1) S = \sum_{k=1}^{n-1} n_k d_k = \sum_{k=1}^{n-1} k(n-k) d_k. \qquad (1)

For any k∈{1,2,…,n−1}k \in \{1, 2, \dots, n-1\}, we have k(n−k)≥n−1k(n-k) \ge n-1.
Indeed, k(n−k)≥n−1  ⟺  kn−k2≥n−1  ⟺  (k−1)(n−k−1)≥0k(n-k) \ge n-1 \iff kn-k^2 \ge n-1 \iff (k-1)(n-k-1) \ge 0, which holds for all kk in the stated range.
From (1) and this, it follows that
S≥∑k=1n−1(n−1)dk=(n−1)d, S \ge \sum_{k=1}^{n-1} (n-1)d_k = (n-1)d,
which proves the left inequality.
Equality holds for any n≥2n \ge 2 if and only if a1≤a2=a3=⋯=an−1≤ana_1 \le a_2 = a_3 = \dots = a_{n-1} \le a_n.

Using AM-GM inequality, we obtain k(n−k)≤n24k(n-k) \le \frac{n^2}{4}, for all k∈{1,2,…,n−1}k \in \{1, 2, \dots, n-1\}. Therefore,
S=∑k=1n−1k(n−k)dk≤∑k=1n−1n24dk=n24d,(3) S = \sum_{k=1}^{n-1} k(n-k)d_k \le \sum_{k=1}^{n-1} \frac{n^2}{4}d_k = \frac{n^2}{4}d, \qquad (3)
which proves the right inequality.
Since equality in the inequality k(n−k)≤n24k(n-k) \le \frac{n^2}{4} holds when k=n−kk = n-k, i.e., when n=2kn = 2k (so nn is even), from (3) we deduce:

* If dk=0d_k = 0 for all k=1,…,n−1k = 1, \dots, n-1, i.e., a1=a2=⋯=ana_1 = a_2 = \dots = a_n, then equality holds for any n≥2n \ge 2.
* If there exists t∈{1,…,n−1}t \in \{1, \dots, n-1\} such that dt≠0d_t \ne 0, then:
* If nn is odd, the right inequality is strict.
* If nn is even, equality holds only if t=n−tt = n-t and dt=dd_t = d, i.e., n=2tn = 2t and a1=⋯=at≤at+1=at+2=⋯=a2ta_1 = \dots = a_t \le a_{t+1} = a_{t+2} = \dots = a_{2t}.

d=an−a1=(an−ak)+(ak−a1),for any 2≤k≤n−1. d = a_n - a_1 = (a_n - a_k) + (a_k - a_1), \quad \text{for any } 2 \le k \le n-1.
We obtain:
S=∑1≤i<j≤n∣aj−ai∣=(an−a1)+∑k=2n−1((an−ak)+(ak−a1))++∑2≤i<j≤n−1∣aj−ai∣=(n−1)d+∑2≤i<j≤n−1∣aj−ai∣≥(n−1)d. \begin{aligned} S &= \sum_{1 \le i < j \le n} |a_j - a_i| = (a_n - a_1) + \sum_{k=2}^{n-1} ((a_n - a_k) + (a_k - a_1)) + \\ &\quad + \sum_{2 \le i < j \le n-1} |a_j - a_i| \\ &= (n-1)d + \sum_{2 \le i < j \le n-1} |a_j - a_i| \ge (n-1)d. \end{aligned}
If n=2n=2 or n=3n=3, equality holds for any numbers a1≤a2a_1 \le a_2, respectively a1≤a2≤a3a_1 \le a_2 \le a_3.
If n≥4n \ge 4, equality holds if and only if a1≤a2=a3=⋯=an−1≤ana_1 \le a_2 = a_3 = \dots = a_{n-1} \le a_n.

Alternative solution for the right inequality.
We prove by induction the statement:
P(n):∑1≤i<j≤n∣aj−ai∣≤n24⋅max⁡1≤i<j≤n∣aj−ai∣, P(n): \quad \sum_{1 \le i < j \le n} |a_j - a_i| \le \frac{n^2}{4} \cdot \max_{1 \le i < j \le n} |a_j - a_i|,
for all n≥2n \ge 2 and any real numbers a1,a2,…,ana_1, a_2, \dots, a_n. Without loss of generality, assume a1≤a2≤⋯≤ana_1 \le a_2 \le \dots \le a_n.
Base cases:
P(2):a2−a1≤224⋅(a2−a1)  ⟺  a2−a1≤a2−a1, P(2): \quad a_2 - a_1 \le \frac{2^2}{4} \cdot (a_2 - a_1) \iff a_2 - a_1 \le a_2 - a_1,
P(3):(a2−a1)+(a3−a2)+(a3−a1)≤324⋅(a3−a1)  ⟺  2(a3−a1)≤94(a3−a1). P(3): \quad (a_2 - a_1) + (a_3 - a_2) + (a_3 - a_1) \le \frac{3^2}{4} \cdot (a_3 - a_1) \iff 2(a_3 - a_1) \le \frac{9}{4}(a_3 - a_1).

Assume P(n−2)P(n-2) holds for some n≥4n \ge 4. Using the notation from the statement and the fact that
d=an−a1=(an−ak)+(ak−a1),for any 2≤k≤n−1, d = a_n - a_1 = (a_n - a_k) + (a_k - a_1), \quad \text{for any } 2 \le k \le n-1,
we deduce:
S=∑1≤i<j≤n∣aj−ai∣=(n−1)d+∑2≤i<j≤n−1∣aj−ai∣. S = \sum_{1 \le i < j \le n} |a_j - a_i| = (n-1)d + \sum_{2 \le i < j \le n-1} |a_j - a_i|.
Denote
S′=∑2≤i<j≤n−1∣aj−ai∣,d′=an−1−a2. S' = \sum_{2 \le i < j \le n-1} |a_j - a_i|, \quad d' = a_{n-1} - a_2.
Obviously, d′≤dd' \le d. Since P(n−2)P(n-2) holds, we get S′≤(n−2)24⋅d′S' \le \frac{(n-2)^2}{4} \cdot d'. Therefore,
S=(n−1)d+S′≤(n−1)d+(n−2)24⋅d′≤(n−1)d+(n−2)24⋅d=n24⋅d, S = (n-1)d + S' \le (n-1)d + \frac{(n-2)^2}{4} \cdot d' \le (n-1)d + \frac{(n-2)^2}{4} \cdot d = \frac{n^2}{4} \cdot d,
which proves P(n)P(n).
To determine when equality holds, observe that in P(2)P(2) equality holds for any a1≤a2a_1 \le a_2, and in P(3)P(3) equality holds only if a1=a2=a3a_1 = a_2 = a_3 (strict inequality otherwise if a1<a3a_1 < a_3).
It is clear that if a1=a2=⋯=ana_1 = a_2 = \dots = a_n, then equality holds in P(n)P(n) for any n≥2n \ge 2.
Assume now that a1<ana_1 < a_n. From the previous inequality, equality in P(n)P(n) holds if and only if equality holds in P(n−2)P(n-2) and d′=dd' = d. Consequently:
* if nn is odd, the inequality P(n)P(n) is strict;
* if nn is even, say n=2tn = 2t, equality holds if and only if a1=a2=⋯=at<at+1=at+2=⋯=a2ta_1 = a_2 = \dots = a_t < a_{t+1} = a_{t+2} = \dots = a_{2t}.

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.