# Probability that a circle formed in a unit square contains the square's center.

From a Goldman Sachs Quant. position test.

Two points are chosen randomly in a unit square. What is the probability that the circle formed using the diameter of the 2 points contains the square's center?

• As a starter, if A and B are the points and C is the center, C is inside or on the circle if and only if angle ACB $\ge$ 90 degrees. – marty cohen Jul 13 '13 at 1:25
• Without your comment, @martycohen, I wouldn’t have seen how to attack this. – Lubin Jul 13 '13 at 4:09

Let $X$ and $Y$ denote the randomly drawn points. If $O$ denotes the center of the square, the event of interest occurs iff $\angle XOY$ is not acute. Now draw the line orthogonal to $OX$ at $O$. We want the probability that $X$ and $Y$ don't fall on the same side of this line. Given $X$, the conditional probability is $\frac{1}{2}$ because the line of interest cuts the area of the square in half and $Y$ is drawn uniformly at random from the square and independent of $X$. Taking average (i.e., expectation) with respect to $X$ we deduce that the probability is $\frac{1}{2}$.

• Great answer, thanks @S.B. – jck Jul 13 '13 at 4:38

You can show that, if the two points each form a vector with respect to the center of the square, that the center is included in the circle having a diameter formed by the line segment between the points when the dot product of the vectors is less than or equal to zero. You can see this by writing the equation of the circle:

$$\left ( x - \frac{x_1+x_2}{2}\right )^2+\left ( x - \frac{y_1+y_2}{2}\right )^2 \le \left ( \frac{x_1-x_2}{2}\right )^2 + \left ( \frac{y_1-y_2}{2}\right )^2$$

Plug in the center $(x,y)=(0,0)$, and you get $x_1 x_2+y_1 y_2 \le 0$, which means that the dot product between the vectors defined by the points is zero. This means, as marty alluded to in his comment, that the angle subtended by the diameter at the center of the square must be at least $90^{\circ}$ (and at most $180^{\circ}$).

The question then becomes, what is the distribution of angles between uniformly distributed points in the square? If the probability distribution is $p(\theta)$, then the probability is

$$\frac{\displaystyle\int_{\pi/2}^{\pi} d\theta \, p(\theta)}{\displaystyle\int_{0}^{\pi} d\theta \, p(\theta)}$$

As $p(\theta)$ is symmetric about $\pi/2$, the probability should be $1/2$.

• The involution that sends $(x_1,y_1)$ to $(-x_1,-y_1)$ and leaves the second point fixed changes the sign of the dot product, and is clearly measure-preserving. So the probabilities for “$\ge$” and “$\le$” must be the same, thus $1/2$. – Lubin Jul 13 '13 at 2:23
• Awesome explanation, @Ron Gordon. – jck Jul 13 '13 at 4:40