Simulation for Probability
Simulation is a powerful technique in probability that lets us estimate the likelihood of events by repeating a random experiment many times — either physically or, more often, using a computer or random-number tools — and recording what happens. Instead of computing a probability analytically from a formula, we let chance play out thousands or even millions of times and use the relative frequency of outcomes as our probability estimate. This approach is especially valuable when the exact mathematical calculation is complicated or even impossible to perform by hand. The theoretical foundation is the Law of Large Numbers: as the number of trials n grows toward infinity, the observed relative frequency of an event converges to its true probability. In practice, even a few hundred simulated trials can give a surprisingly good approximation, and a few thousand trials typically produce estimates accurate to two decimal places. Simulation therefore bridges the gap between abstract probability theory and real-world decision-making in fields such as medicine, engineering, finance, and game design. At the high-school level, simulations are conducted using physical tools (coins, dice, spinners, random-number tables) or technology (graphing calculators, spreadsheets, and programming environments). Understanding how to design a valid simulation — mapping outcomes to random devices, running enough trials, and interpreting results — is a core skill in statistics and probability. This article walks through the key ideas, a step-by-step process, and a fully worked example.
- Identify the random event and its true probability (if known)
- Choose a random device and assign outcomes
- Define one trial
- Run a large number of trials and record results
- Calculate the estimated probability
- Interpret and communicate results
Identify the random event and its true probability (if known)
Clearly state what event you are simulating and, if calculable, its theoretical probability P(E). For example, if you want to estimate the probability of getting at least one 6 in three rolls of a fair die, the theoretical value is 1 − (5/6)³ ≈ 0.421. Knowing the theoretical value lets you check how accurate your simulation turns out to be.
Choose a random device and assign outcomes
Select a tool whose outcomes are equally likely (or match the given probabilities) and map each outcome to the event you are studying. For a fair coin, heads = success and tails = failure works for any event with P = 0.5. For a probability of 1/6, assign one face of a die. For a probability of 0.3, assign digits 0–2 (success) and 3–9 (failure) from a random-digit table or random-integer generator from 0 to 9.
Define one trial
A trial represents one complete run of the scenario you are modeling. If the question asks about flipping a coin 10 times and counting heads, one trial consists of 10 simulated flips. Each trial produces a single result (e.g., 'success' or 'failure', or a count). Write down exactly what constitutes a trial before you start, so your simulation is consistent.
Run a large number of trials and record results
Perform n trials, typically at least 100 for simple estimates. Record whether each trial meets the event criterion. Using technology, you can easily run n = 1000 or n = 10000 trials. For example, in a spreadsheet you might use =RANDBETWEEN(1,6) to simulate die rolls, copy it across 3 columns and down 1000 rows, then use a formula to count rows where at least one cell equals 6.
Calculate the estimated probability
Divide the number of trials in which the event occurred by the total number of trials. This relative frequency is your simulated probability estimate: P̂(E) = (number of favorable trials) / n. As n increases, P̂(E) should stabilize near the true probability P(E). Report your estimate and, if possible, compare it to the theoretical value to evaluate simulation accuracy.
Interpret and communicate results
Always state your estimate in context: 'Based on 1000 simulated trials, we estimate the probability of getting at least one 6 in three rolls is approximately 0.418, which is close to the theoretical value of 0.421.' Acknowledge that because simulation is random, a different run of the same simulation will give a slightly different answer. More trials reduce this variability.
The Key Equation
- \hat{P}(E) — Estimated probability (dimensionless (0 to 1)): The relative frequency of event E observed across all simulated trials; serves as our approximation of the true probability.
- f — Favorable trial count (count (whole number)): The number of trials in which the event E was observed to occur.
- n — Total number of trials (count (whole number)): The total number of times the simulation was run. Larger n gives a more reliable estimate.
Worked Example
Problem. A basketball player makes 70% of her free throws. Use a simulation with random digits to estimate the probability that she makes at least 4 out of 5 consecutive free throws. Run 20 trials by hand using the random-digit line: 8 1 6 3 5 4 9 2 0 7 3 1 8 6 5 2 4 9 0 7 5 1 6 3 8 4 0 2 9 7 6 8 1 5 3 0 4 7 2 9 8 6 0 3 5 1 7 4 2 9 6 3 8 0 5 7 1 4 2 9 3 8 6 0 5 1 7 4 2 9 8 5 0 3 6 1 7 4 2 9 3 0 8 6 5 1 7 4 2 9 6 8 0 3 5 7 1 4 2 9
Answer. Estimated probability ≈ 0.50 (theoretical value ≈ 0.528); the simulation is a reasonable approximation that would improve with more trials.
Origins · 1 minStanislaw Ulam and how this was discovered
Ulam co-invented the Monte Carlo method in the late 1940s while working at Los Alamos National Laboratory. Together with John von Neumann and Nicholas Metropolis, he developed systematic simulation techniques for estimating probabilities and solving mathematical problems that were analytically intractable. The name 'Monte Carlo' was chosen as a code name referencing the famous casino in Monaco, reflecting the method's reliance on random sampling. Monte Carlo simulation is now one of the most widely used computational tools in science, engineering, and finance. Ulam reportedly conceived the Monte Carlo idea while playing solitaire during a bout of illness, wondering what fraction of solitaire games were winnable — and realizing the best way to find out was simply to play many games and count.
Related Concepts
- Law of Large Numbers — The Law of Large Numbers is the theoretical guarantee that simulated relative frequencies converge to true probabilities as the number of trials grows, making it the mathematical backbone of all probability simulation.
- Relative Frequency as Probability — Simulation estimates probability through relative frequency — counting how often an event occurs divided by total trials — so understanding relative frequency is essential to interpreting simulation results.
- Binomial Distribution — Many simulation problems (like repeated free throws or coin flips) model scenarios whose theoretical probabilities come from the binomial distribution, allowing direct comparison of simulated and exact answers.
- Random Sampling — Simulation relies on generating random samples to represent chance events; understanding how to obtain and use random samples is a prerequisite skill for designing valid simulations.