By Taari Chandaria, Year 12
Bedridden in Los Alamos, Polish Physicist Stanislaw Ulam sat bored playing solitaires, wondering, like a true mathematician, of his probability of producing a winning hand given a set amount of cards. After trying various combinatorial calculations, Ulam discovered a more practical method: laying out, say, one hundred plays and counting the number of successful ones. With the beginning of the era of fast computers, Ulam immediately saw multiple applications of such an approach to problem solving, including his work with neutron diffusion at the Los Alamos National Laboratory. Given the highly secretive nature of the work at Los Alamos, the approach needed a code name. Inspired by his gambler Uncle, Ulam and his colleagues settled on the name Monte Carlo.
The essence of the Monte Carlo method lies in leveraging the power of randomness on a large scale through the law of large numbers. In probability theory, the law of large numbers states that with more and more repetitions of a measurement, the average value approaches the expected value. For example, if we flip a coin four times, we could get 3 heads and 1 tail, implying a probability of 75% for heads, when the expected probability is 50%. However, as we flip the coin more and more times, we get closer to an even number of heads and tails. The Monte Carlo method relies on sampling a large number of random trials, and using the results to compute a desired value.
Monte Carlo methods run as such: first, one must identify the domain of possible inputs(step 1); next, inputs are generated randomly over the domain(step 2); finally, calculations are performed on the input to get a meaningful result(step 3). This is best explained by using the method to calculate pi, an age-old problem. Calculating pi by typical mathematical methods is extremely difficult and time consuming. Monte Carlo methods provide a simple and easy way to approximate pi to a high degree of accuracy. Take a circle inscribed in a square, as shown below(step 1). Using a computer we can randomly place a large number of different points within the square, either contained by or outside the circle(step 2). We then count the number of points within the circle and the total number of points. The number of total points within the circle divided by the total number of points is clearly proportional to the ratio of their two areas(since the distribution is random and generally uniform). Given that the area of a circle is πr^2 and the area of the square is 2r*2r=4r^2, dividing the area of the circle by that of the square gives us π/4, so we can multiply by four to get the value of pi(step 3). We thus get an extremely simple method to compute pi, which gives incredibly accurate results. The power of Monte Carlo methods is clear: when a problem proves too difficult to solve by traditional methods, we can always resort to this “brute force” approach.
In the real world, situations in which problems are too difficult to solve by hand come up all too frequently, and with the exponentially increasing power of computers, Monte Carlo methods have found an array of useful applications. The infamous difficulties of integration can be bypassed using Monte Carlo methods(in a similar way to with the circle). Monte Carlo methods are a key part of computational physics as well. At the highest levels, equations in physics, such as Einstein’s field equations for gravity or the Navier-stokes equations for fluid dynamics, are extremely difficult to solve, and often do not even have analytical(“by hand”) solutions. Instead, computers approach these problems the other way around, “guessing” values with many random values until a pattern can be observed from which solutions can be approximated. Monte Carlo methods in physics are used to predict things such as the weather, the behaviour of molecules, and galaxy evolution. Monte Carlo methods are also used in Computer Science, through for example path tracing, where a 3D scene is rendered through the random tracing of many possible pathways of light, delivering one of the most accurate 3D graphics rendering methods. Monte Carlo methods are even used in finance, to perform calculations such as options pricing and risk analysis.
Overall, the power of Monte Carlo methods is clear. Through leveraging the power of computers and the law of large numbers, we arrive at a method which can bypass the complexities of certain problems, all while delivering incredibly accurate results. Though this article only scratched the surface of how the Monte Carlo method works, I hope it is enough to understand its power.