Expectation of absolute difference of 2 repetition of a continuous random variable.

118 Views Asked by At

I was working on a problem below:

$X$ is a continuous random variable with cdf $F(x)$. If two values of $X$ are observed say, $X_1$ and $X_2$. Then show that $$E|X_1-X_2| = 4 \int^{+\infty}_{-\infty}x[F(x)-1/2]dF(x)$$

i.e. I want to show that expectation of absolute difference of two different values of a random variable $x$ is equal to $4 \int_{-\infty}^{\infty} x [F(x) -1/2]dF(x)$ But I am unable to show it and stuck. Below is what I tried.

For $E|X1-X2| = \int \int |x_1-x_2|f(x)dx_2dx_1$

Now $\int|x_1-x_2|f(x)dx_2$ can be integrated from $-\infty$ to $x_1$ and $x_2$ to $\infty$. But I am not able to get the above exact expression.

Note: \int means integration , |x1-x2| is absolute function, f(x) is PDF of X