The rearrangement inequality is a statement about the pairwise products of two sequences. It can be extended to Chebyshev's inequality, and illustrates the practical power of greedy algorithms.
hold, where π(1),π(2),…,π(n) is any permutation of 1,2,…,n.
Proof
Consider a permutation π(1),π(2),…,π(n) such that a1bπ(1)+a2bπ(2)+⋯+anbπ(n) is maximized. The desired result is that π is the identity permutation: i.e. π(i)=i for all i. Suppose for the sake of contradiction that π is not the identity, and let i be the smallest integer such that π(i)=i.
Since i is the smallest such integer, this means that π(i)=j>i (as the numbers 1 to i−1 are already assigned). Furthermore, there must exist a k>i such that π(k)=i, as some number must be assigned to i.
Now, since i<j, it follows that bi≤bj. Similarly, since i<k, it follows that ai≤ak. Therefore,
0≤(ak−ai)(bj−bi)⟹aibj+akbi≤akbj+aibi,
so the sum a1bπ(1)+⋯+anbπ(n) is not decreased by changing π(i)=j,π(k)=i to π(i)=i,π(k)=j. This implies that the identity permutation gives the maximum possible value of a1bπ(1)+a2bπ(2)+⋯+anbπ(n), as desired.
Strategies and Applications
The value of the rearrangement inequality lies chiefly in the fact that it formalizes one's intuition towards what amounts to a greedy algorithm. For instance, if one were presented with a large number of $20 bills, $10 bills, $5 bills, and $1 bills, with the instructions to take 4 of one type of bill, 3 of another, 2 of another, and 1 of the last, it is intuitively obvious that four $20 bills, three $10 bills, two $5 bills, and one $1 bill should be selected. Indeed, this is precisely the statement of the rearrangement inequality, applied to the sequences 20,10,5,1 and 4,3,2,1.
Like the Chebyshev inequality, care must be taken to assure both sequences are similarly ordered. Common strategies include
a≥b≥c⟹a+b≥a+c≥b+c
a≥b≥c⟹a1≤b1≤c1.
Cycling the variables is also a powerful technique, as this preserves some ordering. For instance,
Show that
a2+b2+c2≥ab+bc+ca
for reals a,b,c.
Assume without loss of generality that a≥b≥c. By rearrangement,
a⋅a+b⋅b+c⋅c≥a⋅b+b⋅c+c⋅a,
which is precisely the desired inequality. □
A similar strategy leads to another proof of the AM-GM inequality:
Show that
a4+b4+c4+d4≥4abcd
for positive reals a,b,c,d.
Assume without loss of generality that a≤b≤c≤d. The rearrangement inequality tells us that
Additionally, the rearrangement inequality tells us that
d⋅bcd+a⋅a3≥d⋅a3+a⋅bcd⟹bcd2+a4≥da3+abcd,
which implies that
d4+c4+b4+a4≥dc3+db3+da3+abcd,
so it suffices to show that dc3+db3+da3≥3abcd, or a3+b3+c3≥3abc. This argument is then repeated until it is left to prove that a≥a, which is self-evident. □
Let y1,y2,y3,…,y8 be a permutation of the numbers 1,2,3,…,8. What is the minimum value of i=1∑8(yi+i)2?
The correct answer is: 648
Solution 1: We will apply a smoothing argument, to show that the expression is minimized when the yi are arranged in decreasing order. Given any permutation of yi, if we have yi<yj for i<j, then
⇔⇔(yi+i)2+(yj+j)22iyi+2jyj2(j−i)(yj−yi)≥(yi+j)2+(yj+i)2≥2jyi+2iyj≥0.
This shows that we can get a smaller sum by interchanging yi and yj. As such, after finitely many such interchanges, we eventually get that yi is a decreasing sequence, which would be (8,7,6,5,4,3,2,1). Thus, the minimum value of the expression is i=1∑8(yi+i)2=i=1∑892=8×92=648.
Solution 2:i=1∑8(yi+i)2=i=1∑8yi2+i=1∑82iyi+i=1∑8i2. The first and third terms are fixed. According to the rearrangement inequality, since (1,2,3,...,8) is in increasing order, the second term is minimized when (y1,y2,y3,…y8) are in decreasing order, so we must have yi=9−i. As such, we have yi+i=9, so the expression i=1∑8(yi+i)2=i=1∑892=8×92=648.
Note: The smoothing argument is analogous to a proof of rearrangement inequality.