# Average distance between two random points in a square

A square with side $$a$$ is given. What is the average distance between two uniformly-distributed random points inside the square?

For more general "rectangle" case, see here. The proof found there is fairly complex, and I am looking for a simpler proof for this special case. I expect it could be significantly simpler.

We just have to compute: $$I=\int_{[0,1]^4}\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}\,d\mu. \tag{1}$$ Assuming that $$X_1$$ and $$X_2$$ are two independent random variables, uniformly distributed over $$[0,1]$$, the pdf of their difference $$\Delta X=X_1-X_2$$ is given by: $$f_{\Delta X}(x) = \left(1-|x|\right)\cdot\mathbb{1}_{[-1,1]}(x)\tag{2}$$ hence: $$\begin{eqnarray*} I &=& \iint_{[-1,1]^2}(1-|x|)(1-|y|)\sqrt{x^2+y^2}\,dx\,dy \\&=&4\iint_{[0,1]^2}xy\sqrt{(1-x)^2+(1-y)^2}\,dx\,dy\tag{3}\end{eqnarray*}$$ that is tedious to compute but still possible; we have:
$$I = \frac{2+\sqrt{2}+5\operatorname{arcsinh}(1)}{15}=\frac{2+\sqrt{2}+5\log(1+\sqrt{2})}{15}=0.52140543316472\ldots$$
hence the average distance between two random points in $$[0,a]^2$$ is around the $$52.14\%$$ of $$a$$.
• Does this variable $I$ have a name? I believe I have seen it before used as a named constant. Nov 14 '16 at 3:55