Skip to content
Vamshi Jandhyala

Books · The Riddler

Chapter 46

Breaking A Slide Rule Into Four Pieces

A foot-long ruler is accidentally sliced at three random points, making four pieces of different lengths. On average, how long is the piece that contains the 6-inch mark?

The Riddler, FiveThirtyEight(original post)

Solution

The piece holding the 66-inch mark runs from the nearest cut below it to the nearest cut above it (or to a ruler end if there is no cut on that side). So its length is the distance up to the first cut above the mark plus the distance down to the first cut below, and we can find each by itself.

Let the ruler have length LL and the mark sit at mm, a fraction a=m/La = m/L of the way along, with n=3n = 3 cuts placed uniformly. A given cut lands within distance dd above the mark with probability d/Ld/L, so the chance that none of the nn cuts falls in that strip is (1d/L)n(1 - d/L)^n. Integrating this survival probability, the expected distance from the mark up to the first cut above it is 0Lm(1dL)ndd=Ln+1(1an+1),\int_0^{L-m}\Big(1 - \tfrac{d}{L}\Big)^n dd = \frac{L}{n+1}\big(1 - a^{\,n+1}\big), and likewise the distance down to the first cut below has expectation Ln+1(1(1a)n+1)\frac{L}{n+1}\big(1 - (1-a)^{\,n+1}\big). Adding them, E[length]=Ln+1(2an+1(1a)n+1).\mathbb{E}[\text{length}] = \frac{L}{n+1}\Big(2 - a^{\,n+1} - (1-a)^{\,n+1}\Big). With L=12L = 12, n=3n = 3 and a=12a = \tfrac12, 124(2124124)=3(218)=458=5.625 inches.\frac{12}{4}\Big(2 - \tfrac{1}{2^4} - \tfrac{1}{2^4}\Big) = 3\Big(2 - \tfrac18\Big) = \frac{45}{8} = \boxed{5.625} \text{ inches}. The marked piece averages well over the 33-inch length of a typical quarter, because the piece straddling a fixed point tends to be one of the longer ones.

The computation

Slice the ruler at three random points and measure the piece spanning the 66-inch mark, averaged over many rulers.

import numpy as np
rng = np.random.default_rng(0)
runs = 2_000_000; total = 0.0
for _ in range(runs):
    cuts = np.sort(rng.uniform(0, 12, 3))
    ends = np.concatenate(([0.0], cuts, [12.0]))
    for lo, hi in zip(ends[:-1], ends[1:]):
        if lo < 6 < hi:
            total += hi - lo; break
print(total / runs)                          # ~5.625