Monte Carlo Method — Definition, Formula & Examples
The Monte Carlo method is a technique that uses repeated random sampling to estimate a quantity that may be difficult or impossible to calculate exactly. By running many random simulations and averaging the results, you converge on an accurate approximation.
A Monte Carlo method is a computational algorithm that relies on generating a large number of independent, identically distributed random samples from a specified probability distribution, then computing a sample statistic (such as the mean) to approximate an expected value, integral, or other deterministic quantity. By the law of large numbers, this estimator converges to the true value as the number of samples .
Key Formula
Where:
- = Monte Carlo estimate of the true quantity θ
- = Number of random samples
- = The i-th random sample drawn from the chosen distribution
- = Function evaluated at each sample point
How It Works
You define the problem in terms of a quantity that can be expressed as an expected value or integral. Then you generate a large number of random samples according to an appropriate probability distribution. For each sample, you evaluate the function of interest. Finally, you average all the results to produce your estimate. The accuracy improves roughly in proportion to , where is the number of samples, so quadrupling the samples cuts the error in half.
Worked Example
Problem: Estimate the value of π using a Monte Carlo simulation with 10,000 random points in a unit square.
Step 1: Generate 10,000 random points where each coordinate is drawn uniformly from .
Step 2: For each point, check whether it falls inside the quarter-circle of radius 1 centered at the origin. Count the number of points satisfying the condition.
Step 3: The ratio of points inside the quarter-circle to total points estimates the area of the quarter-circle, which is π/4. Multiply by 4 to estimate π. Suppose 7,856 of 10,000 points landed inside.
Answer: The Monte Carlo estimate of π from this run is approximately 3.1424, close to the true value of 3.14159...
Why It Matters
Monte Carlo methods are essential in finance for pricing complex derivatives, in physics for simulating particle interactions, and in Bayesian statistics for sampling from posterior distributions (via MCMC). Whenever a closed-form solution is unavailable, Monte Carlo provides a practical path to an answer.
Common Mistakes
Mistake: Assuming more samples always dramatically improve accuracy.
Correction: The standard error decreases as . Going from 1,000 to 10,000 samples only reduces the error by a factor of about 3.16, not 10. Plan sample sizes accordingly.
