Lably
Skip to content

Monte Carlo method

Probabilistic problem-solving algorithm

  • 29 min read
  • 8 chapters

Related on Lably

Through Algorithm, Sampling (statistics) and Randomness

Monte Carlo methods are mainly used in three distinct problem classes: optimization, numerical integration, and non-uniform random variate generation, available for modeling phenomena with significant input uncertainties, e.g. risk assessments for nuclear power plants. Monte Carlo methods are often implemented using computer simulations. They can provide approximate solutions to problems too complex for mathematical analysis.

Overview

The name comes from the Monte Carlo Casino in Monaco, where the primary developer of the method, mathematician Stanisław Ulam, was inspired by his uncle's gambling habits. Monte Carlo methods are widely used in various fields of science, engineering, and mathematics, such as physics, chemistry, biology, statistics, artificial intelligence, finance, and cryptography. They have also been applied to social sciences, such as sociology, psychology, and political science. Monte Carlo methods have been recognized as one of the most important and influential ideas of the 20th century, and they have enabled many scientific and technological breakthroughs.

Monte Carlo methods also have some limitations and challenges, such as the trade-off between accuracy and computational cost, the curse of dimensionality, the reliability of random number generators, and the verification and validation of the results. Monte Carlo methods vary, but tend to follow a particular pattern:

  1. Define a domain of possible inputs.
  2. Generate inputs randomly from a probability distribution over the domain.
  3. Perform a deterministic computation of the outputs.
  4. Aggregate the results.

For example, consider a quadrant (circular sector) inscribed in a unit square. Given that the ratio of their areas is ⁠π/4⁠, the value of π can be approximated using the Monte Carlo method:

  1. Draw a square, then inscribe a quadrant within it.
  2. Uniformly scatter a given number of points over the square.
  3. Count the number of points inside the quadrant, i.e. having a distance from the origin of less than 1.
  4. The ratio of the inside-count and the total-sample-count is an estimate of the ratio of the two areas, ⁠π/4⁠. Multiply the result by 4 to estimate π.

In this procedure, the domain of inputs is the square that circumscribes the quadrant. One can generate random inputs by scattering grains over the square, then performing a computation on each input to test whether it falls within the quadrant. Aggregating the results yields our final result, the approximation of π. There are two important considerations:

  1. If the points are not uniformly distributed, the approximation will be poor.
  2. The approximation improves as more points are randomly placed in the whole square.

Uses of Monte Carlo methods require large amounts of random numbers, and their use benefitted greatly from pseudorandom number generators, which are far quicker to use than the tables of random numbers that had been previously employed.

Sign in to keep reading

7 more chapters are free with a Lably account.

More in Statistics and probability