Library · Geometric Probability · Chapter 57

Buffon’s noodle

Revised Report an error

Problem 57.1

A plane is ruled with parallel lines at equal spacing dd. Instead of a straight needle, a piece of flexible wire in the shape of an arbitrary rectifiable curve of length LL is dropped at random on the plane. What is the expected number of crossings between the curve and the ruled lines?

Solution. The trick is linearity of expectation. Approximate the curve by a polygonal path of short straight segments. For any straight line segment of length ℓ\ell, we have from Chapter 53 that the expected number of crossings is E[crossings of segment]=2ℓπd,\mathbb{E}[\text{crossings of segment}] = \frac{2\ell}{\pi d}, regardless of whether ℓ\ell is smaller or larger than dd (for ℓ≤d\ell \leq d, crossings are 00 or 11; for ℓ>d\ell > d they can exceed 11, but the same integral formula holds because Buffon’s calculation integrates the number of crossings, not the indicator of “at least one”).

By linearity of expectation, the expected number of crossings of a polygon s1∪⋯∪sks_1 \cup \cdots \cup s_k with total length L=ℓ1+⋯+ℓkL = \ell_1 + \cdots + \ell_k is ∑i=1k2ℓiπd=2Lπd.\sum_{i=1}^{k} \frac{2 \ell_i}{\pi d} = \frac{2 L}{\pi d}. Taking the limit as the polygonal approximation tends to the curve (a standard continuity argument for rectifiable curves), E[crossings]=2Lπd.■\boxed{\mathbb{E}[\text{crossings}] = \frac{2 L}{\pi d}.} \qedhere

Buffon’s noodle: three closed curves (circles) on a ruled plane. Intersections with grid lines (rose dots) are located at x = c_x \pm \sqrt{r^2 - (k - c_y)^2} , computed exactly. Each circle’s expected number of crossings over all positions equals 2 \cdot (2\pi r) / (\pi d) = 4r/d , independent of s
Buffon’s noodle: three closed curves (circles) on a ruled plane. Intersections with grid lines (rose dots) are located at x=cx±r2−(k−cy)2x = c_x \pm \sqrt{r^2 - (k - c_y)^2}, computed exactly. Each circle’s expected number of crossings over all positions equals 2⋅(2πr)/(πd)=4r/d2 \cdot (2\pi r) / (\pi d) = 4r/d, independent of shape.

The result is shape-invariant: two pieces of wire of the same length, bent into different shapes, have the same expected number of crossings. A flexible noodle of total length L=πdL = \pi d has expected two crossings per toss, whatever its shape — a fact sometimes used as an amusing Monte Carlo estimator of π\pi.

import numpy as np
# Long straight needle (L > d): E[crossings] = 2L/(pi d) holds for any L.
L, d, N = 2.5, 1.0, 10**6
theta = np.random.rand(N) * np.pi
y = np.random.rand(N) * d
y_top = y + L/2 * np.sin(theta)
y_bot = y - L/2 * np.sin(theta)
crossings = np.abs(np.floor(y_top/d) - np.floor(y_bot/d))
print(f"sim: {crossings.mean():.5f}   exact: {2*L/(np.pi*d):.5f}")
# sim: 1.59045   exact: 1.59155
Report an error on this page

Reports are stored by Netlify. See the privacy note.