Courses / Mathematics I
Scientific Programming

Simulation and Monte Carlo Methods

Mathematics I 223 words Free to read

Computing with Randomness

Some problems resist exact solutions but can be estimated by random sampling. Monte Carlo methods use deliberate randomness: generate many random scenarios and use their statistics to approximate answers for integrals, areas, and probabilities.

ApplicationApproachFormula
Estimating π\piScatter points in a unit square containing a quarter-circleπ4points insidetotal points\pi \approx 4 \cdot \frac{\text{points inside}}{\text{total points}}
High-dimensional integralsBypass exponential grid growth using random samplesCost is independent of dimension count

Monte Carlo shines for high-dimensional integrals where grid-based methods fail entirely due to exponentially growing point requirements.

Convergence and Simulation

A Monte Carlo estimate's error shrinks as 1N\frac{1}{\sqrt{N}} with sample count NN. This means convergence is slow: gaining one more decimal digit of accuracy requires one hundred times more samples.

FeatureMonte Carlo Property
Convergence rateError proportional to 1N\frac{1}{\sqrt{N}}
Best used forQuick estimates and high-dimensional problems
Poor used forHigh-accuracy computations needing many digits
Common pitfall: Expecting estimates to improve quickly. Doubling samples only cuts error by 2\sqrt{2}, not in half.

Monte Carlo methods also simulate stochastic systems directly—such as particle diffusion or financial markets—by averaging many random trials.

The real spread of many repeats, not one run's wobble

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes

Scientific Programming