Library · Geometric Probability · Chapter 54
Laplace’s extension of Buffon
Problem 54.1
A plane is ruled with both horizontal and vertical parallel lines, forming a square grid of side . A needle of length is dropped at random. What is the probability that the needle crosses at least one line?
Solution. Let be the probability that the needle crosses a horizontal line, and the probability it crosses a vertical line. Buffon’s calculation (Chapter 53) gives .
We want the probability of any crossing. By inclusion–exclusion,
To compute , parametrise as in Chapter 53: let be the angle with the horizontal, uniform, and let be the location of the needle’s centre inside a single tile, uniform in . The needle crosses a horizontal line iff , an event of -probability (since this uses both sides of the tile). Similarly it crosses a vertical line with -probability . Conditioned on , these are independent events, so Averaging over uniform on :
Therefore which simplifies to
Laplace recorded this generalisation of Buffon’s result in his Théorie analytique des probabilités (1812). The intuition is that a grid offers twice as many opportunities to cross a line, tempered by a quadratic correction for simultaneous crossings. Setting gives , so most tosses of a needle as long as the tile side cross at least one line.
import numpy as np
L, d, N = 0.8, 1.0, 10**7
theta = np.random.rand(N) * np.pi/2
u, v = np.random.rand(2, N) * d
cross_h = np.minimum(v, d-v) <= L/2 * np.sin(theta)
cross_v = np.minimum(u, d-u) <= L/2 * np.cos(theta)
p = (cross_h | cross_v).mean()
print(f"sim: {p:.5f} exact: {L*(4*d - L)/(np.pi*d*d):.5f}")
# sim: 0.81510 exact: 0.81487