3
$\begingroup$

What is the average distance of two points chosen uniformly on a unit square? What I am asking is how to calculate $E\left(\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}\right)$ for $x_1, x_2, y_1, y_2$ spread uniformly on $[0,1]$.

$\endgroup$
5

1 Answer 1

0
$\begingroup$

Comments:

A brief simulation in R for a million points seems to confirm the answer in the link (2 or 3 place accuracy):

 x1 = runif(m); x2 = runif(m)
 y1 = runif(m); y2 = runif(m)
 d = sqrt((x1-x2)^2 + (y1-y2)^2)
 mean(d)
 ## 0.5215181

Can you start by getting the distribution of $(X_1 - X_2)^2,$ which seems to have expectation 1/6?

$\endgroup$

Not the answer you're looking for? Browse other questions tagged .