Rearrangement inequality

From HandWiki

In mathematics, the rearrangement inequality[1] states that for every choice of real numbers [math]\displaystyle{ x_1 \le \cdots \le x_n \quad \text{ and } \quad y_1 \le \cdots \le y_n }[/math] and every permutation [math]\displaystyle{ \sigma }[/math] of the numbers [math]\displaystyle{ 1, 2, \ldots n }[/math] we have

[math]\displaystyle{ x_1 y_n + \cdots + x_n y_1 \le x_1 y_{\sigma(1)} + \cdots + x_n y_{\sigma(n)} \le x_1 y_1 + \cdots + x_n y_n }[/math].

 

 

 

 

(1)

Informally, this means that in these types of sums, the largest sum is achieved by pairing large [math]\displaystyle{ x }[/math] values with large [math]\displaystyle{ y }[/math] values, and the smallest sum is achieved by pairing small values with large values. This can be formalised in the case that the [math]\displaystyle{ x_1, \ldots, x_n }[/math] are distinct, meaning that [math]\displaystyle{ x_1 \lt \cdots \lt x_n, }[/math] then:

  1. The upper bound in (1) is attained only for permutations [math]\displaystyle{ \sigma }[/math] that keep the order of [math]\displaystyle{ y_1, \ldots, y_n, }[/math] that is, [math]\displaystyle{ y_{\sigma(1)} \le \cdots \le y_{\sigma(n)}, }[/math] or equivalently [math]\displaystyle{ (y_1,\ldots,y_n) = (y_{\sigma(1)},\ldots,y_{\sigma(n)}). }[/math] Such a [math]\displaystyle{ \sigma }[/math] can permute the indices of [math]\displaystyle{ y }[/math]-values that are equal; in the case [math]\displaystyle{ y_1 = \cdots = y_n }[/math] every permutation keeps the order of [math]\displaystyle{ y_1, \ldots, y_n. }[/math] If [math]\displaystyle{ y_1 \lt \cdots \lt y_n, }[/math] then the only such [math]\displaystyle{ \sigma }[/math] is the identiy.
  2. Correspondingly, the lower bound in (1) is attained only for permutations [math]\displaystyle{ \sigma }[/math] that reverse the order of [math]\displaystyle{ y_1, \ldots, y_n, }[/math] meaning that [math]\displaystyle{ y_{\sigma(1)} \ge \cdots \ge y_{\sigma(n)}. }[/math] If [math]\displaystyle{ y_1 \lt \cdots \lt y_n, }[/math] then [math]\displaystyle{ \sigma(i) = n - i + 1 }[/math] for all [math]\displaystyle{ i = 1, \ldots, n, }[/math] is the only permutation to do this.

Note that the rearrangement inequality (1) makes no assumptions on the signs of the real numbers, unlike inequalities such as the arithmetic-geometric mean inequality.

Applications

Many important inequalities can be proved by the rearrangement inequality, such as the arithmetic mean – geometric mean inequality, the Cauchy–Schwarz inequality, and Chebyshev's sum inequality.

As a simple example, consider real numbers [math]\displaystyle{ x_1 \le \cdots \le x_n }[/math]: By applying (1) with [math]\displaystyle{ y_i := x_i }[/math] for all [math]\displaystyle{ i = 1,\ldots,n, }[/math] it follows that [math]\displaystyle{ x_1 x_n + \cdots + x_n x_1 \le x_1 x_{\sigma(1)} + \cdots + x_n x_{\sigma(n)} \le x_1^2 + \cdots + x_n^2 }[/math] for every permutation [math]\displaystyle{ \sigma }[/math] of [math]\displaystyle{ 1, \ldots, n. }[/math]

Intuition

The rearrangement inequality can be regarded as intuitive in the following way. Imagine there is a heap of $10 bills, a heap of $20 bills and one more heap of $100 bills. You are allowed to take 7 bills from a heap of your choice and then the heap disappears. In the second round you are allowed to take 5 bills from another heap and the heap disappears. In the last round you may take 3 bills from the last heap. In what order do you want to choose the heaps to maximize your profit? Obviously, the best you can do is to gain [math]\displaystyle{ 7\cdot100 + 5\cdot20 + 3\cdot10 }[/math] dollars. This is exactly what the upper bound of the rearrangement inequality (1) says for the sequences [math]\displaystyle{ 3 \lt 5 \lt 7 }[/math] and [math]\displaystyle{ 10 \lt 20 \lt 100. }[/math] In this sense, it can be considered as an example of a greedy algorithm.

