The following problems appeared in The Riddler. They involve randomly picking points on a circle or sphere and seeing if the resulting shape contains the center or not.

Problem 1:Choose three points on a circle at random and connect them to form a triangle. What is the probability that the center of the circle is contained in that triangle?

Problem 2:Choose four points at random (independently and uniformly distributed) on the surface of a sphere. What is the probability that the tetrahedron defined by those four points contains the center of the sphere?

Here is my solution to both problems:

[Show Solution]

This problem also appeared as Problem A-6 in the 1992 William Lowell Putnam math competition. After writing this blog post, I also discovered an amazing video about this problem by @3Blue1Brown. The video is exceptionally clear and well-produced; I highly recommend it! The solution I present below is similar to the one in the video, except that I also included a section at the end that provides more mathematical details.

Both the 2D and 3D versions of the problem can be solved in a similar fashion, using the same key observation. I will point out this observation and then prove it mathematically. We’ll start with the first problem because it’s a bit simpler, but the logic is the same for both.

### Problem 1: triangle and circle

Instead of picking three points on the circle at random, the symmetry in the problem allows us (without any loss of generality) to fix the first point and then pick the remaining two uniformly at random. Let’s suppose that the first point is fixed to be at the top of the circle. For the two remaining points, each one has a “mirror point” that lies directly opposite it on the other side of the circle. In mathspeak, a point and its mirror point are said to be diametrically opposed.

Since the points on the circle are chosen uniformly at random, each point is as likely to be chosen as its diametrically opposed counterpart. Therefore, instead of picking the remaining two points uniformly at random, we’ll do the following equivalent thing:

- Pick two lines through the center of the circle uniformly at random.
- For each line, pick one of its two endpoints at random.

For each choice of two diameters ($BB’$ and $CC’$), there are four possible triangles we can make depending on which endpoints of the diameters are chosen: $ABC$, $AB’C$, $ABC’$, and $AB’C’$. Here is a diagram illustrating the choices of triangles.

One of the four triangles contain the center point $O$. This is no accident! No matter which two diameters $BB’$ and $CC’$ we select, exactly one of the four resulting triangles will contain the center point $O$ almost surely. Moreover, each of these four triangles is equally likely because each choice of endpoint ($B$ or $B’$ and $C$ or $C’$) is equally likely. It follows that the probability that the triangle will contain the center point $O$ is $\frac{1}{4}$.

### Problem 2: tetrahedron and sphere

For this problem, we can apply the exact same logic as in the 2D case: fix one point to be at the top of the sphere and select the remaining three points by first picking three diameters at random, and then for each diameter choosing one of its endpoints at random. Once again, it turns out that exactly one of the 8 possible tetrahedra will contain the center of the sphere. Each triangle is equally likely, so the probability that the random tetrahedron contains the center of the sphere is $\frac{1}{8}$.

### Mathematical proof

The results above rely on the observation that exactly one of the 4 triangles (in the 2D case) or one of the 8 tetrahedra (in the 3D case) contains the center of the circle or sphere. We will now prove this fact more rigorously by using the notion of barycentric coordinates. Suppose the vertices of the tetrahedron are located at $\vec{p}$, $\vec{q}$, $\vec{r}$, $\vec{s}$. Given a point $\vec{x}$ (not necessarily on the surface of the sphere), we can represent it as a linear combination:

\[

\vec{x} = \lambda_1 \vec{p} + \lambda_2 \vec{q} + \lambda_3 \vec{r} + \lambda_4 \vec{s}

\]The quadruple $(\lambda_1,\lambda_2,\lambda_3,\lambda_4)$ are the *barycentric coordinates* of $\vec{x}$ with respect to the tetrahedron. This representation is not unique, but it becomes unique if we add a normalizing constraint such as $\lambda_1+\lambda_2+\lambda_3+\lambda_4=1$. A key property of barycentric coordinates is that $\vec{x}$ lies inside the tetrahedron if and only if all coordinates have the same sign. The reason is that the interior of the tetrahedron is also the convex hull of its vertices.

We can use the property above to solve our problem. Let $\vec{o}$ be the center of the sphere and suppose it’s located at the origin. This means that the point diametrically opposed to any point $\vec{y}$ is simply $-\vec{y}$. As before, we’ll fix $\vec{p}$. The 8 possible (equally likely) tetrahedra are formed by using the vertices:

\[

\vec{p}

\quad\text{and}\quad

(\vec{q}\text{ or }-\vec{q})

\quad\text{and}\quad

(\vec{r}\text{ or }-\vec{r})

\quad\text{and}\quad

(\vec{s}\text{ or }-\vec{s})

\]We want to test whether $\vec{x}=\vec{o}$ is inside the tetrahedron or not. Therefore, the 8 equations we should solve for the 8 possible tetrahedra are:

\begin{align}

\vec{o} &= \lambda_1 \vec{p}+\lambda_2 \vec{q}+\lambda_3 \vec{r}+\lambda_4 \vec{s}, &

\vec{o} &= \lambda_1 \vec{p}+\lambda_2 \vec{q}+\lambda_3 \vec{r}-\lambda_4 \vec{s}, \\

\vec{o} &= \lambda_1 \vec{p}+\lambda_2 \vec{q}-\lambda_3 \vec{r}+\lambda_4 \vec{s}, &

\vec{o} &= \lambda_1 \vec{p}+\lambda_2 \vec{q}-\lambda_3 \vec{r}-\lambda_4 \vec{s}, \\

\vec{o} &= \lambda_1 \vec{p}-\lambda_2 \vec{q}+\lambda_3 \vec{r}+\lambda_4 \vec{s}, &

\vec{o} &= \lambda_1 \vec{p}-\lambda_2 \vec{q}+\lambda_3 \vec{r}-\lambda_4 \vec{s}, \\

\vec{o} &= \lambda_1 \vec{p}-\lambda_2 \vec{q}-\lambda_3 \vec{r}+\lambda_4 \vec{s}, &

\vec{o} &= \lambda_1 \vec{p}-\lambda_2 \vec{q}-\lambda_3 \vec{r}-\lambda_4 \vec{s}.

\end{align}But these equations have very similar solutions! Indeed, if $(\lambda_1,\lambda_2,\lambda_3,\lambda_4)$ solves the first equation, then the solutions to the equations above are:

\begin{align}

&(\lambda_1,\lambda_2,\lambda_3,\lambda_4), &

&(\lambda_1,\lambda_2,\lambda_3,-\lambda_4), \\

&(\lambda_1,\lambda_2,-\lambda_3,\lambda_4), &

&(\lambda_1,\lambda_2,-\lambda_3,-\lambda_4), \\

&(\lambda_1,-\lambda_2,\lambda_3,\lambda_4), &

&(\lambda_1,-\lambda_2,\lambda_3,-\lambda_4), \\

&(\lambda_1,-\lambda_2,-\lambda_3,\lambda_4), &

&(\lambda_1,-\lambda_2,-\lambda_3,-\lambda_4),

\end{align}respectively. It’s clear that **exactly one** of these quadruples has all entries with the same sign. In other words, exactly one of the 8 tetrahedra contains the center of the sphere. The argument above also works in the 2D case using a similar notion of 2D barycentric coordinates.