AP Statistics · Topic 2.3 · Reading guide, about 5 min

Simulating chance and long-run frequency

Treat probability as long-run relative frequency, design a simulation, estimate a probability, and use the law of large numbers.

In one minute

Probability describes what happens in the long run when a chance process is repeated many times. If you cannot work out a probability by reasoning, you can often estimate it by imitating the process with random digits or technology and counting how often the event occurs.

This topic covers the vocabulary of chance, the steps of a simulation and one big idea, the law of large numbers, along with a common misunderstanding of it.

Key terms

Random process
A situation whose individual outcomes are uncertain but whose long-run pattern is predictable.
Outcome
One possible result of a single trial of a random process.
Event
A collection of outcomes, such as making at least two of three free throws.
Probability
A number from 0 to 1 giving the long-run relative frequency with which an event occurs.
Simulation
Using random digits or technology to imitate a random process over many trials and record what happens.
Trial
One complete run of the simulated process, such as three shots.
Empirical probability
An estimate of a probability found from the relative frequency of the event in observed or simulated data.
Law of large numbers
As the number of repetitions grows, the relative frequency of an event gets closer to its true probability.

Probability as long-run relative frequency

A probability of 0.25 does not say what happens next time; it says that over a very large number of repetitions about 25% of them will produce the event. Probabilities range from 0, an event that never happens, to 1, one that always happens.

If you have data from a process, the relative frequency of the event, the count of times it occurred divided by the number of trials, is an empirical estimate of its probability. A short run gives a rough estimate. A long run gives a better one.

The law of large numbers and a common trap

The law of large numbers says the relative frequency settles toward the true probability as trials accumulate. Flip a fair coin 10 times and you might see 7 heads, a relative frequency of 0.7. Flip it 1,000 times and the relative frequency will usually sit much closer to 0.5.

The trap is the so-called law of averages. After five tails in a row, the next flip is not "due" to be heads, because the coin has no memory. The proportion of heads moves toward 0.5 because new flips dilute the early streak, not because the future flips compensate for it. Probabilities describe the long run, not short-run balancing.

Designing a simulation

A simulation has five steps. First, state the process and the event of interest. Second, assign random digits or technology outcomes so that the chances match the real process. Third, define one trial and say how you will run it. Fourth, repeat many trials and record whether the event happened. Fifth, compute the relative frequency of the event as your estimate.

The assignment must match the probabilities. A 70% shooter can use digits 0 to 6 for a make and 7 to 9 for a miss, because 7 of the 10 equally likely digits is 70%. A one-in-six chance can use a die, or random digits 1 to 6 with 0, 7, 8 and 9 ignored: let 1 mean the event happens and 2 to 6 mean it does not. The more trials you run, the closer you can expect the estimate to be to the truth, though any one run can still miss the true value.

Matching random digits to probabilities
Probability to modelDigits that represent the eventDigits for the other outcome
70% chance of a make0 to 67 to 9
20% chance of rain0 and 12 to 9
Fair coinEven digits for headsOdd digits for tails

Worked example: three free throws

Invented question: a player makes 70% of free throws, and each shot is independent. What is the chance she makes at least two of three?

Setup: digits 0 through 6 mean a make and 7 through 9 mean a miss. One trial is three digits, one per shot. The event is at least two makes.

Trial 1 draws 4, 8, 2: make, miss, make, so 2 makes, event occurs. Trial 2 draws 9, 7, 1: miss, miss, make, so 1 make, event does not occur. Trial 3 draws 0, 3, 5: three makes, event occurs.

Suppose 50 trials are run and the event occurs in 38 of them. The estimate is 3850=0.76\frac{38}{50}=0.76.

How good is the estimate? Reasoning gives the exact value. Two makes in three shots has three arrangements, each with probability 0.7×0.7×0.3=0.1470.7\times 0.7\times 0.3=0.147, so 3×0.147=0.4413\times 0.147=0.441. Three makes has probability 0.73=0.3430.7^3=0.343. The total is 0.441+0.343=0.7840.441+0.343=0.784. The estimate of 0.76 is close but not equal, which is expected with 50 trials. With 5,000 trials it would likely be within a percentage point or two of 0.784.

How it connects

  • Back to 1.11: random digits and random number generators are the same tools used to pick random samples.
  • Forward to 2.4: probabilities of events and complements can be worked out exactly instead of simulated.
  • Forward to 2.12: sampling distributions are often explored with simulated samples.
  • Forward to 3.6: a p-value can be estimated by simulating what would happen if the null hypothesis were true.

Common mistakes

  • Believing a streak must even out soon. The coin has no memory; the long-run proportion converges only because new trials dilute the streak.
  • Assigning digits that do not match the probability. Count the digits: 7 of 10 digits represents 70%.
  • Treating a simulation as exact. It is an estimate that varies from run to run; more trials usually bring it closer to the true probability, but no run is guaranteed to hit it exactly.
  • Describing a trial incompletely. State how many digits one trial uses and what counts as success.

How it shows up on the exam

  • You are asked to describe a simulation, covering the digit assignment, one trial, the number of repetitions and how to find the estimate.
  • Simulated results are shown and you use them to estimate a probability.
  • A short explanation question asks what the law of large numbers does and does not say.

Check yourself

  1. Why does 'probability 0.3' not tell you what will happen on the next trial?
  2. How would you assign digits to simulate a 40% chance?
  3. Why does a bigger number of trials usually give a better estimate?
  4. After seven heads in a row, what is the probability of heads on the next flip of a fair coin?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.