Geometric interpretation

Assume that [math]\displaystyle{ 0 \lt x_1 \lt \cdots \lt x_n }[/math] and [math]\displaystyle{ 0\lt y_1 \lt \cdots \lt y_n. }[/math] Consider a rectangle of width [math]\displaystyle{ x_1 + \cdots + x_n }[/math] and height [math]\displaystyle{ y_1 + \cdots + y_n, }[/math] subdivided into [math]\displaystyle{ n }[/math] columns of widths [math]\displaystyle{ x_1,\ldots,x_n }[/math] and the same number of rows of heights [math]\displaystyle{ y_1,\ldots,y_n, }[/math] so there are [math]\displaystyle{ \textstyle n^2 }[/math] small rectangles. You are supposed to take [math]\displaystyle{ n }[/math] of these, one from each column and one from each row. The rearrangement inequality (1) says that you optimize the total area of your selection by taking the rectangles on the diagonal or the antidiagonal.

Proofs

Proof by contradiction

The lower bound and the corresponding discussion of equality follow by applying the results for the upper bound to [math]\displaystyle{ - y_n \le \cdots \le - y_1. }[/math] Therefore, it suffices to prove the upper bound in (1) and discuss when equality holds. Since there are only finitely many permutations of [math]\displaystyle{ 1,\ldots,n, }[/math] there exists at least one [math]\displaystyle{ \sigma }[/math] for which the middle term in (1) [math]\displaystyle{ x_1 y_{\sigma(1)} + \cdots + x_n y_{\sigma(n)} }[/math] is maximal. In case there are several permutations with this property, let σ denote one with the highest number of integers [math]\displaystyle{ i }[/math] from [math]\displaystyle{ \{1,\ldots,n\} }[/math] satisfying [math]\displaystyle{ y_i = y_{\sigma(i)}. }[/math]

We will now prove by contradiction, that [math]\displaystyle{ \sigma }[/math] has to keep the order of [math]\displaystyle{ y_1,\ldots,y_n }[/math] (then we are done with the upper bound in (1), because the identity has that property). Assume that there exists a [math]\displaystyle{ j\in\{1,\ldots,n-1\} }[/math] such that [math]\displaystyle{ y_i = y_{\sigma(i)} }[/math] for all [math]\displaystyle{ i\in\{1,\ldots,j-1\} }[/math] and [math]\displaystyle{ y_j \neq y_{\sigma(j)}. }[/math] Hence [math]\displaystyle{ y_j \lt y_{\sigma(j)} }[/math] and there has to exist a [math]\displaystyle{ k\in\{j+1,\ldots,n\} }[/math] with [math]\displaystyle{ y_j = y_{\sigma(k)} }[/math] to fill the gap. Therefore,

[math]\displaystyle{ x_j \le x_k \qquad\text{and}\qquad y_{\sigma(k)} \lt y_{\sigma(j)}, }[/math]

 

 

 

 

(2)

which implies that

[math]\displaystyle{ 0 \le (x_k - x_j)(y_{\sigma(j)} - y_{\sigma(k)}). }[/math]

 

 

 

 

(3)

Expanding this product and rearranging gives

[math]\displaystyle{ x_j y_{\sigma(j)} + x_k y_{\sigma(k)} \le x_j y_{\sigma(k)} + x_k y_{\sigma(j)}\,, }[/math]

 

 

 

 

(4)

