Probability of euclidean distance between two random points inside a unit circle/sphere greater than 1

684 Views Asked by At

Problem: Say there are two points inside the circle; A and B, and they are both randomly drawn according to a uniform distribution where the boundary is the circumference of the unit circle/the surface of the unit sphere. What's the probability that the euclidean distance between two randomly drawn points inside a unit circle/sphere greater than 1?

This question has two versions; the 2D one and the 3D one. I have almost gotten down the expression of the integral in 2D one, but I still get stuck at the late stage of the problem, I haven't tried the 3-D version just yet, but I guess I will get stuck at a similar stage.

The following is my attempt on the 2-D version of the problem:


Phase 1:

for the sake of simplicity, we can "fix" the angle θ of A to a particular fixed value θa and only vary its r value in the polar coordinate system, so A could be (0,θa), (0.2,θa), (1,θa) etc. For B, we can vary everything including radius r and the angle θ of another point `B`.


Phase2:

The required probability should be equal to the sum of all of the conditional probability from r=0 to r= 1, where each increment of r is very very small:

ΣP{|A - B| > 1 | A= (r, θa) }

Upon taking this limiting process to the sum, this becomes a definite integral over the conditional probability density function from r=0 to r=1.

This is where I got stuck, I don't know how to transform the conditional probability to the conditional pdf inside the definite integral and possibly integrate it.

And after this 2-D version, the 3-D version is gonna be another beast that I need help in order to deal with that.


Note: These are the pictures of my drafts and my guesses, not sure whether they are helpful.

Draft of the 2-D version of the problem my guess of what the integral would look like

2

There are 2 best solutions below

1
On BEST ANSWER

This is the solution for the 2D problem

Fix $A$ to be a distance $r$ from the center of the circle (i.e. fix $|A| = r$). Note that the probability density function of $|A|$ is

$$f_{|A|}(r) = \frac{2\pi r}{\pi} = 2r \qquad r \in [0,1]$$

The $2\pi r$ is the "area" of the circle representing all possible $A$ for which $|A| = r$; and the $\pi$ in the denominator is the total area of the unit circle.

Given that $|A| = r$, what is the probability that $|A-B| <1$?

Draw a circle of radius $1$ centered at $A$, and find the area common to both circles. After a bit of geometry, you should find that the answer is $2\cos^{-1} \frac r2 - \frac{r\sqrt{1-r^2}}{2}$. Thus,

$$\Bbb P(|A-B|<1 \, \big| \, |A| = r) = \frac 1\pi \bigg(2\cos^{-1} \frac r2 - \frac{r\sqrt{1-r^2}}{2}\bigg)$$

Finally, we use the law of total probability:

\begin{align} \Bbb P(|A-B|<1) & = \int_0^1 \Bbb P(|A-B|<1 \, \big| \, |A| = r) \cdot \color{red}{f_{|A|}(r)} \, dr \\ & = \int_0^1 \frac 1\pi \bigg(2\cos^{-1} \frac r2 - \frac{r\sqrt{1-r^2}}{2}\bigg) \cdot 2r \, dr \\ & = \frac 1\pi \int_0^1 \bigg(4r\cos^{-1} \frac r2 - r^2\sqrt{1-r^2}\bigg) \, dr \\ & = \frac 1\pi \bigg[ 2r^2 \cos^{-1} \frac r2 + 4\sin^{-1} \frac r2 - \frac 18 \sin^{-1} r - r\sqrt{4-r^2} + \frac 18 (r-2r^3)\sqrt{1-r^2} \bigg]^1_0 \\ & = \frac 1\pi \bigg(\frac{61}{48}\pi - \sqrt 3 \bigg) \\ & = \frac{61}{48} - \frac{\sqrt 3}{\pi} \end{align}

And of course, what we really want is

$$\Bbb P(|A-B|>1) = 1 - \Bbb P(|A-B|<1) = \frac{\sqrt 3}{\pi} - \frac{13}{48} = 0.2805 \dots$$

As pointed out above in red, you are missing a factor of $2r$ in the integrand.


Here's how to do the integration

