# The expected value and standard deviation of $|X-Y|$ where $X$ and $Y$ are random variables

Suppose we have two independent random variables $X$ and $Y$, with expected values and standard deviations of $(\mu_X,\sigma_X)$ and $(\mu_Y,\sigma_Y)$, respectively. Can we say anything about the expected value and standard deviation of $|X-Y|$?

If it had been $X-Y$, the answer would be $(\mu_X-\mu_Y, \sqrt{\sigma_X^2+\sigma_Y^2})$. However, I think such a straightforward approach is not possible because $P(X>Y)$ is not independent from $P(X,Y)$.

• I would use the notation $\mu_X, \mu_Y, \sigma_X, \sigma_Y$, consistently denoting each random variable in the same way. The in expressions like $\Pr(X\le x)$ the lower-case $x$ would not be a random variable; rather $\Pr(X\le x)$ would be a function of the variable $x$. ${}\qquad{}$ – Michael Hardy Aug 5 '15 at 18:17
• If we do not know anything else on the distribution of $X$ and $Y$ we cannot hope in something more than an inequality. Cantelli's inequality should be the way to go: if $X$ is concentrated around $\mu_x$ and $Y$ is concentrated around $\mu_y$, it is reasonable to expect that $|X-Y|$ is concentrated around $|\mu_x-\mu_y|$. – Jack D'Aurizio Aug 5 '15 at 18:25

Suppose we know the mean $\mu$ of $|X-Y|$. This is enough to determine the variance, since it is $E(|X-Y|^2)-\mu^2$. For note that $$E(|X-Y|^2)=E(X^2)-2E(XY)+E(Y^2),$$ and each of the terms above can be calculated from the mean and variance of $X$ and $Y$.
Unfortunately, $\mu$ is not determined by the individual means and variances of $X$ and $Y$. For example, let $X$ and $Y$ take on values $-1$ and $1$ each with probability $1/2$. Then $X$ and $Y$ have mean $0$ and variance $1$, and $E(|X-Y|)=1$. But if we use standard normals for $X$ and $Y$, the mean of $|X-Y|$ is different (I believe it is $\frac{2}{\sqrt{\pi}}$).
This does not fully answer the question, since it only says we cannot determine $\mu$ from the given information. There will undoubtedly be useful inequalities.
• Could we write $\mu$ in terms of the individual means, and also $P(X,Y)$ and $P(X>Y)$? – sodiumnitrate Aug 5 '15 at 19:39
• Certainly in terms of $P(X,Y)$ if by that you mean the joint distribution function of $X$ and $Y$, That, by itself, tells us everything about $X$ and $Y$. It may be doable in terms of $\Pr(X\gt Y)$ and (discrete case) $\Pr(X=Y)$. I do not have immediate intuition about the answer. – André Nicolas Aug 5 '15 at 19:46
• Could we simply say, if we denote $P(X>Y)$ by $p$, $\mu_{|X-Y|}=(2p-1)(\mu_X-\mu_Y)$? – sodiumnitrate Aug 5 '15 at 23:57
• Not quite, Sorry, I cannot comment seriously for a while, guests, drinking, $\dots$. – André Nicolas Aug 6 '15 at 2:06