I am asked to compute $Var(|X-Y|)$, where X and Y are both iid random variables $~N(0,1)$. It seemed obvious to me to just use
$Var(|X-Y|) = E((X-Y)^2) - E(|X-Y|)^2$
However the solution stated uses a shortcut:
$E(|X-Y|)^2$ = $(\sqrt{2}E(|Z|))^2$
Where Z is the standard normal random variable (which I assume to be $N(0,1)$). Additionally, $E(|Z|) = \sqrt{2/\pi}$
What is the reasoning behind this "shortcut"? How does the standard normal variable, when finding the expected value of the absolute value of this standard normal variable, equal to $\sqrt{2/\pi}$?
I assume that there is some property that states Z = X-Y, where Z, X, and Y all have the same distribution, but that doesn't make any sense to me.
This is a specific property of the normal distribution:
To show this, the simplest way is to use the characteristic functions $E(e^{itX})$, but we can do it using the probability density functions: the probability that $A<aX+bY<B$ is $$ P(A<aX+bY<B) = \iint_{A<ax+by<B} f_X(x)f_Y(y) \, dx \, dy, $$ where $f_X(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-(x-\mu)^2/(2\sigma^2)}$, and $f_Y$ is the same thing with $\nu$ and $\tau$. Now, the trick is to turn this into a single integral by integrating out after a change of variables. Put $u=ax+by$, $v=-b\tau^2x+a\sigma^2 y$ (this is admittedly a rather suspicious substitution, but it makes the algebra much easier: the idea will be to integrate out $v$, and the actual choice won't matter in the end). Then $$ x = \frac{a\sigma^2u-bv}{a^2\sigma^2+b^2\tau^2}, \qquad y = \frac{b\tau^2u+av}{a^2\sigma^2+b^2\tau^2}. $$ If we let the denominator of these be $s^2$, then the argument of the exponential in the integral becomes $$ -\frac{(x-\mu)^2}{2\sigma^2}-\frac{(y-\nu)^2}{2\tau^2} = \dotsb = -\frac{(u-(a\mu+b\nu))^2}{2s^2}-\frac{(v-(a n \sigma^2-b m \tau^2))^2}{2 \sigma^2 \tau^2 s^2} $$ (yes, this calculation is pretty awful, but totally doable and totally boring). Now all that remains is to integrate $v$ out: the double integral is now, once we calculate the Jacobian $1/s^2$, $$ \frac{1}{2\pi \sigma\tau s^2}\int_{A<u<B} \int_{v=-\infty}^{\infty} e^{-(u-m)^2/(2s^2)} e^{(v-k)^2/(2\sigma^2\tau^2s^2)} \, dv \, du, $$ where $m=a\mu+b\nu$ and the value of $k$ is unimportant, since we now have $$ \int_{v=-\infty}^{\infty} e^{(v-k)^2/(2\sigma^2\tau^2s^2)} \, dv = \sqrt{2\pi}\sigma\tau s $$ by the usual normal distribution integral. Hence $$ P(A<aX+bY<B) = \frac{1}{s\sqrt{2\pi}} \int_A^B e^{-(u-m)^2/(2s^2)} \, du, $$ which means precisely that $aX+bY \sim N(m,s) = N(a\mu+b\nu,a^2\sigma^2+b^2\tau^2)$.