AP Statistics · Study guide

Run it many times.

AP® Statistics · Unit 2 · Probability, Random Variables, and Probability Distributions

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 idea in one paragraph

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

TermMeaningFree-throw example
Random processProduces results determined by chanceShooting 5 free throws
OutcomeThe result of one trial of the random processmake, miss, make, make, make
EventA collection of outcomes“at least 2 misses”
Probability of an eventIts long-run relative frequencyAbout 0.47 for at least 2 misses by a 70% shooter
Worked Example 1 Name the pieces

A free throw

A basketball player shoots 5 free throws. Identify the random process, one outcome, and one event.

  1. 1The random process is shooting 5 free throws: the result of each shot is determined by chance.
  2. 2An outcome is the result of one trial of the process, for example make, make, miss, make, miss.
  3. 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.
Answer: Process: shooting 5 free throws. Outcome: one particular sequence of makes and misses. Event: a set of outcomes, such as missing at least 2.

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.

Figure 1. After a few shots the proportion made can be far from 0.70, because a short run is mostly luck. As the number of shots grows, the proportion settles closer and closer to 0.70. That is the law of large numbers.

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.

Common Mistake 1 · Thinking a result is “due”

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.

Figure 2. A simulation imitates the random process with something you can run quickly: random digits, a calculator, or a computer. The assignment in step 1 must match the real probabilities.

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.

Common Mistake 2 · An assignment that does not match the probability

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

Worked Example 2 Carry out trials from random digits

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

  1. 1Each group of 5 digits is one trial of 5 shots. Count the 7s, 8s and 9s in each group: those are misses.
  2. 2Misses in the 10 trials: 0, 2, 2, 0, 3, 0, 2, 0, 1, 2.
  3. 3Trials with at least 2 misses: 5 of the 10.
  4. 4Estimate: \(5 \div 10 = 0.5\).
Answer: With only 10 trials the estimate is 0.5. Ten trials is far too few to trust; more trials give a steadier estimate.
Figure 3. Each dot is one simulated set of 5 shots. The highlighted trials had 2 or more misses, so the estimated probability is 47 ÷ 100 = 0.47.
Worked Example 3 Use many simulated trials

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.

  1. 1Count the trials in the event: the dots at 2, 3, 4 and 5 misses.
  2. 2There are 47 such trials out of 100.
  3. 3The estimated probability is \(47 \div 100 = 0.47\).
Answer: About 0.47. A shooter who makes 70% of free throws misses at least 2 of 5 roughly 47% of the time in this simulation. (Run thousands of trials and the estimate settles near 0.47.)
On the calculator

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.

Worked Example 4 Design a simulation with a calculator

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.

  1. 1Assign: each guess is correct with probability 0.5. Let 1 mean correct and 0 mean wrong.
  2. 2One trial: randInt(0, 1, 5) gives five 0s and 1s, one per question. Record the number of 1s.
  3. 3Repeat for at least 100 trials, recording whether each trial had 4 or 5 ones.
  4. 4Estimate the probability by the number of trials with at least 4 correct, divided by the number of trials.
Answer: Simulate five 0/1 digits per trial, count trials with at least four 1s, and divide by the number of trials. With many trials the estimate settles near 0.19.
Common Mistake 3 · Trusting a handful 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.

Say it like this

“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.

Worked Example 5 Estimate from real data

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.

  1. 1Relative frequency from real data, also called an empirical estimate: \(52 \div 400 = 0.13\).
  2. 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.
Answer: About 0.13. Based on the past 400 days, the bus is more than 10 minutes late on about 13% of school days.
Common Mistake 4 · Calling an estimate exact

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

StepWhat to write
AssignWhich random digits or numbers stand for which outcomes, matching the probabilities
TrialWhat one trial is and what you record from it
RepeatHow many trials (many)
EstimateNumber of trials with the event ÷ number of trials
ConcludeState the estimated probability in context