Computing with Randomness
Some problems are too complex to solve exactly but can be estimated by random sampling. Monte Carlo methods use randomness deliberately: generate many random scenarios, and use their statistics to approximate an answer. Counterintuitively, injecting randomness solves deterministic problems — estimating integrals, areas, and probabilities that resist analytic attack.
The classic illustration estimates . Scatter random points uniformly in a unit square containing a quarter-circle of radius 1. The fraction landing inside the quarter-circle approximates its area, , so More points give a better estimate. Monte Carlo shines especially for high-dimensional integrals, where grid-based methods fail (a grid needs exponentially many points as dimensions grow, but Monte Carlo's cost does not).
The defining characteristic — and the crucial caveat — is convergence rate. A Monte Carlo estimate's error shrinks like with the number of samples . This is slow: to get one more decimal digit of accuracy (tenfold error reduction), you need one hundred times as many samples. So Monte Carlo gives quick rough answers but expensive precise ones — it is a tool for estimation, not high-accuracy computation.
Monte Carlo methods also simulate stochastic systems directly: modeling particle diffusion, financial-market scenarios, queueing systems, or the spread of a disease by playing out many random trials and averaging. Random sampling also underlies randomized algorithms and much of modern statistics and machine learning. Its power is turning an intractable exact problem into a tractable statistical estimate.
Common pitfall: expecting Monte Carlo estimates to be highly precise or to improve quickly with more samples. The error shrinks only as , so each additional decimal digit of accuracy costs 100 times more samples — Monte Carlo is inherently slow to converge. It is excellent for quick estimates and high-dimensional problems, but a poor choice when many accurate digits are needed; do not treat a Monte Carlo result as exact or assume doubling the samples halves the error (it only cuts it by ).