Responses: Buffon’s Needle & Monte Carlo Methods
What is the likelihood that a chord drawn at random on a circle is longer than
the circle’s radius? If I break a stick in any two places along its length, how likely
is it that the three resulting pieces can form a triangle? What’s the chance that
a dart thrown by an unskilled player will hit double top by fluke? These, along
with our stated activity, are all examples from the field of geometric probability,
which is simply the computation of probabilities in problems involving distributions of length, area and volume. Familiar as we may be with discrete random
variables which can take isolated values according to a prescribed rule (binomial
distribution, Poisson etc), geometrical quantities such as area or length can take
a continuous range of values, so it’s useful to consider the notion of continuous
random variables. Specifically, we shall need to work with the simplest such case
which is the uniform distribution. As an example, suppose we pick a point x at
random along a 30cm ruler. This is denoted as
X ∼ U[0, 30].
The chance that x then lies between, say, the 10cm and 15cm lines is given by
(15 − 10)/30 = 1/6. Straightforward enough!
. Figure 1: The initial configuration
Figure 2: Specifying position
We require two parameters to uniquely determine the position of a needle relative
to the nearest lines: the angle at which it lies (θ) and the distance of its lowest
point from the line above (y). The angle θ is uniformly distributed between 0
and π (not inclusive) radians. The distance y is similarly likely to be anywhere
between 0 and 1. We denote this distribution as
(Θ, Y ) ∼ U[0, π) × [0, 1).
The condition which ensures intersection with the line above can be simply expressed as
y ≤ L sin θ.
1
So in 2-D “probability space”, all (equally likely) orientations are represented by
points in the box below, whereas the positive outcomes resulting in intersection
are those in the blue region in figure 3a). The probability of crossing a line is
thus the ratio of these two areas:
Pr(intersection) =
Rπ
0
L[− cos θ]π0
2L
L sin θ dθ
=
=
.
(π × 1)
π
π
Note the unexpected appearance of π in our result. This gives us a surprising
way of estimating π practically. Try it! (There are, as it turns out, many similar methods of this ilk for estimating π and other fundamental constants, as well
as more accurately convergent techniques using calculus – but more of this later.)
Figure 3: Regions of (θ, y)-space giving intersection: a) L ≤ 1, b) L > 1.
Clearly the probability 2L/π cannot be valid for very large L as this will exceed 1.
If L is larger than 1, the y = L sin θ curve attains maximum height greater than
1 as shown in figure 3b). It’s a slightly trickier matter to integrate and find the
area of this region, but a bit more calculus eventually leads us to a probability
Pr(intersection) =
√
2
(L − L2 − 1 + sec−1 L).
π
Reassuringly, in the limit as L → ∞, this indicates a probability of intersection
tending to 1, and as L → 1 from above this expression tends to 2L/π, in agreement with our earlier result.
The 2-D grid problem (figure 4a) adds an extra degree of complexity, as we
now need to specify horizontal displacement x from the adjacent line to the right
in addition to vertical distance y and orientation θ. To simplify matters, let’s
assume θ varies between 0 and π/2. If the needle is pointing towards top left
instead, this is obviously a mirror image of the same problem so the answer is
2
identical. This same logic would apply just as well to the previous case of parallel lines. All three of our random variables are uniformly distributed, so our 3-D
probability space is given by
(Θ, X, Y ) ∼ U[0, π/2] × [0, 1) × [0, 1).
Figure 4: The 2-D grid problem: a) general geometry, b) condition for
intersection.
As all x, y and θ values are equally likely, and each varies independently of the
others, I find it easiest to establish the probability of intercept for a given θ and
then average over all θ. From figure 4b) the pin will fail to cross a line only if the
end point lies in the green box. Hence it will intercept a line with probability
1 − (1 − L sin θ)(1 − L cos θ) = L(sin θ + cos θ) − L2 sin θ cos θ.
To average this function over θ from 0 to π/2, we must compare relevant areas:
π/2 × (average value) =
Z
0
π/2
{L(sin θ + cos θ) − L2 sin θ cos θ} dθ,
which ultimately yields an interception probability of
4L − L2
.
π
In order to see if a pattern developed, I looked briefly at the hypothetical case
of a space filled with unit 3-D cubes, and again tried to establish the chances
of a needle crossing at least one face. This requires the introduction of two
further variables as three spatial variables (x, y and z) and two angles (polar and
azimuthal, θ and φ) are necessary to fix the needle’s state. It’s a bit trickier to
3
average our probability over all θ and φ values simultaneously, but for what it’s
worth my answer is
1
{18πL − 4(π + 2)L2 + 3L3 }.
6π 2
No guarantees here, and if anyone can prove me wrong I’d be delighted to hear
from you!
Now we come to the possibility of a bent wire — Buffon’s noodle. Before addressing this seemingly very difficult extension, let’s first think about a subtle
refinement of our initial problem. When ℓ ≤ 1, a needle may cross a line either
once, with probability 2ℓ/π, or not at all. An equivalent way of saying this is
that the expected number of crossings per needle is 2ℓ/π. So if I take two such
identical needles of length ℓ, tossed independently of each other, the expected
number of crossings for the pair is clearly 2ℓ/π + 2ℓ/π = 4ℓ/π. Now suppose
L = 2ℓ. It may just so happen that the two needles are end-to-end in a straight
line, thus forming a needle of length L. So the expected number of crossings for
this longer needle (possibly > 1) is 4ℓ/π = 2L/π — the same formula as before. So instead of evaluating the complicated integral we saw earlier for longer
needles, if we just look at expected crossings, this remains 2L/π even if L > 1.
Going further, there is nothing in the argument which prevents these two needles
meeting at an angle. The expectations are still additive and our result still holds.
Figure 5: The same average number of line crossings for all three!
The principle may be extended to any number of conjoined needles. Provided
we know the total length L, the expected number of intersections is still 2L/π,
regardless of the size of L or the number of zig-zags. As the number of kinks
tends to infinity, in the limit the needle now becomes a curve — the “noodle”.
A nice confirmation of this astonishing result can be obtained from first principles. Assume our needle is bent right around and let’s look at the expected
number of crossings for a circle of diameter 1 (ie total length π). Our formula
predicts the expected number of crossings as 2L/π = 2, which is exactly what it
always has to be.
4
We saw earlier how our first problem gave us an experimental means of determinig π. It’s worth mentioning that there is a subtle but important technicality in
trying to construct a computer program to simulate this procedure. In throwing
a needle “randomly”, we must essentially generate one random number between
0 and 1 for y, and another, multiplied by π, to get our θ. Thus the procedure
is circular: we need π to estimate π. Working in degrees is of no use. All a
calculator does is convert to radians (the “proper” measurement of angle) in any
case.
It is still nevertheless perfectly possible to find π in a similar vein. Consider
firing virtual bullets at a square of side two centred on the origin, such that one
is equally likely to hit any point of the target (figure 6). Then x and y are uniform
on [−1, 1]. Inscribe a circle of radius 1 and area π. It is easy to establish if a given
bullet is inside the circle; that is if x2 + y 2 ≤ 1. Then the ratio of bullets inside
the circle to total bullets fired is the ratio of areas of circle and square, namely π/4.
Figure 6: The odds of hitting the circle involve π.
Both Buffon’s needle and the above bullets are examples of Monte Carlo methods
— a means of finding an approximate answer by performing a large number of
independent trials. Of course, there are superior ways to compute π. For a start
it is possible to construct rapidly-convergent power series to quickly obtain better
estimates. But Monte Carlo techniques have a much greater range of applicability. For instance, literally any definite integral can be found approximately by
viewing it as the area under a curve. Simply surround the area by a simple shape
(often just a box) and fire virtual bullets as above. Our answer is then just the
proportion of bullets below the curve multiplied by the area of the circumscribed
box. Easy!
The term “Monte Carlo method” originated with the Polish-American mathematician Stanislaw Ulam, who worked on the Manhattan Project during World
War II. Shortly after the war, Ulam was convalescing from an illness in hospital,
and passed the time playing solitaire. After spending much time attempting to
5
calculate the likelihood of any game finishing successfully (a staggeringly hard
combinatorics problem), it occurred to him that a simulation of hundreds of
games, aided by the newly-invented electronic computer, could provide an approximate numerical answer. Even with today’s fastest machines, it is utterly
impossible to run through a list of all feasible moves for all possible games, so
the jury is still out on this thorny problem some 60 years on.
In the variation known as “Thoughtful Solitaire” in which the ordering of all
cards is known (so in effect all cards may as well be face up), there exists an algorithm which can be shown to complete the game on 82% of occasions, which puts
my 20% success rate into the shade. Nevertheless, some games may be solvable
by an alternative strategy, so the real percentage has to be higher. Furthermore,
it is highly contentious as to what the “best” strategy consists of. Even this
depends on whether we are playing a game blind or if we know what the first 7
face-up cards are. Just about all that is known for sure is encapsulated in these
figures:
Game solvable 82–91.5%
Game unplayable (no possible moves) 0.025%
Game unsolvable 8.5–18%
If you can resolve any of these questions for certain, a job in just about any
mathematics department should be a formality . . .
On most televised poker shows nowadays, a display can be seen indicating each
player’s chance of winning a hand. It is just about possible to ascertain in real
time the odds of either of 2 players winning a hand of Texas hold ’em: with a
pair of cards in each player’s hand there are
!
48
= 1, 712, 304
5
possible combinations of face-up community cards to come. It is an easy exercise
in probability to establish the odds of obtaining a given hand (flush, full house
etc), but with a given pair of pocket cards, it is an altogether different matter to
assess how likely you are to win the hand without knowing what your opponent(s)
hold. The number of possible games to consider against just one opponent is
!
!
48
50
≃ 2.1 × 109
×
5
2
and increases exponentially with more adversaries. So the only course of action
here is Monte Carlo simulation of thousands of virtual hands to assess the strength
of your cards and your chances of success. But whatever you do, if you value
your life don’t produce your laptop in a Las Vegas casino!
6
© Copyright 2026 Paperzz