I have two distributions $X$ and $Y$, is it true that for any arrangement of $X$ and $Y$ values $d= \sum_{i=1}^{n}(x_j-y_j)^2$ follows $d\geq\sum_{i=1}^{n}(x_i-y_i)^2$ where $x_i$ and $y_i$ are the $i$th biggest frequencies in the corespondening distribution?
To clearify the $x_j$, $y_j$ arrangements of $X$ and $Y$ are some random arrangements. i hope thats clear enough... if not let me know...
Yes it is true, this is the rearrangement inequality http://en.wikipedia.org/wiki/Rearrangement_inequality . Notice that your sum of squared differences is equal to $C - 2 \sum_i x_i y_i$ where $C$ is a constant sum of squares that does not depend on the arrangement. So you want to minimize $-\sum_i x_i y_i$ which is equivalent to maximizing $\sum_i x_i y_i$, which the rearrangement inequality says is maximized when $x_i$ and $y_i$ are in the same order.