Author: Brian Benchoff / Source: Hackaday

Today is March 14th, or Pi Day because 3.14 is March 14th rendered in month.day
date format. A very slightly better way to celebrate the ratio of a circle’s circumference to its diameter is July 22nd, or 22/7 written in day/month
order, a fractional approximation of pi that’s been used for thousands of years and is a better fit than 3.
But Pi Day is completely wrong. We should be celebrating Tau Day, to celebrate the ratio of the circumference to the radius instead of the diameter. That’s June 28th, or 6.283185…. Nonetheless, today is Pi Day and in the absence of something truly new and insightful — we’re still waiting for someone to
This is our Pi Day article, but instead of complaining about date formats, or Tau, we’re going to do something different. This is how you approximate pi with the Monte Carlo method, and how anyone who can count to a million can get a better approximation of one the fundamental constants of the Universe than Archimedes.
What Is Monte Carlo?
Before we dig into this, it’s important to describe what the Monte Carlo method of problem solving actually is. In short, it’s measuring or simulating some sort of system with the application of random numbers. Any sufficiently complete history of Monte Carlo method of problem solving begins with Buffon’s needle problem, but this example muddles the issue, and came about two hundred years before this sort of randomness was applied to statistical insight.
The true origin of Monte Carlo simulations came from the development of the hydrogen bomb in the late 1940s. Stanislaw Ulam is credited with discovering this technique when investigating exactly how much neutron shielding would be needed in a certain application. The problem couldn’t be solved, but there was a probability distribution for this system. The key factors of the design were known — how far a neutron would travel through a medium, and how much energy would be given off when colliding with the nucleus of an atom. The solution to this problem was to simply throw random numbers at the problem, letting the known probability distribution take care of the rest.
Working through an example of the Monte Carlo method is a much better way of understanding, so let’s do that. This is how you approximate a value for pi using hundreds of thousands of random numbers.
So How Do We Estimate Pi?
What we’re doing here is drawing a circle, with a diameter of two (a radius of one). This is commonly known as a unit circle. This circle is inscribed into a square with a side length of two. We place hundreds of thousands of random points inside the square, count the total number of points placed and comparing that with the total number of points inside the circle. Because we’ve chosen a radius of one, and the area…
The post Archimedes Would Have Known Better If He Could Count To A Million appeared first on FeedBox.