The Laramee Filter:
pseudorandom thoughts, subsequently put on the Internet.

Author:

Tom Laramee

Date Published:

February 16th, 2024

Previous: My [Definitely] Ambitious ...

Word Count:

1,388 (10:00 read time)

Related:

As it turns out, it's not that easy to understand due to the involvement of both trigonometry and calculus.

During homeschool a few years ago, I learned about a fun math problem called Buffon's Needle, in which you can derive the value of π by tossing frozen hot dogs across your kitchen floor.

I found this to be fascinating, so I sat down to try to work it out, and while I got decently close, there were a couple of mistakes that I made and I ended up being unable to work out the underlying mathematics.

It's been bugging me ever since, so I decided to try to give it another shot[1], and this time I'm pretty sure I get it.

Be forewarned: my handwriting sucks, and so if I wrote something on one of the pages below that's necessary to understand, I'll type the text in in the section below the image.

NOTE: Each image is clickable for a larger version.

Problem Set-Up

In looking at the image below, note the following (and we're throwing needles from here on out):

- There are 4 long, parallel, horizontal lines. These are counted as "crosses" if a given needle crosses over one of them.
- The distance between these lines is l, as is the length of each needle.
- I drew 4 arbitrarily tossed needles[2], those are shown in red.
- The needles are each positioned at an angle of θ, respectively.

Now, what's the probability that a needle crosses a line? It's when the distance of it's left-most point (to the parallel line) is less than l*sin(θ).

I drew faint lines to indicate the value of l*sin(θ), and you can see d1, d2, d3, and d4 labelled.

It's also worth noting a couple of intuitive things:

- If θ = 0, the probability of a cross is zero.
- The same holds when θ = 180°, (π in radians).
- If θ = 90° (aka: π/2), the probability of a cross is one.

Problem Set-Up: Let's Toss Some Needles and Get the Lay of the Land

The Probability of a Cross Using the Midpoint of the Needle

There are a couple of ways of working out the probability of a cross. The 1st one is to use the mid-point of the needle. In this case, a cross occurs if (l/2)*sin(θ) is greater than d (the distance from the midpoint of the needle to the horizontal line).

I drew, and labelled, the vertical distances of both "d" and "(l/2)*sin(θ)".

Knowing that, we can draw a small probability diagram, which graphs sin(θ) from 0 to π with an amplitude of l/2 (as we're using the mid-point of the needle, so the max possible value of sin(θ) is (l/2).

From there, you need to use calculus to figure out the area of the shaded part of that diagram. It's simply the integral, from 0..π, of (l/2)*sin(θ)dθ.

The integral of "sin(θ)dθ" is "-cos(θ)", so we can evaluate that expression and we end up with a value of "l" (highlighted in yellow). That area represents "the number of crosses".

The total area is simply "(lπ/2)" (also highlighted in yellow). That area represents "the number of tosses".

Let's set that result aside for a moment and we'll relate it to the value of π on the last page.

The Probability of a Cross Using the Mid-Point of the Needle

The Probability of a Cross Using the Endpoint of the Needle

Now, I said there were a couple of ways to work this out, and the other intuitive one is to use the end-point of the needle. In this case, a cross occurs if l*sin(θ) is greater than d (the distance from the midpoint of the needle to the horizontal line).

I drew, and labelled, the vertical distances of both "d" and "l*sin(θ)".

Knowing that, we can draw the same probability diagram, which graphs sin(θ) from 0 to π with an amplitude of l.

From there, you need to use calculus to figure out the area of the shaded part of that diagram. It's simply the integral, from 0..π, of "l*sin(θ)dθ".

The integral of "sin(θ)dθ" is "-cos(θ)", so we can evaluate that expression and we end up with a value of "2l" (highlighted in yellow). That area represents "the number of crosses".

The total area is simply "(lπ)" (also highlighted in yellow). That area represents "the number of tosses".

Let's also set that result aside for a moment and we'll relate in to the value of π on the last page.

The Probability of a Cross Using the End-Point of the Needle

Why Is the Integral from 0..π and not 0..2π?

The mathematically savvy among you likely noticed that I used an integral from 0..π (and not 0..2π) in my probability calculations above. Why is that?

To me, this is the most counter-intuitive part of this proof. Initially, I figured that, if I tossed an infinite number of needles and they all landed with the needle's mid-point in the same position, then all possible angles of those needles would result in a circle (with diameter l). Therefore, the integral had to be from 0..2π.

However, if you look at the explanation below, it should make sense why it's 0..π.

My largely illegible scrawl on that image below reads as follows:

- Start with the line (the needle) at a θ = 0.
- At 30°, it has more of a chance of crossing.
- At 60°, it's even greater.
- At 90°, it's at the max probability (of a cross).
- At 120°, it starts to drop off.
- At 150°, it drops off even more. (it is zero).

This makes even more sense for case 2, where we use the end-point of the needle. If we went from 0..2π, we'd be duplicating crosses (by crossing the parallel line above and the parallel line below).

I looked at my previous attempt to prove this and I believe this is the only assumption I made that was errant (and as a result I was off by a factor of 2).

Why is the Needle's Rotation Interval 0..π and not 0..2π?

Relating Those Probabilities to the Value of π

I also found myself a bit lost in the math after all of that, and it took me a minute to relate those probabilities to the value of π. Here's how you do it:

Using words, the probability of a cross is "crosses/tosses". In other words, the total number of times a needle crossed a line divided by the total number of tosses.

In case 1, we used the mid-point of the needle to calculate the probability of a cross and ended up with a value of "l". The total number of tosses was "πl/2". You can see below, simply make equivalent fractions .. "words on the left" and "mathematical results on the right". Then solve for π.

In case 1: crosses/tosses = (l)/(lπ/2) simplifies to π = ( 2 * crosses ) / tosses

In case 2, we used the end-point of the needle to calculate the probability of a cross and ended up with a value of "2l". The total number of tosses was "lπ". You can see below, we made equivalent fractions again and then solved for π.

In case 2: crosses/tosses = (2l)/(lπ) simplifies to π = ( 2 * crosses ) / tosses

(This is very good - we should always get the same relationship as a result).

Relating the Probabilities of a Cross to the Value of π

Conclusion

And that, my friends, is the math behind Buffon's Needle. The only thing left to do is to start tossing frozen hot dogs across your kitchen and record the number of crosses and the total number of tosses.

Keep in mind, you'll need to toss more than 1,000 hot dogs to start to see this converge, and more like 5,000 hot dogs to get 3 significant figures ("3.14" part of π).

Footnotes:

[1] Partially due to the fact that I'm teaching my daughter
trigonometry, and so I'm remembering a lot more math these days.

[2] Or hot dogs, if you prefer.