Estimating Probabilities with Simulation
What a random process, an outcome, and an event are, why probability means long-run relative frequency, how to design and run a simulation, and why more trials give a better estimate.
The probability of an event is how often it happens in the long run, over a very large number of repetitions. You rarely get to watch the long run in real life, but you can imitate the random process with random digits or a calculator, repeat it many times, and use the relative frequency of the event as an estimate of its probability. That is a simulation.
1Random processes, outcomes, events
| Term | Meaning | Free-throw example |
|---|---|---|
| Random process | Produces results determined by chance | Shooting 5 free throws |
| Outcome | The result of one trial of the random process | make, miss, make, make, make |
| Event | A collection of outcomes | “at least 2 misses” |
| Probability of an event | Its long-run relative frequency | About 0.47 for at least 2 misses by a 70% shooter |
A free throw
A basketball player shoots 5 free throws. Identify the random process, one outcome, and one event.
- 1The random process is shooting 5 free throws: the result of each shot is determined by chance.
- 2An outcome is the result of one trial of the process, for example make, make, miss, make, miss.
- 3An event is a collection of outcomes, for example “misses at least 2 shots,” which includes make, make, miss, make, miss and many other outcomes.
2Probability in the long run
The probability of an outcome or event is its long-run relative frequency: the proportion of times it happens over a very large number of trials. Saying a player makes 70% of free throws does not mean 7 of every 10; it means that over many, many shots the proportion made gets close to 0.70.
The law of large numbers says that for independent trials, as the number of trials increases, the relative frequency of an outcome gets closer and closer to a single value: its probability. It is a statement about the long run only. It says nothing about what happens on the next shot.
After five misses in a row, a 70% shooter is not more likely to make the next shot to “catch up.” Independent trials have no memory. The long-run proportion settles near 0.70 because the early streak gets swamped by thousands of later shots, not because later shots correct it.
3Designing a simulation
A simulation models a random process so that the simulated outcomes match the real-world chances. Every possible outcome is linked to a value that is determined by chance, such as a random digit. Then you record the counts of simulated outcomes and the total number of trials.
The assignment is where simulations most often go wrong. To model a probability of 0.70 with single digits, use 7 of the 10 digits for a make. To model 0.73, you need pairs of digits: 00 to 72 for a make (73 of the 100 pairs) and 73 to 99 for a miss.
Using digits 0–6 to mean “make” gives a probability of 0.7, not 0.6, because 0 through 6 is seven digits. Count the digits you assigned and check that their share equals the probability you are modeling.
4Running the simulation
Ten trials by hand
Use digits 0–6 for a make and 7–9 for a miss. Read the row of random digits below in groups of 5, one group per trial, and estimate the probability of missing at least 2 of 5 shots.
65326 94846 90307 22524 99019 06431 57280 11220 45390 99260
- 1Each group of 5 digits is one trial of 5 shots. Count the 7s, 8s and 9s in each group: those are misses.
- 2Misses in the 10 trials: 0, 2, 2, 0, 3, 0, 2, 0, 1, 2.
- 3Trials with at least 2 misses: 5 of the 10.
- 4Estimate: \(5 \div 10 = 0.5\).
Read the dotplot
Use the 100 simulated trials in Figure 3. Estimate the probability that the 70% shooter misses at least 2 of 5 free throws.
- 1Count the trials in the event: the dots at 2, 3, 4 and 5 misses.
- 2There are 47 such trials out of 100.
- 3The estimated probability is \(47 \div 100 = 0.47\).
MATH, PRB, randInt(0, 9, 5) gives five random digits at once, one simulated trial of 5 shots. Or use randInt(1, 10, 5) and call 1–7 a make. Press ENTER for each new trial and keep a tally.
Guessing on a quiz
A quiz has 5 true-or-false questions. A student guesses on every one. Describe a simulation to estimate the probability of getting at least 4 correct.
- 1Assign: each guess is correct with probability 0.5. Let 1 mean correct and 0 mean wrong.
- 2One trial: randInt(0, 1, 5) gives five 0s and 1s, one per question. Record the number of 1s.
- 3Repeat for at least 100 trials, recording whether each trial had 4 or 5 ones.
- 4Estimate the probability by the number of trials with at least 4 correct, divided by the number of trials.
Ten trials gave one estimate; another ten would likely give a different one. An estimate from a simulation is only as steady as the number of trials behind it. Run enough trials (hundreds, if possible) and say the result is an estimate.
“In 100 simulated sets of 5 free throws, the shooter missed at least 2 shots in 47 of them. So we estimate the probability of missing at least 2 of 5 to be about 0.47.”
5Estimates from real data
The relative frequency of an event in real observed data can also estimate its true probability. The more observations, the better the estimate, for the same reason a longer simulation gives a better estimate.
A late bus
Over the last 400 school days, the morning bus arrived more than 10 minutes late on 52 days. Estimate the probability that the bus is that late on a given day.
- 1Relative frequency from real data, also called an empirical estimate: \(52 \div 400 = 0.13\).
- 2It is an estimate of the true probability, and 400 days is a long enough record to make it fairly trustworthy, if conditions have not changed.
0.13 is the proportion of late days in the last 400. The true probability might be 0.12 or 0.14. Write “estimated probability” or “about,” and say what the estimate is based on.
Quick reference
| Step | What to write |
|---|---|
| Assign | Which random digits or numbers stand for which outcomes, matching the probabilities |
| Trial | What one trial is and what you record from it |
| Repeat | How many trials (many) |
| Estimate | Number of trials with the event ÷ number of trials |
| Conclude | State the estimated probability in context |