# Average shortest distance between a circle and a random point lying in it

What is the average shortest distance between the circle $(x-a)^2+(y-b)^2=r^2$ and a random point lying in it?

This question is just idle curiosity. Basically, it's the same as finding the difference between its radius and the average distance between the random point and its center. Let $D$ denote the shortest distance between the circle $(x-a)^2+(y-b)^2=r^2$ and the random point $P(X,Y)$, then

$$D=r-\sqrt{(X-a)^2+(Y-b)^2}$$

We may assume $X$ and $Y$ are independently uniformly distributed in $(0,a)$ and $(0,b)$, respectively. Then its joint pdf is

$$f_{X,Y}(x,y)=f_X(x)\cdot f_Y(y)=\frac{1}{ab}$$

Hence the average of $D$ is

$$E[D]=\int_0^b\int_0^a d\ f_{X,Y}(x,y)\ dx\ dy=r-\frac{1}{ab}\int_0^b\int_0^a \sqrt{(x-a)^2+(y-b)^2}\ dx\ dy$$

Is my approach correct? If not, how does one find the correct $E[D]$?

• Your ranges for $X,Y$ are wrong. Even making them $(a-r,a+r)$ and $(b-r,b+r)$ does not work, because you do not want a rectangular range. You want the distribution for $P$ to be uniform over the disk. – almagest Jun 10 '16 at 12:14
• @almagest Be that as it may, I think to denote the random point in your answer you should use 2 random variables, namely $R\sim U(0,r)$ and $\Theta\sim U(0,2\pi)$. – Sophie Agnesi Jun 10 '16 at 12:47
• There is no need for $\theta$ because of the symmetry. – almagest Jun 10 '16 at 12:50
• Are you implying the answer to my question is the same as the average distance between 2 random points on a line with length $r$? – Sophie Agnesi Jun 10 '16 at 12:52
• Yes, if you do that calculation, it also comes to $\frac{r}{3}$. – almagest Jun 10 '16 at 13:06

## 2 Answers

If the point lies in a ring radius $x$, thickness $\delta x$, centred at the centre of the circle, then the distance is $r-x$. The ring has area $2\pi x\ \delta x$ and the circle has area $\pi r^2$. So assuming the distribution for the point $P$ is uniform over the disk, the expected distance is $\frac{1}{\pi r^2}\int_0^r(r-x)2\pi x\ dx=\frac{r}{3}$.

• Can you elaborate your answer a bit? I just need a clear & a detail explanation of how it must be true? Thanks – Sophie Agnesi Jun 10 '16 at 12:27
• This is just a straightforward integration. All points in the shaded ring have the same distance $r-x$. The ring has circumference $2\pi x$ and thickness $\delta x$ hence area $2\pi x\ \delta x$. – almagest Jun 10 '16 at 12:36
• This works if we pick a random point with respect to the uniform distribution over the circle, but that is not the OP's assumption, apparently. – Jack D'Aurizio Jun 10 '16 at 12:38
• Sorry, if it's so obvious but how do you explain that the pdf is $\frac{2x}{r^2}$? I'm still confused? – Sophie Agnesi Jun 10 '16 at 12:39
• The assumption is that the prob of $P$ lying in an area $A$ is 0 if the area is outside the disk and proportional to the area if it lies inside it. So the prob that the point lies inside the shaded ring is $\frac{2\pi x\ \delta x}{\pi r^2}$. – almagest Jun 10 '16 at 12:55

let $X$ be the distance between a point in a circle and center. Also, we assume that the probability of a point to lie in a fraction of a circle is proportional to the area of the fraction.

$f(x)$ is a probability density function of $X$

If we think of a ring with inner radius $a$ and outer radius $x$,

$\int_{a}^{x}f(t)dt= P(a<X<x)=\frac{\pi (x^2-a^2)}{\pi R^2}=\frac{x^2-a^2}{R^2}$

using fundamental theorem of calculus, $f(x)=\frac{2x}{R^2}$

Thus, (Average of $X$)=$\int_{0}^{R}xf(x)dx=\frac{2R}{3}$

The desired value would be $R-\frac{2R}{3}=\frac{R}{3}$