A stick one metre long is snapped at two points, each chosen at random along its length, with every position equally likely and the two chosen independently. That makes three pieces. Three sticks can be made into a triangle when each is shorter than the other two put together. What is the chance that these three pieces make a triangle?
Call the two break points, in order along the stick, (measured from the left end in metres). The three pieces are
and they add up to 1. Each piece is shorter than the other two together exactly when it is shorter than : a piece beats the other two when , which is . So the pieces make a triangle exactly when
Picking two random points on the stick is the same as picking a random point in the unit square, and sorting them throws away which was which. So we may look at the half of the square where . That region is a triangle of area 0.5, and a random point of it is equally likely to be anywhere in it, so a probability is an area divided by 0.5.
Draw the triangle . The three conditions are cut out by three lines:
The region that survives all three is a right triangle with corners , and . Its legs are both , so its area is
The probability is that area divided by the area of the whole region, which is 0.125 ÷ 0.5 = 0.25, so .
The three lines , and cut the whole ordered triangle into four pieces, and all four are right triangles with legs . Together they have area 0.5, so each has 0.125. Only one piece is the good one. Here is what goes wrong in each of the others:
| region | where | what fails |
|---|---|---|
| A | and | nothing: a triangle |
| B | and | the last piece, , is at least |
| C | and | the middle piece is at least |
| D | the first piece, , is at least |
Every point of the ordered triangle is in exactly one of these four, and the four have equal area. So the chance of a triangle is one in four. This is the film's second route, and it is the same count as the first: one triangle of area out of .
The film breaks four sticks to show it, one in each region:
| the break points , | the three pieces | region |
|---|---|---|
| 0.1, 0.4 | 0.1, 0.3, 0.6 | B |
| 0.4, 0.7 | 0.4, 0.3, 0.3 | A |
| 0.15, 0.8 | 0.15, 0.65, 0.2 | C |
| 0.6, 0.85 | 0.6, 0.25, 0.15 | D |
Only the second is a triangle, because all three of its pieces are under 0.5. In the first, 0.6 is more than half the stick, so no triangle can close.
A script cannot prove a probability, but it can catch a mistake in the geometry. It does this in two ways.
A grid. Lay a grid of 2000 by 2000 cells over the unit square, keep the cells with , and classify the centre of each as A, B, C or D. The share of the ordered triangle that lands in A is 0.2498, and each of the four regions has an area of about 0.125, as the geometry says.
Random sticks. Break 400,000 sticks with a seeded random generator, so the run is repeatable. Of them 99,909 make a triangle, which is 0.2498. For a true probability of , the typical wobble in a run of this size is about , and the result is within that of 0.25.
Is the answer ? It feels as if it should be, because each piece has a decent chance of being short. But all three pieces have to be short at once, and the picture shows how rarely that happens: the good region is only one of four equal triangles.
Why two independent uniform points? The answer depends on how the stick is broken, and that is a choice the puzzle has to state. The film's rule is the natural one: two independent points, every position equally likely. A different recipe for "break at random", for instance breaking once and then breaking one of the two pieces, is a different problem with a different answer. This page and the film use the one recipe above, and the script simulates exactly that recipe.
scripts/broken-stick.mjs asserts the claims below before it writes maths.json, and its --check fails if the file is stale. It checks that:
The 240 dots the film scatters on its diagram are the first 240 of those simulated breaks, kept with the result of the triangle test.
The pieces are 0.3, 0.25 and 0.45, and every one is under 0.5, so yes. The point has and , so it is in region A.
It is in region D, because . The first piece, 0.7, is longer than the other two together, which are 0.3.
Choosing two points and calling the left one gives the same three pieces whichever way round you chose them. The other half of the square is a mirror image, so it has the same probability, and looking at one half gives the same answer.