Geometric probability: line segment intersecting a circle

circlesgeometric-probabilitygeometryprobability

I'm interested in formulating a $2\text{D}$ geometric probability.

Given:

$(1)$ a circle of radius $r < \frac{1}{2}$ with origin $O$ at the center of a unit square
$(2)$ two points $\{A,B\}$ chosen at random on the perimeter of the square*

(*To avoid falling prey to the Bertrand paradox, here's the exact way the points are picked. Importantly, this process does not avoid segments on the perimeter, itself.)

What is the probability that the line segment connecting the points also intersects the circle?

geometric probability diagram

From what I've considered so far the perpendicular bisector of $\angle AOB$ provides a good test of intersection… but the task of integrating binarized results is daunting. I've also considered trying to solve this problem by some kind of polar projection, after which the circle would form a bounding line.

Best Answer

Note that if $A$ and $B$ are points on the perimeter of the unit square, then the line segment $AB$ intersects the circle if and only if the midpoint of $AB$ is on the closed disc.

By symmetry, we may assume without loss of generality that $A$ is on the top edge, so $A=(a,\tfrac12)$ for some $a\in[-\tfrac12,\tfrac12]$. We distinguish four cases:

  1. If $B$ is also on the top edge, then $AB$ does not intersect the circle.

  2. If $B$ is on the right edge, then $B=(\tfrac12,b)$ for some $b\in[-\tfrac12,\tfrac12]$, and the midpoint of $AB$ is $$\left(\frac{2a+1}{4},\frac{2b+1}{4}\right).$$ Then the segment $AB$ intersects the circle if and only if $$\left(\frac{2a+1}{4}\right)^2+\left(\frac{2b-1}{4}\right)^2\leq r^2.$$ Note that $A:=\tfrac{2a+1}{2}$ and $B:=\tfrac{2b+1}{2}$ are uniform random variables on $[0,1]$, and that the above is equivalent to $$A^2+B^2\leq(2r)^2\tag{1}.$$ The probability that this inequality holds is precisely the proportion of the unit square $[0,1]^2$ that is inside the circle of radius $2r$ centered at the origin, which is of course $\pi r^2$.

  3. If $B$ is on the left edge, then by symmetry $AB$ intersect the circle with probability $\pi r^2$.

  4. If $B$ is on the bottom edge, then $B=(b,-\tfrac12)$ for some $b\in[-\tfrac12,\tfrac12]$ and the midpoint of $AB$ is $$M=(\tfrac{a+b}{2},0).$$ Then the segment $AB$ intersects the circle if and only if $$\left(\frac{a+b}{2}\right)^2+0^2\leq r^2,$$ or equivalently $|a+b|\leq2r$. Some elementary calculus then shows that the probability that this inequality holds equals $4r-4r^2$.

As each of the cases above is equally likely, we conclude that the probability that the line segment $AB$ intersects the circle equals $$\frac14\cdot0+\frac24\cdot\pi r^2+\frac14\cdot(4r-4r^2)=\left(\frac{\pi}{2}-1\right)r^2+r.$$