# What is the expected distance between normally distributed points on a plane? What about the distance in higher dimensions?

Let $X = (x_1, x_2)$ and $Y = (y_1, y_2)$ where the random variables $x_1$, $x_2$, $y_1$, $y_2$ are independent standard normal. What is the expected distance between $X$ and $Y$, i.e. what is $$D_2=E\left(\sqrt{(x_1 - y_1)^2 + (x_2 - y_2)^2}\right)\ ?$$ Does this value increase or decrease when the number $n$ of dimensions increases, that is when $X = (x_1, \cdots, x_n)$ and $Y = (y_1, \cdots, y_n)$ for some independent standard normal random variables $x_i$, $y_i$, and $n>2$? Does it converge when $n \rightarrow \infty$?

Note: I do not know if the resulting integrals are tractable (I would suspect that they are not).

• It's not clear whether the components are independent... – leonbloy Jul 4 '16 at 13:33
• "in other words" is incorrect. The independence of the variables is a fact beyond what is stated in the first part of the sentence. – joriki Jul 4 '16 at 13:35
• @leonbloy Forgot to clarify that they are i.i.d., fixed now. – Sid Jul 4 '16 at 13:36
• It seems clear that the expected distance is an increasing function of the dimension $n$, increasing to infinity, and equivalent to $\sqrt{2n}$.. – Did Jul 4 '16 at 13:47
• Thus the expected value is $$\mathbb E\left[|X-Y|\right]=\frac{\int_0^\infty\mathrm drr^{n-1}\mathrm e^{-r^2/2}\int_{-\infty}^\infty\mathrm dy_\parallel\mathrm e^{-y_\parallel^2/2}\int_0^\infty\mathrm dy_\perp y_\perp^{n-2}\mathrm e^{-y_\perp^2/2}\sqrt{(r-y_\parallel)^2+y_\perp^2}} {\int_0^\infty\mathrm drr^{n-1}\mathrm e^{-r^2/2}\int_{-\infty}^\infty\mathrm dy_\parallel\mathrm e^{-y_\parallel^2/2}\int_0^\infty\mathrm dy_\perp y_\perp^{n-2}\mathrm e^{-y_\perp^2/2}}\;.$$ That's not a nice integral. – joriki Jul 4 '16 at 13:50

If everything is independent, then this is no longer a two-point problem: the variables $x_i - y_i$ are independent $N(0,2)$. The expectation is not terribly hard to compute, see here. It is increasing (moreover, the distribution itself is increasing, in terms of stochastic order) and, as @Did commented, equivalent to $\sqrt{2n}$.

Here is a simplified example for $n=2$ which might help you to start out.

Assume an archer is shooting an arrow onto an infinite target with center $(0,0)$. The arrow hits at the coordinates $(X,Y)$ where $X$ and $Y$ are independent and $X,Y\sim\mathcal{N}(0,1)$. It should be clear that

$$f_{X,Y}(x,y)=\frac{\exp(-1/2\cdot(x^2+y^2))}{2\pi}$$

since $X$ and $Y$ are independent. Let $Z$ be a random variable describing the distance from the center - since $Z<0$ does not make sense we have $F_Z(z)=0$ for $z<0$. Therefore we can assume $z\geq 0$ now. Now with some steps we can get

\begin{align*} F_Z(z) &= \Pr[Z\leq z] = \Pr[(X,Y)\in B_z(0)] = \int_{B_z(0)}f_{X,Y}(s,t)\,\mathrm{d}s\,\mathrm{d}t\\ &= \int_0^z\int_0^{2\pi}r\cdot f_{X,Y}(r\cos\Theta,r\sin\Theta)\,\mathrm{d}\Theta\,\mathrm{d}r\\ &= \int_0^z\int_0^{2\pi}r\cdot \frac{\exp(-1/2\cdot(r^2\cos^2\Theta+r^2\sin^2\Theta))}{2\pi}\,\mathrm{d}\Theta\,\mathrm{d}r\\ &= \int_0^z\int_0^{2\pi}r\cdot \frac{\exp(-1/2\cdot r^2)}{2\pi}\,\mathrm{d}\Theta\,\mathrm{d}r\\ &= \int_0^zr\cdot \frac{\exp(-1/2\cdot r^2)}{2\pi}\int_0^{2\pi}\,\mathrm{d}\Theta\,\mathrm{d}r\\ &= \int_0^zr\cdot \frac{\exp(-1/2\cdot r^2)}{2\pi}\cdot 2\pi\,\mathrm{d}r\\ &= \int_0^z r\cdot\exp(-1/2\cdot r^2)\,\mathrm{d}r \end{align*}

which yields

\begin{align*} f_Z(z) = F_Z'(z)=\begin{cases} r\cdot\exp(-1/2\cdot r^2),&z\geq 0,\\ 0,&\text{otherwise}. \end{cases} \end{align*}

Now it follows that

\begin{align*} \mathbb{E}[Z] &= \int_{-\infty}^\infty t\cdot \left (t\cdot\exp(-1/2\cdot t^2)\right )\,\mathrm{d}t\\ &= \left[-\exp(-1/2\cdot t^2)\cdot t\right |_0^\infty-\int_0^\infty -\exp(-1/2\cdot t^2)\,\mathrm{d}t \\ &= 0 + \sqrt{2\pi}\int_0^\infty\frac{\exp(-1/2\cdot t^2)}{\sqrt{2\pi}}\,\mathrm{d}t\\ &= \sqrt{2\pi}\cdot \frac{1}{2} = \sqrt{\frac{\pi}{2}}. \end{align*}

Hence the archer will miss the center by about $\sqrt{\pi/2}$ units.