21

How can I find an average distance between two points lying inside a circular disk of a certain radius?

I wonder if there is any other way except of using a Monte Carlo method?

4 Answers4

21

See the answer to this question. The expected distance is $$ d= {128 r\over 45\pi}. $$

Here is another demonstration of this result.

Gebb
  • 326
  • 1
    Your answer seem to be wrong. Using Monte Carlo simulations (see this script) I got another answer $d=0.72r$, and $\frac{128}{45\pi}\approx0.91$. – installero Apr 24 '12 at 06:05
  • 6
    You're probably making the mistake decribed here http://www.anderswallin.net/2009/05/uniform-random-points-in-a-circle-using-polar-coordinates/ – Gebb Apr 24 '12 at 08:44
  • 1
    IMO that is more of a mistake of ambiguity in the question than a mistake in installero's solution. – DanielV Jul 15 '20 at 08:06
11

Following Grimmett & Stirzaker 's "One thousand exercises in probability", we can approach this way:

Let $ f(r) := E \rho $, where $\rho $ is the distance between points P1 and P2 which are independently and uniformly distributed on the disk $D$ of a radius $r$.

Let's consider the problem for the disk of a radius $r + h$ for little $h$. If points distributed over a disk $D_h$ of a radius $r + h$: $$ P\{P1 \in D, P2 \in D \} = (\frac{\pi r^2}{\pi (r+h)^2})^2 = 1 - \frac{4 h}{r} + o(h) $$ $$ P\{P1 \in D, P2 \in D_h \backslash D \} = (\frac{\pi r^2}{\pi (r+h)^2})(1 - \frac{\pi r^2}{\pi (r+h)^2}) = \frac{2 h}{r} + o(h) $$ And finally: $$ P\{P1 \in D_h \backslash D, P2 \in D_h \backslash D \} = o(h) $$

Now let's rewrite $ f(r+h) $ using conditional expectation: $$ f(r+h) = E \rho = E(\rho 1_{P1 \in D, P2 \in D}) + 2 E(\rho 1_{P1 \in D, P2 \in D_h \backslash D}) + o(h) $$

It's easy to see, that $$ \frac{E(\rho 1_{P1 \in D, P2 \in D})}{P\{P1 \in D, P2 \in D \}} = f(r) $$ $$ E(\rho 1_{P1 \in D, P2 \in D}) = f(r)(1 - \frac{4 h}{r} + o(h)) $$

And also we can rewrite $$ E(\rho 1_{P1 \in D, P2 \in D_h \backslash D}) = \frac{E(\rho 1_{P1 \in D, P2 \in D_h \backslash D})}{P\{P1 \in D, P2 \in D_h \backslash D \} } (\frac{2 h}{r} + o(h)) $$ In which $\frac{E(\rho 1_{P1 \in D, P2 \in D_h \backslash D})}{P\{P1 \in D, P2 \in D_h \backslash D \} } $ is exact (with ac. $o(h)$) average distance between points on the disk of radius $r$ and on the edge. Which is easy to calculate in polar coordinates with the center on the edge of the disk. $$ \frac{1}{\pi r^2} \int^{\pi/2}_{-\pi/2} \int^{2r cos(\phi)}_{0} s^2 ds d\phi = \frac{32 r}{9 \pi} + o(h) $$

So we have: $$ f(r + h) = f(r)(1 - \frac{4 h}{r} + o(h)) + 2 (\frac{32 r}{9 \pi} + o(h))(\frac{2 h}{r} + o(h)) $$ $$ f(r+h) - f(r) = - \frac{4 h}{r} f(r) + \frac{128 h}{9 \pi} + o(h)*... $$ $$ f'(r) = - \frac{4}{r} f(r) + \frac{128}{9 \pi} + o(1) $$ With $f(0) = 0$ we get: $$ E \rho = f(r) = \frac{128 r}{45 \pi} $$

Some notes about the integral: disk scheme in geogebra

point F -- is the point in disk,

point C -- is the point on the edge,

distance between them is $s$, the angle between Ox and CF is $\phi$.

And since we transformed coordinates to polar, we should multiply by Jacobian matrix determinant, which is $s$.

And finally $ \frac{1}{\pi r^2}$ is density of point in the disk.

Ben Povar
  • 299
  • I believe that the $o(1)$ in $f'(r)=...$ is superfluous, am I right? Otherwise I wouldn't know how to solve the differential equation. – Kolja Jan 03 '22 at 23:35
8

With the probability density you can find the average of the distance, or the distance squared, or the variance of the distance, or whatever you want. The probability density for the distance $l$ between points in a circle of radius $r$ is given by Ricardo García-Pelayo 2005 J. Phys. A: Math. Gen. 38 3475 as $$p(l)=\frac{4l}{\pi r^2}\arccos \frac{l}{2r}-\frac{2l^2}{\pi r^4}\sqrt{r^2-\frac{l^2}{4}}$$

Then the average distance is given by $$\int_0^{2r}lp(l)dl=\frac{128r}{45\pi}.$$ The average of the distance squared is given by $\int_0^{2r}l^2p(l)dl=r^2.$ Thus the standard deviation is given by $$\sqrt{\int_0^{2r}(l-\frac{128r}{45\pi})^2p(l)dl}=\sqrt{r^2-\left( \frac{128r}{45\pi} \right)^2}=\frac{r\sqrt{2025\pi^2-2^{14}}}{45\pi}$$

SDiv
  • 2,520
1

Let $D$ be the disk, and let $$M = \iint\limits_{(x_0,y_0)\in D} ~~\iint\limits_{(x,y) \in D}dxdydx_0dy_0.$$

Then the quantity you are looking for should be given by $$ \frac{1}{M}\iint\limits_{(x_0,y_0)\in D} ~~\iint\limits_{(x,y) \in D} \sqrt{(x-x_0)^2+(y-y_0)^2}dxdydx_0dy_0 $$ where a suitable change to polar coordinates in both double integrals would probably be helpful.

nullUser
  • 27,877
  • Unfortunately, this method seems to lead me to an unsolvable finite integrals. I would be very thankful if you can help me getting to a final answer. – installero Apr 23 '12 at 13:39
  • It is doable. Just change to polar coordinates. This quadruple integral I have solved in 2015. It takes a lot of per partes and inverse of hyperbolic functions though. – Machinato Aug 27 '20 at 18:50