\begin{align} & \int r\cos^{-1} \frac r2 \, dr \\ = & 4\int u\cos^{-1} u \, du && \text{substituted } u = \frac r2 \\ = & 4 \cdot \frac{u^2}{2} \cdot \cos^{-1} u - 4\int \frac{u^2}{2} \cdot \frac{-1}{\sqrt{1-u^2}} \, du && \text{integrated by parts} \\ = & 2u^2 \cos^{-1} u + 2\int u \cdot \frac{u}{\sqrt{1-u^2}} \, du \\ = & 2u^2 \cos^{-1} u + 2 \cdot u \cdot \big(-\sqrt{1-u^2}\big) - 2 \int 1 \cdot \big(-\sqrt{1-u^2}\big) \, du && \text{by parts again} \\ = & 2u^2 \cos^{-1} u - 2u\sqrt{1-u^2} + 2\int \sqrt{1-u^2} \, du \\ = & 2u^2 \cos^{-1} u - 2u\sqrt{1-u^2} + 2\int \sqrt{1-\sin^2 v} \cdot \cos v \, dv && \text{substituted } u = \sin v \\ = & 2u^2 \cos^{-1} u - 2u\sqrt{1-u^2} + 2\int \cos^2 v \, dv \\ = & 2u^2 \cos^{-1} u - 2u\sqrt{1-u^2} + 2 \bigg(\frac v2 - \frac{\sin (v) \cos (v)}{2} \bigg) \\ = & \frac 12 r^2\cos^{-1} \frac r2 - r\sqrt{1-\frac{r^2}{4}} + \sin^{-1} \frac r2 - \frac r2 \sqrt{1-\frac{r^2}{4}} \end{align}

The other integral can be done by writing

$$\int r^2\sqrt{1-r^2} \, dr = \int r \cdot \Big(r\sqrt{1-r^2}\Big) \, dr$$

and integrating by parts as suggested.

4
On

This is the solution for the 3D problem

The previous post (below this one) was already quite lengthy, so I decided to do this in a new post.

We use the same strategy as before, by first fixing $|A|$. By a similar reasoning, we have

$$f_{|A|} (r) = \frac{4\pi r^2}{\frac 43 \pi 1^3} = 3r^2 \qquad r \in [0,1]$$

The next step is a little trickier this time. We must find the volume common to two unit spheres whose radii are distance $r$ apart.

Using coordinate geometry, we might suppose that the two spheres have boundaries

$$\bigg(x-\frac r2 \bigg)^2+y^2 + z^2 = 1 \qquad \text{and} \qquad \bigg(x+\frac r2\bigg)^2 + y^2 + z^2 = 1$$

respectively. By considering the regions $x\in [\frac r2-1,0]$ and $x \in [0, 1-\frac r2]$ separately, we see that the required volume is given by the integral

$$\int_{x=\frac r2-1}^{x=0}\int_{y = -\sqrt{1-(x-\frac r2)^2}}^{y = \sqrt{1-(x-\frac r2)^2}}\int_{z = -\sqrt{1-(x-\frac r2)^2-y^2}}^{z = \sqrt{1-(x-\frac r2)^2-y^2}}dzdydx + \int_{x=0}^{x=1-\frac r2}\int_{y = -\sqrt{1-(x+\frac r2)^2}}^{y = \sqrt{1-(x+\frac r2)^2}}\int_{z = -\sqrt{1-(x+\frac r2)^2-y^2}}^{z = \sqrt{1-(x+\frac r2)^2-y^2}}dzdydx$$

This is a mess. But of course, we can simplify this a little bit by observing the symmetry. So

\begin{align} \cdots & = 8 \int_{x=0}^{x=1-\frac r2}\int_{y = 0}^{y = \sqrt{1-(x+\frac r2)^2}}\int_{z = 0}^{z = \sqrt{1-(x+\frac r2)^2-y^2}}dzdydx \\ & = 8 \int_{x=0}^{x=1-\frac r2}\int_{y = 0}^{y = \sqrt{1-(x+\frac r2)^2}} \sqrt{1-\bigg(x+\frac r2 \bigg)^2-y^2} \, dydx \\ & = 2\pi \int_{x=0}^{x=1-\frac r2} \bigg(1-\bigg(x+\frac r2 \bigg)^2\bigg) \, dx \\ & = \bigg(\frac 43 - r + \frac{1}{12}r^3 \bigg)\pi \end{align}

This seems a bit unreasonable, since the 2D problem had $\cos^{-1}$'s and whatnot, yet the 3D problem has such a neat result. However, I have checked with Wolfy, and this seems to be correct.

As before, we then have

$$\Bbb P(|A-B|<1 \, \big | \, |A|=r) = \frac{\bigg(\frac 43 - r + \frac{1}{12}r^3 \bigg)\pi}{\frac 43 \pi} = 1 - \frac 34 r + \frac{1}{16}r^3$$

Finally,

$$\Bbb P(|A-B|<1) = \int_0^1 \bigg(1 - \frac 34 r + \frac{1}{16}r^3\bigg) \cdot 3r^2 \, dr = \frac{15}{32}$$

And

$$\Bbb P(|A-B|>1) = \frac{17}{32}$$

I highly suspect that I have done something wrong, but this is the way to go about this question.