which is equivalent to (3). Hence the permutation [math]\displaystyle{ \tau(i):=\begin{cases}\sigma(i)&\text{for }i \in \{1,\ldots,n\}\setminus\{j,k\},\\ \sigma(k)&\text{for }i = j,\\ \sigma(j)&\text{for }i = k,\end{cases} }[/math] which arises from [math]\displaystyle{ \sigma }[/math] by exchanging the values [math]\displaystyle{ \sigma(j) }[/math] and [math]\displaystyle{ \sigma(k), }[/math] has at least one additional point which keeps the order compared to [math]\displaystyle{ \sigma, }[/math] namely at [math]\displaystyle{ j }[/math] satisfying [math]\displaystyle{ y_j=y_{\tau(j)}, }[/math] and also attains the maximum in (1) due to (4). This contradicts the choice of [math]\displaystyle{ \sigma. }[/math]

If [math]\displaystyle{ x_1 \lt \cdots \lt x_n, }[/math] then we have strict inequalities in (2), (3), and (4), hence the maximum can only be attained by permutations keeping the order of [math]\displaystyle{ y_1 \le \cdots \le y_n, }[/math] and every other permutation [math]\displaystyle{ \sigma }[/math] cannot be optimal.

Proof by induction

As above, if suffices to treat the upper bound in (1). For a proof by mathematical induction, we start with [math]\displaystyle{ n=2. }[/math] Observe that [math]\displaystyle{ x_1 \le x_2 \quad \text{ and } \quad y_1 \le y_2 }[/math] implies that

[math]\displaystyle{ 0 \le (x_2 - x_1) (y_2 - y_1), }[/math]

 

 

 

 

(5)

which is equivalent to

[math]\displaystyle{ x_1 y_2 + x_2 y_1 \le x_1 y_1 + x_2 y_2, }[/math]

 

 

 

 

(6)

hence the upper bound in (1) is true for [math]\displaystyle{ n = 2. }[/math] If [math]\displaystyle{ x_1 \lt x_2, }[/math] then we get strict inequality in (5) and (6) if and only if [math]\displaystyle{ y_1 \lt y_2. }[/math] Hence only the identity, which is the only permutation here keeping the order of [math]\displaystyle{ y_1 \lt y_2, }[/math] gives the maximum.

As an induction hypothesis assume that the upper bound in the rearrangement inequality (1) is true for [math]\displaystyle{ n-1 }[/math] with [math]\displaystyle{ n\ge3 }[/math] and that in the case [math]\displaystyle{ x_1 \lt \cdots \lt x_{n-1} }[/math] there is equality only when the permutation [math]\displaystyle{ \sigma }[/math] of [math]\displaystyle{ 1,\ldots,n-1 }[/math] keeps the order of [math]\displaystyle{ y_1,\ldots,y_{n-1}. }[/math]

Consider now [math]\displaystyle{ x_1 \le \cdots \le x_n }[/math] and [math]\displaystyle{ y_1 \le \cdots \le y_n. }[/math] Take a [math]\displaystyle{ \sigma }[/math] from the finite number of permutations of [math]\displaystyle{ 1,\ldots,n }[/math] such that the rearrangement in the middle of (1) gives the maximal result. There are two cases:

  • If [math]\displaystyle{ \sigma(n)=n, }[/math] then [math]\displaystyle{ y_n=y_{\sigma(n)} }[/math] and, using the induction hypothesis, the upper bound in (1) is true with equality and [math]\displaystyle{ \sigma }[/math] keeps the order of [math]\displaystyle{ y_1,\ldots,y_{n-1},y_n }[/math] in the case [math]\displaystyle{ x_1 \lt \cdots \lt x_n. }[/math]
  • If [math]\displaystyle{ k := \sigma(n) \lt n, }[/math] then there is a [math]\displaystyle{ j\in\{1,\dots,n-1\} }[/math] with [math]\displaystyle{ \sigma(j)=n. }[/math] Define the permutation [math]\displaystyle{ \tau(i)=\begin{cases}\sigma(i)&\text{for }i \in \{1,\ldots,n\}\setminus\{j,n\},\\ k&\text{for }i = j,\\ n&\text{for }i = n,\end{cases} }[/math] which arises from [math]\displaystyle{ \sigma }[/math] by exchanging the values of [math]\displaystyle{ j }[/math] and [math]\displaystyle{ n. }[/math] There are now two subcases:
  1. If [math]\displaystyle{ x_k = x_n }[/math] or [math]\displaystyle{ y_k = y_n, }[/math] then this exchange of values of [math]\displaystyle{ \sigma }[/math] has no effect on the middle term in (1) because [math]\displaystyle{ \tau }[/math] gives the same sum, and we can proceed by applying the first case to [math]\displaystyle{ \tau. }[/math] Note that in the case [math]\displaystyle{ x_1 \lt \cdots \lt x_n, }[/math] the permutation [math]\displaystyle{ \tau }[/math] keeps the order of [math]\displaystyle{ y_1,\ldots,y_n }[/math] if and only if [math]\displaystyle{ \sigma }[/math] does.
  2. If [math]\displaystyle{ x_k \lt x_n }[/math] and [math]\displaystyle{ y_k \lt y_n, }[/math] then [math]\displaystyle{ 0 \lt (x_n - x_k) (y_n - y_k), }[/math] which is equivalent to [math]\displaystyle{ x_k y_n + x_n y_k \lt x_k y_k + x_n y_n }[/math] and shows that [math]\displaystyle{ \sigma }[/math] is not optimal, hence this case cannot happen due to the choice of [math]\displaystyle{ \sigma. }[/math]

