Maximum mean absolute difference of two iid random variables

For a continuous distribution. Denote $F(x)$ the CFD of $X$ or $Y$. Then the expectation $$ \begin{aligned} \mathop{\mathbb E}|X-Y|&=\mathop{\mathbb E}(\max\{X,Y\}-\min\{X,Y\})\\ &=\int_0^1xdF^2(x)-\int_0^1xd(1-(1-F(x))^2)\\ &=2\int_0^1xF(x)dF(x)-2\int_0^1x(1-F(x))dF(x)\\ &=2\int_0^1x(2F(x)-1)dF(x)=\int_0^1xG(x)dG(x), \end{aligned} $$ where $G(x)=2F(x)-1$. Integrating by parts, we get $$ \begin{aligned} \int_0^1xG(x)dG(x)&=xG^2(x)\bigg|_0^1-\int_0^1G(x)d(xG(x))\\ &=1-\int_0^1xG(x)dG(x)-\int_0^1G^2(x)dx. \end{aligned} $$ Hence, $$ \mathop{\mathbb E}|X-Y|=\frac12-\frac12\int_0^1G^2(x)dx\le\frac12. $$


This proof applies in general to all random variables supported in $[0,1]$ . From the identity $|a-b|=a+b-2\min(a,b)$ we obtain that $$ \mathbb E|X-Y|=2\bigl(\mathbb EX-\mathbb E\min(X,Y)\bigr). $$ Thus by this formula and using $\mathbb P(\min(X,Y)>t)=\mathbb P(X>t)^2$ we have $$ \frac{\mathbb E|X-Y|}{2}= \int_0^1\mathbb P(X>t)-P(X>t)^2\ dt=\int_0^1\mathbb P(X>t)\cdot \mathbb P(X\leq t)\ dt\leq \frac{1}{4}, $$ since by AM-GM we have $$\mathbb P(X>t)\cdot \mathbb P(X\leq t)\leq \Bigl(\frac{\mathbb P(X>t)+ \mathbb P(X\leq t)}{2}\Bigr)^2=\frac 14.$$


A slight variant of the proof, might be considered more appealing depending on taste.

From the identity $$ |X-Y|=\int_0^1 1[X>t\geq Y]+1[Y>t\geq X]\ dt,\quad a.s. $$ it follows directly by Tonelli's Theorem that $$ \frac{\mathbb E|X-Y|}{2}=\int_0^1 \mathbb P(X>t)\cdot \mathbb P(X\leq t)\ dt\leq \frac{1}{4}. $$