PuzzleReels
Sections

The Broken Stick

The maths · Episode 25 · 2:21 · gives the answer

The puzzle

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?

The maths, properly

Call the two break points, in order along the stick, x<y (measured from the left end in metres). The three pieces are

x,y−x,1−y

and they add up to 1. Each piece is shorter than the other two together exactly when it is shorter than 12: a piece p beats the other two when p≥1−p, which is p≥12. So the pieces make a triangle exactly when

x<12,y−x<12,y>12.

Picking two random points on the stick is the same as picking a random point (x,y) in the unit square, and sorting them throws away which was which. So we may look at the half of the square where x<y. 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.

Route one: the inequalities

Draw the triangle 0<x<y<1. The three conditions are cut out by three lines:

  • x<12 keeps the left half;
  • y>12 keeps the upper half;
  • y−x<12 keeps the points below the line y=x+12.

The region that survives all three is a right triangle with corners (0,12), (12,12) and (12,1). Its legs are both 12, so its area is

12·12·12=18=0.125.

The probability is that area divided by the area of the whole region, which is 0.125 ÷ 0.5 = 0.25, so 14.

Route two: four equal triangles

The three lines x=12, y=12 and y=x+12 cut the whole ordered triangle into four pieces, and all four are right triangles with legs 12. 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:

regionwherewhat fails
Ax<12<y and y−x<12nothing: a triangle
Bx<12 and y<12the last piece, 1−y, is at least 12
Cx<12 and y−x≥12the middle piece is at least 12
Dx≥12the first piece, x, is at least 12

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 18 out of 12.

The film breaks four sticks to show it, one in each region:

the break points x, ythe three piecesregion
0.1, 0.40.1, 0.3, 0.6B
0.4, 0.70.4, 0.3, 0.3A
0.15, 0.80.15, 0.65, 0.2C
0.6, 0.850.6, 0.25, 0.15D

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 numerical check

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 x<y, 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 14, the typical wobble in a run of this size is about 14·34/400000≈0.0007, and the result is within that of 0.25.

The question you might ask next

Is the answer 12? 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.

Checking it

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 ordered triangle has area 0.5, and it is cut by the three lines into four triangles of area 0.125 each;
  • the good region is exactly one of them, so the probability is 0.125 ÷ 0.5 = 0.25;
  • a grid of 2000 by 2000 gives 0.2498, and each of the four regions has area within 0.002 of 18;
  • the four film examples fall in the regions A, B, C and D that the table above gives, with the right pieces;
  • 400,000 seeded breaks give 99,909 triangles, which is 0.2498, within six standard errors of one quarter.

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.

Where this shows up

  • Geometric probability. The method is to turn a random choice into a point in a region and read the probability off as an area. It is the standard way into a family of problems about random points on a line, a square or a circle.
  • The recipe matters. Bertrand's paradox is the famous warning: ask for a "random chord of a circle" in three natural ways and you get three different answers. "Break a stick at random" has the same flaw, which is why the puzzle has to say how.
  • Triangle inequality. The condition that a piece is shorter than the sum of the other two is the triangle inequality, which is the rule behind distance itself.

Try it yourself

1. A stick is broken at 0.3 and 0.55. Can the pieces make a triangle?

The pieces are 0.3, 0.25 and 0.45, and every one is under 0.5, so yes. The point (x,y)=(0.3,0.55) has x<12<y and y−x=0.25<12, so it is in region A.

2. Which region is the break at 0.7 and 0.9 in, and why does it fail?

It is in region D, because x=0.7≥12. The first piece, 0.7, is longer than the other two together, which are 0.3.

3. Why can we look only at the half of the square where x < y?

Choosing two points and calling the left one x 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.