A random circle is formed inside a bigger unit circle.

283 Views Asked by At

A random circle (with random center and radius) is formed inside a bigger circle, which is a unit circle centered at origin. Given that the smaller circle is totally in the big circle, what is the probability that the small circle contains the center of the bigger circle?

Through sets of simulation of $1000$ runs, the solution comes around $16.6\%$. But I am curious about an analytic solution.

2

There are 2 best solutions below

3
On

Let $A$ be the event that center is contained by the little circle. Let $D$ be the distance from the center of the little circle to the origin, and let $R$ be the radius.

We have $P(A\mid D=x) = P(R>x | D=x) = \max(0,1-\frac{x}{1-x})$, since $R$ is chosen uniformly from $(0,1-x)$. In particular, the probability is $0$ if and only if $D\ge\frac12$.

We need to figure out the distribution of $D$. We have $P(D<x) = \frac{x^2\pi}{\pi}=x^2$. Therefore the PDF is $f_D(x)= \frac{d}{dx}x^2=2x$ for $0<x<1$.

By the law of total probability: $$ P(A) = \int P(A|D=x)f_D(x)dx = \int_0^\frac12 (1-\frac{x}{1-x})\cdot 2xdx = \frac32-2\log2 \approx 11.37\% $$

This is definitely different from your result (which could be 1/6 it seems). It could be a calculation mistake on my part, or that you chose the random circle differently than what I understood. Both cases are likely in my opinion ;)

3
On

I'm assuming you mean that the center is chosen uniformly at random from the interior of the unit circle and then the radius is chosen uniformly at random from the set of all possible radii. In this case, the probability density of selecting any point for the center is $\frac{1}{\pi}$.

Now we'll switch to polar coordinates. When we do so, however, the probability density of selecting some radius $r$ increases proportionally with $r$ as $r$ gets bigger, since, roughly speaking, the density of all points on any strip (circle concentric to the unit circle) should be the same, and the circumference of each such strip varies linearly with $r$. So $r$ has a pdf of $f(r)=2r$, which takes values between $0$ and $1$ proportionally with $r$, while having $\int_0^1 f(r) \ \text{d}r = 1$. The pdf for the angle is simply uniform, or $g(\theta) = \frac{1}{2\pi}$.

Now, our space of circles includes first a point (the center) in polar coordinates $(r, \theta)$, and the a radius of the smaller circle $\rho$ chosen uniformly between $0$ and $1-r$ (hopefully you can see why the biggest allowable radius is $1-r$--it's because that's the smallest circle that gets too big). Thus the probability density function for all such $\rho$ is $h(\rho) = \frac{1}{1-r}$.

So, the probability density we get the circle described by $(r, \theta, \rho)$ should be $$ V(r, \theta, \rho) = f(r) g(\theta)h(\rho) =\frac{1}{\pi} \frac{r}{1-r} $$ and just to check we're properly normalized we note that the integral of this density over our whole space is just $$ \int_{0}^{1} \int_{0}^{2\pi}\int_{0}^{1-r} \frac{1}{\pi}\frac{r}{1-r} \text{d}\rho \ \text{d}\theta \ \text{d}r = 1$$

So, our question is, of this space of circles $(r, \theta, \phi)$, which ones contain the center of the bigger circle? Well, it's true precisely when $\rho > r$. Indeed, since the center is in polar coordinates, $r$ is the distance from the center of the small circle to the center of the unit circle, so the center of the unit circle is in the small circle if and only if it's radius is bigger than $r$. Where does this happen? Well, it happens only when $r \leq \frac{1}{2}$, since for $r \geq \frac{1}{2}$ the small circle must contain the closest point on the unit circle for a smaller $\rho$ than it could contain the center of the unit circle with. When $r \leq \frac{1}{2}$, it happens in the set of values of $\rho$ bigger than $r$ but still less than $1-r$. If we simply integrate our density function $V$ over this region, we get our probability. If we call the probability we want $P$, we have $$ P = \int_0^{\frac{1}{2}}\int_0^{2\pi} \int_r^{1-r} V(r, \theta, \rho) \text{d}r \ \text{d}\theta \ \text{d}\rho = \int_0^{\frac{1}{2}}\int_0^{2\pi} \int_r^{1-r} \frac{1}{\pi}\frac{r}{1-r} \text{d}r \ \text{d}\theta \ \text{d}\rho $$ $$ = \int_0^{\frac{1}{2}}\int_0^{2\pi} \frac{1-2r}{\pi} \frac{r}{1-r} \text{d}r \ \text{d}\theta = \int_0^\frac{1}{2} \frac{2r-4r^2}{1-r} \text{d}r = \frac{3}{2} - \ln 4 \approx 11.37\%$$

Source code to test the result

import random
import math as m

def test():
    r = random.triangular(0, 1, 1)
    theta = random.uniform(0, 2 * m.pi)
    rho = random.uniform(0, 1 - r)
    return iverson_bracket(rho > r)

def iverson_bracket(boole):
    if boole:
        return 1
    else:
        return 0

num_trials = 1000000
tot = 0
for ind in range(0, num_trials):
    tot += test()
print("Average: " + str(tot/num_trials))

on a million trials it gave $0.11351$