# Rearrangement Inequality

In mathematics, the rearrangement inequality states that

$x_ny_1 + cdots + x_1y_n le x_{sigma (1)}y_1 + cdots + x_{sigma (n)}y_n le x_1y_1 + cdots + x_ny_n$

for every choice of real numbers

and every permutation

of x1, . . ., xn. If the numbers are different, meaning that

then the lower bound is attained only for the permutation which reverses the order, i.e. σ(i) = ni + 1 for all i = 1, ..., n, and the upper bound is attained only for the identity, i.e. σ(i) = i for all i = 1, ..., n.

Note that the rearrangement inequality makes no assumptions on the signs of the real numbers.