Random Sampling as Computation
Monte Carlo methods turn randomness into a computational tool. The core idea is deceptively simple: if you can frame a quantity as an expected value, you can estimate it by averaging random samples. Stanislaw Ulam conceived this approach while playing solitaire during the Manhattan Project — he realized that random deal simulations could estimate probabilities faster than combinatorial analysis. Today Monte Carlo drives financial derivatives pricing, particle physics simulations, and Bayesian inference.
Estimating Pi Geometrically
The classic demonstration inscribes a unit circle in a square. Points thrown uniformly at random land inside the circle with probability equal to the area ratio: π/4. Count the hits, multiply by 4, and you have a π estimate. This simulation shows each point — red for misses, cyan for hits — and updates the running estimate in real time. Watch the scatter plot fill in and the estimate converge toward 3.14159...
The 1/√N Convergence
Monte Carlo's convergence rate of 1/√N seems slow — 10,000 samples give only two decimal places of π. But this rate is dimension-independent. For a 100-dimensional integral, a grid with 10 points per dimension needs 10^100 evaluations; Monte Carlo still needs only 1/ε² samples regardless of dimension. This 'curse of dimensionality' immunity makes Monte Carlo indispensable for high-dimensional problems in physics, finance, and machine learning.
Beyond Naive Sampling
Variance reduction techniques turbocharge basic Monte Carlo. Stratified sampling partitions the domain to ensure even coverage; importance sampling concentrates effort where the integrand is large; antithetic variates exploit symmetry to reduce variance by half. These methods — visible in the convergence plot as faster error decay — are the bridge between textbook Monte Carlo and production-grade simulation systems used in quantitative finance and particle transport.