# Expectation of the absolute difference of two i.i.d Normal distributions

Let X and Y be iid $\sim Normal(0,1)$

I am interested in finding $E|X-Y|$.

Based on some simulations, I know that it is approximately 1. However, I don't know how to make that appear analytically.

• I edited the title to be more directly tied to what is being asked here. Commented Jul 3, 2017 at 0:35
• user164144 and @MatthewDrury .... note that $X-Y$ is not a difference of two distributions, it's the difference of two random variables. The distinction is important! Commented Jul 3, 2017 at 3:02
• Yes, you're right. I fixed my wording. Commented Jul 3, 2017 at 3:20

If $X$ and $Y$ are independent normal random variables, then $X - Y$ is normal.

$$X - Y \sim Normal(0, \sqrt{2})$$

From here, the expectation of the absolute value of a standard normal is:

$$E \left[ | X | \right] = \sqrt{\frac{2}{\pi}}$$

So for the difference

$$E \left[ | X - Y | \right] = \sqrt{2} E \left[ | X | \right] = \sqrt{\frac{4}{\pi}} = \frac{2}{\sqrt{\pi}}$$

In R, from a simulation

> X <- rnorm(10000)
> Y <- rnorm(10000)
> Z <- mean(abs(X - Y))
> Z
[1] 1.124015


And numerically

> 2/sqrt(pi)
[1] 1.128379