TITLE: show this nice and hard inequality with $ \prod_{i=1}^{n}|x_{i}-y_{i}|<e^{\frac{n}{2}}$
QUESTION [24 upvotes]: I saw the following results in a book. The author said it was not difficult to prove how I felt it was difficult to prove, so I asked here. The result comes from a book that has no electronic version.Here's what I'm trying to prove.

let $x_{1}\ge x_{2}\ge\cdots\ge x_{n}\ge 0,y_{1}\ge y_{2}\ge\cdots\ge y_{n}\ge 0$,and such 
  $$\sum_{i=1}^{n}x_{i}=\sum_{i=1}^{n}y_{i}=n$$
  show that
  $$ \prod_{i=1}^{n}|x_{i}-y_{i}|<e^{\frac{n}{2}}$$

I try let$$A=\{i|x_{i}\ge y_{i}\},B=\{i|x_{i}<y_{i}\}$$
so 
$$\prod_{i=1}^{n}|x_{i}-y_{i}|=\prod_{i\in A}(x_{i}-y_{i})\prod_{i\in B}(y_{i}-x_{i})$$
and use AM-GM inequality we have
$$\prod_{i\in A}(x_{i}-y_{i})\le\left(\dfrac{\sum_{i\in A}(x_{i}-y_{i})}{|A|}\right)^{|A|}$$and 
$$\prod_{i\in B}(y_{i}-x_{i})\le\left(\dfrac{\sum_{i\in B}(y_{i}-x_{i})}{|B|}\right)^{|B|}$$
where $$|A|+|B|=n,\sum_{i\in B}x_{i}=n-\sum_{i\in A}x_{i},\sum_{i\in B}y_{i}=n-\sum_{i\in A}y_{i}$$
so let $$x=\sum_{i\in A}x_{i},y=\sum_{i\in A}y_{i},t=|A|$$
then we have
$$\prod_{i=1}^{n}|x_{i}-y_{i}|\le \left(\dfrac{x-y}{t}\right)^t\left(\dfrac{(n-y)-(n-x)}{n-t}\right)^{n-t}=\dfrac{(x-y)^n}{t^t(n-t)^{n-t}}$$

REPLY [2 votes]: Here's a proof I like but with an exercise left in it for the reader. Let $c_i = |x_i-y_i|$, let $A = \{i : x_i \geq y_i\}$ and $B$ the remainders, and let $c = \sum_{i \in A} c_i = \sum_{i \in B} c_i$. Under the constraints that $c_i \geq 0$ and these sums hold, we have
\begin{align}
  \prod_{i=1}^n |x_i - y_i|
  &=    \prod_{i\in A} c_i \prod_{j\in B} c_j  \\
  &\leq \left(\frac{c}{|A|}\right)^{|A|} \left(\frac{c}{|B|}\right)^{|B|}  \\
  &=     c^n \frac{1}{|A|^{|A|}} \frac{1}{(n-|A|)^{n-|A|}}  \\
  &=     \left(\frac{c}{n ~ \alpha^{\alpha} (1-\alpha)^{1-\alpha}}\right)^n
\end{align}
where $|A| = \alpha n$.
Now if we take the bound $c \leq n$ then we can optimize at $\alpha=1/2$ and recover the bound $2^n \approx e^{0.69 n}$. But I claim
Lemma. $c \leq \max\{|A|,|B|\}$.
(Since writing the rest of this proof I have not been able to prove the lemma. It follows from Iosof Pinelis' claim which has been posted meanwhile, so I leave it as an exercise -- I would love to have an elementary short proof. An equivalent statement is $\sum_{i=1}^n \min\{x_i,y_i\} \geq \min\{|A|,|B|\}$.)
Given the lemma, suppose WLOG that $\alpha \leq \frac{n}{2}$ so $c = (1-\alpha)n$, then we have
\begin{align}
  \left(\frac{c}{n ~ \alpha^{\alpha} (1-\alpha)^{1-\alpha}}\right)^n
  &=    \left(\left(\frac{1-\alpha}{\alpha}\right)^{\alpha}\right)^n  \\
  &=    \exp\left(n ~ \alpha \ln\frac{1-\alpha}{\alpha}\right) \\
  &\leq \exp\left(n ~ \alpha \ln\frac{1}{\alpha}\right)  \\
  &\leq e^{n/e} \\
  &\approx e^{0.37 n}
\end{align}
although bounding $1-\alpha$ by $1$ is clearly loose. Numerically it looks like $\approx e^{0.28 n}$.