Generalizations

Three or more sequences

A straightforward generalization takes into account more sequences. Assume we have finite ordered sequences of nonnegative real numbers [math]\displaystyle{ 0 \le x_1\le\cdots\le x_n\quad\text{and}\quad 0\le y_1\le\cdots\le y_n\quad\text{and}\quad 0\le z_1\le\cdots\le z_n }[/math] and a permutation [math]\displaystyle{ y_{\sigma(1)},\ldots,y_{\sigma(n)} }[/math] of [math]\displaystyle{ y_1,\dots,y_n }[/math] and another permutation [math]\displaystyle{ z_{\tau(1)},\dots,z_{\tau(n)} }[/math] of [math]\displaystyle{ z_1,\dots,z_n. }[/math] Then [math]\displaystyle{ x_1 y_{\sigma(1)} z_{\tau(1)} + \cdots + x_n y_{\sigma(n)} z_{\tau(n)} \le x_1 y_1 z_1 + \cdots + x_n y_n z_n. }[/math]

Note that, unlike the standard rearrangement inequality (1), this statement requires the numbers to be nonnegative. A similar statement is true for any number of sequences with all numbers nonnegative.

Functions instead of factors

Another generalization of the rearrangement inequality states that for all real numbers [math]\displaystyle{ x_1 \le \cdots \le x_n }[/math] and every choice of continuously differentiable functions [math]\displaystyle{ f_i: [x_1,x_n] \to \R }[/math] for [math]\displaystyle{ i = 1, 2, \ldots, n }[/math] such that their derivatives [math]\displaystyle{ f'_1,\ldots,f'_n }[/math] satisfy [math]\displaystyle{ f'_1(x) \le f'_2(x) \le \cdots \le f'_n(x) \quad \text{ for all } x \in [x_1,x_n], }[/math] the inequality [math]\displaystyle{ \sum_{i=1}^n f_{n-i+1}(x_i) \le \sum_{i=1}^n f_{\sigma(i)}(x_i) \le \sum_{i=1}^n f_i(x_i) }[/math] holds for every permutation [math]\displaystyle{ f_{\sigma(1)}, \ldots, f_{\sigma(n)} }[/math] of [math]\displaystyle{ f_1, \ldots, f_n. }[/math][2] Taking real numbers [math]\displaystyle{ y_1 \le \cdots \le y_n }[/math] and the linear functions [math]\displaystyle{ f_i(x) := x y_i }[/math] for real [math]\displaystyle{ x }[/math] and [math]\displaystyle{ i = 1,\ldots,n, }[/math] the standard rearrangement inequality (1) is recovered.

See also

References

  1. Hardy, G.H.; Littlewood, J.E.; Pólya, G. (1952), Inequalities, Cambridge Mathematical Library (2. ed.), Cambridge: Cambridge University Press, ISBN 0-521-05206-8 , Section 10.2, Theorem 368
  2. Holstermann, Jan (2017), "A Generalization of the Rearrangement Inequality", Mathematical Reflections (5 (2017)), https://www.awesomemath.org/wp-pdf-files/math-reflections/mr-2017-05/rearrangement_inequality.pdf