You Can Approximate Pi by Dropping Needles on the Floor

Dot Physics News

You Can Approximate Pi by Dropping Needles on the Floor
PhysicsMathPi
  • 📰 WIRED
  • ⏱ Reading Time:
  • 194 sec. here
  • 11 min. at publisher
  • 📊 Quality Score:
  • News: 102%
  • Publisher: 51%

Who needs a supercomputer when you can calculate pi with a box of sewing needles?

Pi is an infinitely long decimal number that never repeats. How do we know? Well, humans have calculated it to 314 trillion decimal places and didn’t reach the end. At that point, I’m inclined to accept it.

I mean, NASA uses only the first 15 decimal places for navigating spacecraft, and that’s more than enough for earthly applications. The coolest thing, for me, is that there are many ways to approximate that value, which I’ve written about in the past. For instance, you can do it by oscillating a mass on a spring. But maybe the craziest method of all was proven in 1777 by George Louis Leclerc, Comte de Buffon. Decades earlier, Buffon had posed this as a probability question in geometry: Imagine you have a floor with parallel lines separated by a distance d. Onto this floor, you drop a bunch of needles with length L. What is the probability that a needle will cross one of the parallel lines? A picture will help you understand what's happening. Let's say I drop just two needles on the floor . Also, just to make things easier later, we can say that the needle length and line spacing are equal . You can see that one of the needles crosses a line and the other doesn't. OK, but what are the chances? This is not the most trivial problem, but let's think about just one dropped needle. We only care about two values—the distance from the farther end of the needle to a line, and the angle of the needle with respect to a perpendicular . If x is less than half the spacing between lines, we get a needle-crossing. As you can see, you’d get a higher probability with a smaller x or a smaller θ. In fact, here is a plot showing a bunch of random x and θ values. The red dots are values that result in a needle crossing and the blue ones are for no crossings. The green line is the function x cos—the transition between crossing and no crossing. The ratio of the area under the curve to the total area would be the probability of a needle crossing. We can find the area under the curve by integrating. If you do the math, you get a probability of 2/π for the case where the needle length is equal to the line spacing. There’s our pi! The reason it got in there is that the needle angle goes from negative π/2 to positive π/2 . Maybe you’re not surprised after seeing that cosine function. But you don’t have to do any calculus. Instead, just drop a bunch of needles, count the number of crossings, and divide by the total number of needles. This ratio should be close to the probability of crossing . We can use this to find the value of pi. Some fools have actually dropped needles on their floor, but I'm just going to do a random-number simulation with Python. Here's what it looks like with 100 needles: In this simulation, 66 of the 100 needles crossed a line . Using this number, we get a value of pi at 3.0303—which is not 3.14—but it's not terrible for just 100 needles. With 30,000 needles, you might be accurate to six decimal places. Monte Carlo Calculations The idea of using random numbers to simulate things is quite useful, especially when the math is very complex or even impossible. This method was invented during the Manhattan Project in 1946 to model nuclear reactions, and it’s called a Monte Carlo calculation, after the famous casino there. Of course, this technique doesn’t really become useful until you start using computers, so you can run many, many trials. For example, suppose you want to model a gas as a bunch of balls colliding with the walls of a container. It's possible to use a large number of random balls in motion to calculate the average pressure on the walls. Why am I telling you this? Yes, that was a Monte Carlo simulation I did on my computer to estimate pi, even though I ran only 100 trials. But even if I dropped physical needles all over my floor, it would still in effect be a Monte Carlo estimation—or maybe a reverse Monte Carlo— because the position of a dropped needle is pretty much random. That’s right. Buffon’s needles are just an 18th-century method of generating random numbers in real life.

We have summarized this news so that you can read it quickly. If you are interested in the news, you can read the full text here. Read more:

WIRED /  🏆 555. in US

Physics Math Pi Pi Day Python Probability

 

United States Latest News, United States Headlines

Similar News:You can also read news stories similar to this one that we have collected from other news sources.

International court drops investigation into US sanctions on VenezuelaInternational court drops investigation into US sanctions on VenezuelaProsecutors at the International Criminal Court are dropping an investigation into whether U.S. sanctions against Venezuela qualified as crimes against humanity.
Read more »

Donald Trump Reacts to Iran Team Dropping Out of World CupDonald Trump Reacts to Iran Team Dropping Out of World CupTrump said Iran’s national soccer team was welcome at the World Cup but questioned whether it was safe for them to participate.
Read more »

Surging UFC Star Gets UFC Fight Night Main Event Booking After Jaw-Dropping KnockoutMelquizal Costa has been booked for his first UFC Fight Night main event against Arnold Allen after opening the year with a stunning knockout of Dan Ige.
Read more »

Rise Of The Tomb Raider Just Got A Jaw-Dropping Graphical OverhaulRise Of The Tomb Raider Just Got A Jaw-Dropping Graphical OverhaulBased in Wales, Angharad has five years of experience in games media.
Read more »

Apple reduces App Store fees in China to ward off regulatorsApple reduces App Store fees in China to ward off regulatorsCommission rates are dropping from 30 percent to 25 percent.
Read more »

Trump, 79, Fundraising Off Jaw-Dropping Show of DisrespectTrump, 79, Fundraising Off Jaw-Dropping Show of DisrespectThe president is now attempting to cash in on his war-dead disgrace.
Read more »



Render Time: 2026-04-01 05:20:17