At MathsJam, I was pointed at a puzzle from the New Scientist, which I’ll paraphrase as:

You have a long, thin cake of length 1. Two candles are places at random ((Throughout, “random” means “at a point drawn from a uniform distribution on the cake’s length”.)) points on the top of the cake, and the cake is cut (perpendicular to its edges) at a third random point. What is the probability that the two resulting pieces of cake each have a candle on?

In discussion, we came up with three ways, which I’ll present in reverse order of complexity. Spoilers below the line.

### In three dimensions (my way)

Let the first candle be at position $x$ and the second at position $y$. The probability of the cut dividing the candles is $|x-y|$, which I think of as a height above the $xy$-plane.

The resulting 3D graph forms a pair of tetrahedra, each with a base of area $\frac{1}{2}$ and height 1; the volume of each is therefore $\frac{1}{6}$ and the probability is $\frac{1}{3}$.

### A single integral

Suppose the cut takes place at position $x$. The probability the candles lie on either side of the cut is $2x(1-x)$, so the total probability is $\int_0^1 2x - 2x^2 \dx = \left[ x^2 - \frac{2}{3}x^3\right]_0^1$, which is again $\frac{1}{3}$.

### A simple and logical approach

Philipp pointed out that the three points are in an order from left to right, and the probability of any given one of them being in the middle is $\frac{1}{3}$.

I love it when there’s an elegant solution! Did you tackle it a different way?