Simulation for
Probability
Learn how to use random simulations to estimate probabilities when theoretical calculations are complex or impossible.
What Is a Simulation?
A simulation is a method that uses random number generation to imitate a real-world process or experiment many times. Instead of computing a probability with formulas, we run the experiment thousands of times and observe how often the event of interest occurs.
Why Use Simulation?
Key Vocabulary
The Law of Large Numbers
The mathematical foundation of simulation: as the number of trials \( n \to \infty \), the relative frequency of an event converges to its true probability.
Formal Estimation Framework
Given a random experiment with event \( A \):
The margin of error for a simulation-based proportion estimate with \( n \) trials is approximately:
Simulation vs. Theoretical
| Simulation | Theoretical | |
|---|---|---|
| Approach | Run experiment many times | Apply formulas / counting rules |
| Result type | Estimate (approximation) | Exact value |
| When useful | Complex or no formula available | Simple, well-defined sample spaces |
| Precision | Improves with more trials | Always exact |
| Requires | Random number generator | Mathematical derivation |
How to Design a Simulation
Choosing a Random Device
The random device must match the real-world probabilities. Common mappings:
Example 1: Coin Flips
Problem: Estimate the probability of getting exactly 3 heads in 5 fair coin flips.
Example 2: Free Throw Streaks
Problem: A basketball player makes 75% of free throws. Estimate the probability she makes at least 8 out of 10 free throws.
Example 3: The Birthday Problem
Problem: In a room of 23 people, what is the probability that at least two share a birthday? This is famously counterintuitive: simulation makes it tangible.
Visualizing Simulation Results
After running a simulation, we build a histogram of the response variable to see the distribution. Below: results of simulating "number of heads in 10 fair coin flips" for \( n = 5{,}000 \) trials.
Using a Random Digit Table
On the AP exam, you may be given a random digit table and asked to carry out a simulation by hand. Here is a sample row:
How Many Trials Are Enough?
More trials means a more precise estimate. The relationship between \( n \) and precision:
| Trials \( n \) | Margin of Error \( \approx 1/\sqrt{n} \) | Reliability |
|---|---|---|
| 100 | \( \approx 0.10 \) | Rough sketch |
| 1,000 | \( \approx 0.032 \) | Reasonable estimate |
| 10,000 | \( \approx 0.01 \) | High precision |
| 100,000 | \( \approx 0.003 \) | Very high precision |
Common Mistakes
Question 1 of 5
A student simulates 2,000 trials of an experiment and finds that the event of interest occurred 460 times. What is the estimated probability of the event?
Question 2 of 5
A simulation uses random digits 0-9 to model a spinner where the probability of landing on "blue" is 0.4. Which digit assignment correctly models "blue"?
Question 3 of 5
To reduce the margin of error of a simulation estimate from 0.05 to 0.025, how should you change the number of trials?
Question 4 of 5
In a simulation of rolling two dice 5,000 times, 832 rolls had a sum of 7. Which is closest to the theoretical probability of rolling a sum of 7?
Question 5 of 5
Which statement best explains why simulation is used instead of theoretical probability?