computational probability
Monte Carlo Methods
You should know: law of large numbers
Overview
Monte Carlo methods are a broad class of computational algorithms that use repeated random sampling to estimate numerical quantities that are difficult or impossible to compute exactly, such as complex integrals, expectations, or probabilities. The core idea is to simulate a random process many times and use the sample average of the outcomes as an estimate of the true quantity, relying on the law of large numbers to guarantee that this average converges to the correct value as the number of simulations grows. The method takes its name from the Monte Carlo Casino, evoking the role of chance, and was formalized by Stanislaw Ulam and John von Neumann in the 1940s for nuclear physics calculations.
Intuition
Suppose you want to know the area of an oddly-shaped splatter of paint, but there's no formula for its boundary. One trick: throw darts randomly at a rectangle that contains the splatter, count what fraction land inside the splatter, and multiply that fraction by the rectangle's area. Throw enough darts and this estimate gets very accurate — that's the entire idea behind Monte Carlo methods. Instead of solving a hard problem analytically, you turn it into 'what fraction of random samples satisfy this property,' and let the law of large numbers guarantee that repeating the experiment enough times converges to the right answer.
Formal Definition
To estimate an expectation E[g(X)] using n independent samples X₁,...,Xₙ drawn from the distribution of X:
Worked Examples
The circle has area π(1)² = π, and the square has area 2×2=4, so the ratio of areas equals the fraction landing inside.
Solve for π using the observed fraction 785/1000 = 0.785.
Answer: π ≈ 3.14, close to the true value of 3.14159....
Practice Problems
In a dart-throwing simulation to estimate π, 900 out of 1200 darts land inside a unit circle inscribed in a 2×2 square. Estimate π.
A Monte Carlo estimate has σ=5. How many samples n are needed to reduce the standard error to 0.5?
A risky financial option's expected payoff is estimated via Monte Carlo simulation of 10,000 random price paths, giving a sample average payoff of $42 with sample standard deviation $200. Estimate the standard error of this Monte Carlo estimate.
Quiz
Summary
- Monte Carlo methods estimate hard-to-compute quantities via repeated random sampling and averaging.
- Convergence of the sample average to the true value is guaranteed by the law of large numbers.
- The estimate's standard error shrinks as σ/√n, so accuracy improves slowly (quadratically in cost) with more samples.
Mathematics