7

If I have two points $p_1, p_2$ uniformly randomly selected in the unit ball, how can I calculate the probability that one of them is closer to the center of the ball than the distance between the two points?

I know how to calculate the distribution of the distance between two random points in the ball, same for one point from the center, but I'm not sure how to use the two distributions to get what I'm after.

joriki
  • 238,052

2 Answers2

6

$d(p_1,O)\lt d(p_1,p_2)$ or $d(p_2,O)\lt d(p_1,p_2)$ if and only if one of $d(p_1,O)$ and $d(p_2,O)$ is the least of the three distances. By symmetry, the probability for this is twice the probability that $d(p_2,O)$ is the least of the three distances.

Fix $p_1$ at $(0,r)$. Then $d(p_2,O)$ is the least of the three distances if $p_2$ lies within the circle of radius $r$ around the origin and below $y=\frac r2$, and thus in a circular segment with radius $r$ and angle $\frac{4\pi}3$, so the desired probability is

$$ 2\cdot2\cdot\frac1\pi\int_0^1r\mathrm dr\,\frac{r^2}2\left(\frac{4\pi}3+\frac{\sqrt3}2\right)=\frac23+\frac{\sqrt3}{4\pi}\approx80\%\;, $$

where one $2$ is the symmetry factor above, another $2$ normalises for $p_1$ and $\frac1\pi$ normalises for $p_2$.

P.S.: I just realised that I simply assumed that you meant the unit ball in $2$ dimensions but you hadn't actually specified the number of dimensions. In case you meant the unit ball in three dimensions, we need to use a spherical cap of height $\frac32r$ and adjust the radial density and the normalisation; the probability in this case is

$$ 2\cdot 3\cdot\frac3{4\pi}\int_0^1r^2\mathrm dr\,\frac{\pi\left(\frac32r\right)^2}3\left(3r-\frac32r\right)=\frac{81}{16}\int_0^1\mathrm dr\,r^5=\frac{27}{32}\approx84\%\;. $$

In case you wanted the result in arbitrary dimensions, you'll find some information about the volumes of the resulting hyperspherical caps with height $\frac32r$ at Stars in the universe - probability of mutual nearest neighbors.

joriki
  • 238,052
  • 1
    My apologies for the long delay in responding - off on vacation. My simulation gave a very different result, but I'm sure based on your answer it was hinkey, I'll revisit it... Also - thanks for the pings on inclusion-exculsion - it's starting to sink in... – probablynot May 26 '16 at 21:53
  • could you be please, able to elaborate why the integral is in such form ? – Marine Galantin Mar 16 '19 at 14:50
-1

For one of the points to be closer to the center than the other point, both points should lie outside the region of sphere which subtends a solid angle of 2*pi*(1-cos(a)).

Where a= 1 radian (180/pi).

and solid angle subtended at the center by the entire sphere is 4pi. Hence, required probability is 1-[{2*2*pi(1-cos(a))}/{4*pi}]. Which gives the value 0.5403.