AP® Statistics · Unit 2 · Topic 2.3
Designing a Simulation
A simulation estimates a probability by imitating a random process many times and counting how often the event of interest happens, out of the total trials run.
Some probability questions are hard to solve with a formula but easy to act out. If you want the chance of a family of 4 kids having exactly 3 girls, you could do tricky counting with the binomial setup, or you could just flip a coin 4 times, call heads a girl, and repeat that over and over. The fraction of repetitions that give exactly 3 girls is your estimate. Simulation trades algebra for repetition, and it works because probability is, at its core, long-run relative frequency.
Designing one has four parts. First, assign a random device to match the real situation: a coin for a 50/50 event like boy/girl, a digit from a random number table for unequal chances, a die for 1-in-6 outcomes. Second, define exactly what one trial looks like: for the family question, one trial is 4 coin flips. Third, state clearly what counts as a success, such as exactly 3 heads in those 4 flips. Fourth, repeat the trial many times, independently, and record the results. The estimated probability is successes divided by total trials run.
This topic is the bridge between the two-way tables and basic probability rules you just learned and the binomial distribution coming next. Simulation gives you an approximate answer fast, without needing a formula, and it builds the intuition for why the binomial formula works the way it does. More trials make the estimate more reliable, which previews the law of large numbers and the idea of sampling variability that runs through the rest of the unit.
Key terms
- Trial
- One complete run of the simulated process, matching the real-world event being studied.
- Success
- The specific outcome being counted, clearly defined before the simulation is run.
- Relative frequency
- The fraction of trials in which the event of interest occurs, used as the probability estimate.
- Random number table
- A list of digits in random order used to simulate outcomes with unequal or many possible chances.
- Law of large numbers
- The principle that simulation estimates get closer to the true probability as the number of trials increases.
Watch it explained
- How it worksWalk me through designing a simulation for the chance of 3 girls in a family of 4.
- Worked exampleShow me a simulation of 100 trials estimating the chance of 7 heads in 10 flips.
- Worked exampleShow me a simulation of 500 trials estimating the chance of rolling doubles on two six-sided dice.
Check yourself
End of topic.