Formula for $E(|X-Y|)$ for i.i.d. random variables $X$ and $Y$, in terms of their CDF

510 Views Asked by At

Assuming that $X$ and $Y$ are i.i.d. random variables with CDF $F$, prove that $$\mathbb{E}|X-Y| = 2\int_{-\infty}^{\infty}F(t)(1-F(t))\,\textrm{d}t.$$

So I begin: $\mathbb{E}|X-Y| = \mathbb{E}(X-Y)\mathbb{1}_{\{X{\geq}Y\}} + \mathbb{E}(Y-X)\mathbb{1}_{\{X{\leq}Y\}}$. Since $X,Y$ are identically distributed, those two expected values are equal, I think. So I need to show that $$\mathbb{E}(X-Y)\mathbb{1}_{\{X{\geq}Y\}} = \int_{-\infty}^{\infty}F(t)(1-F(t))\,\textrm{d}t.$$

I try: $$\mathbb{E}(X-Y)\mathbb{1}_{\{X{\geq}Y\}} = \int_{\{X-Y{\geq}0\}}(X-Y)F(\textrm dx)F(\textrm dy) = \int_{-\infty}^{\infty}\int_{-\infty}^{x}(x-y)F(\textrm dy)F(\textrm dx).$$

Is this any good? Do I have to find CDF of $X-Y$ now? If so, how do I find it? Is there a better way?

1

There are 1 best solutions below

0
On

This is a beautiful and useful theorem - thank you for your question. As a general rule it is often easier to shrink the larger side than to expand the compact statement:

$\int^{\infty}_{-\infty} F(t)(1-F(t))dt=\int^{\infty}_{-\infty} P(X>t)P(Y \leq t))dt=\int^{\infty}_{-\infty} E[1_{X>t}]E[1_{Y \leq t}]dt=\int^{\infty}_{-\infty} E[1_{X>t}1_{Y \leq t}]dt=\int^{\infty}_{-\infty}E[1_{X>Y}1_{X>t}1_{Y \leq t}]dt=E[\int^{\infty}_{-\infty}1_{X>Y}1_{X>t}1_{Y \leq t}dt]=E[\int^{X}_{Y}1_{X>Y}1_{X>t}1_{Y \leq t}dt]=E[1_{X>Y}\int^{X}_{Y}1_{X>t}1_{Y \leq t}dt]=E[1_{X>Y}\int^{X}_{Y}1dt]=E[(X-Y)1_{X>Y}]$

Remind yourself that for the expected value the event $\{X=Y\}$ has no effect. You should be good now. For these questions always use $P(A)=E[1_A]$ and then apply Fubini's theorem, as I did.