Monte Carlo methods approximate a quantity by averaging results from simulated random inputs. They are useful when direct calculation is difficult, but a simulation does not make its model true. This guide uses a simple hypothetical integral with a known answer so that the numerical approximation can be checked independently. No actual simulation output or empirical performance is claimed.
Specify the numerical target before generating draws
Let U be uniformly distributed between zero and one, and let the target be E(U²). Elementary integration gives an exact value of one third. A Monte Carlo approximation draws M independent values from that stated distribution, squares each value and averages the squares. The University of British Columbia lesson on Monte Carlo integration describes approximating expectations with simulations. The target is an average under a specified distribution, not the average of an arbitrary collection of numbers that happen to lie between zero and one.
Separate the random sample from its expectation
Write the approximation as the sum of U₁² through Uₘ² divided by M. Different simulated samples can give different answers even when they use the same distribution and number of draws. Under the stated independent, identical sampling model, the approximation has expectation one third. That property is called unbiasedness here; it does not mean each run equals one third or that every implementation generates the intended inputs. A programming error, incorrect distribution or omitted transformation can introduce discrepancies that more repetitions will not repair.
Calculate theoretical Monte Carlo standard errors
| Draws M | Variance of each U² | Variance of average | Monte Carlo standard error |
|---|---|---|---|
| 100 | 4/45 | 4/4,500 | 0.02981 |
| 1,000 | 4/45 | 4/45,000 | 0.00943 |
| 10,000 | 4/45 | 4/450,000 | 0.00298 |
| 100,000 | 4/45 | 4/4,500,000 | 0.00094 |
Because E(U⁴)=1/5 and E(U²)=1/3, the individual variance is 1/5−1/9=4/45. Independence makes the average variance 4/(45M). The square root gives the displayed standard errors. These values describe repeated-run dispersion under the model, not a guaranteed maximum absolute error for an individual run.
Understand the square-root rate
The MIT introduction to the weak law of large numbers explains why averages concentrate under suitable assumptions. Here multiplying the draw count by one hundred reduces the standard error by ten, not by one hundred. The Carnegie Mellon treatment of deviation bounds makes the moment assumptions behind such reasoning explicit. A rate statement must specify the estimator and dependence structure. It cannot automatically be transferred to correlated draws, unstable importance weights or quantities whose relevant variance does not exist.
Estimate error when the variance is unknown
For independent draws with finite variance, the sample standard deviation of the transformed values divided by the square root of M provides an estimated Monte Carlo standard error. This estimates repeated-run spread; it is not itself a confidence level. A confidence interval additionally requires a justified distributional approximation or another suitable method. Record which quantity supplied the standard deviation: the transformed values whose mean is being estimated, rather than the original inputs when the transformation changes their variability. That distinction is essential in the squared-input example.
Keep reproducibility separate from accuracy
Record the random-number method, relevant software version, seed where applicable, draw count and transformation. A seed can help reproduce a sequence in a specified environment, but it does not certify the distribution or establish that the numerical error is small. Repeating an identical computation checks reproducibility. Running independent replications can reveal variability, while comparison with the known one-third answer checks this particular implementation. None of these tests demonstrates that an unrelated real-world process follows a uniform model. Document numerical checks and substantive assumptions separately.
Recognise rare-event and model limitations
A simulation that observes zero occurrences of an event has not established that the event has probability zero. A rare event may simply be absent from a finite run. Likewise, simulating a precisely specified model millions of times can produce a very precise answer to a poorly specified question. Uncertainty about parameters, missing mechanisms or the target population remains distinct from Monte Carlo error conditional on the chosen model. Report both layers when relevant, and avoid using a large iteration count as a substitute for evidence supporting the model.
Simulation checklist
- Define the expectation or probability being approximated.
- State the input distribution and independence assumptions.
- Record transformations and the draw count.
- Calculate or estimate an appropriate Monte Carlo error scale.
- Keep seed and environment information for reproduction.
- Check against a known answer when one exists.
- Separate numerical uncertainty from model uncertainty.
For this example, retain both the exact target and the approximation in the result record. A discrepancy should trigger inspection of the code, random inputs and expected error scale before any conclusion is drawn. The point of the exercise is transparent numerical reasoning, not an assurance that simulation can predict individual uncertain outcomes.
Frequently asked questions
Does a fixed seed make a result accurate?
No. It can make a specified computation reproducible, while accuracy still depends on the algorithm, draw count and model.
Does one hundred times as many independent draws give one hundred times less standard error?
In this finite-variance mean example it gives ten times less standard error, because the rate is proportional to the inverse square root of the draw count.
Does observing no rare events prove their probability is zero?
No. A finite simulation can miss events with positive probability, especially when their expected count is small.
Sources and verification
- Simple Monte Carlo, STAT 405 — University of British Columbia course materials — 2026-10-23
- Weak law of large numbers lecture introduction — MIT OpenCourseWare — 2026-10-23
- Deviation bounds and the law of large numbers — Carnegie Mellon University — 2026-10-23