Tutorials › AP Statistics › The Law of Large Numbers in Simulations

Estimating probability by simulation · Tutorial 202 of 1000

The Law of Large Numbers in Simulations

See how the Law of Large Numbers explains the changing relative frequency of sixes in short and long die-roll simulations.

Beginner 9 min read

What You'll Learn

  • State the Law of Large Numbers for repeated trials with the same event probability.
  • Calculate and compare the relative frequency of sixes with the die’s model probability.
  • Explain why short simulation runs can give very different proportions.
  • Track cumulative relative frequency and understand why it need not improve on every roll.
  • Distinguish a stable long-run proportion from an exact guarantee for any particular run.

What Happens to a Relative Frequency as Trials Accumulate?

In What Is a Probability Simulation, you used repeated chance outcomes to estimate a model probability. Now we will examine what tends to happen as the number of trials grows. We will use a simulated roll of a fair six-sided die and track the proportion of rolls that show a six.

The model probability of rolling a six on one roll is \(1/6\), or approximately \(0.1667\). A short sequence might contain many sixes, or none at all. As more rolls are added, however, the relative frequency of sixes tends to settle near \(1/6\). This long-run tendency is called the Law of Large Numbers.

Definition: The Law of Large Numbers says that as the number of repeated, independent trials with the same probability of an event increases, the event’s relative frequency tends to get closer to its probability in the model. It describes a long-run tendency, not a guarantee about every particular run.

For the die simulation, a trial is one roll, and the event of interest is rolling a six. After \(n\) rolls, the relative frequency is the number of sixes divided by \(n\). The model probability remains \(1/6\) throughout; it is the relative frequency from the simulation that changes as rolls are added.

$$ \text{Relative frequency of sixes} = \frac{\text{number of sixes observed}}{\text{number of rolls}} $$

The law depends on modeling repeated trials with the same chance of success. Here, each roll is assumed to be independent of the others, and the die is fair, so each roll has probability \(1/6\) of showing a six. A simulation that does not represent those assumptions would not illustrate this model’s long-run behavior.

A Cumulative Simulation: Proportion, Not Count

Consider one possible simulated sequence of fair-die rolls. The table shows cumulative counts from that same sequence, not separate simulations. The results are invented for illustration. Each relative frequency is calculated from the total number of rolls up to that row.

Cumulative number of rollsCumulative number of sixesRelative frequency of sixes
104\(4/10 = 0.4000\)
509\(9/50 = 0.1800\)
50082\(82/500 = 0.1640\)
5,000831\(831/5{,}000 = 0.1662\)

The first 10 rolls include 4 sixes, giving a relative frequency of \(0.4000\), well above \(1/6 \approx 0.1667\). By 50 rolls, the relative frequency is \(0.1800\). After 500 rolls it is \(0.1640\), and after 5,000 it is \(0.1662\). In this particular simulation, the longer-run proportions are closer to the model probability.

The number of sixes keeps increasing as rolls are added: it rises from 4 to 9 to 82 to 831. That increase alone does not show whether the estimate is improving. The quantity to compare with \(1/6\) is the proportion of sixes, because the model probability describes a proportion, not a count.

The relative frequency need not move closer to \(1/6\) with each new roll. It might be close to \(1/6\) at one point and move farther away after a run of sixes or a run without sixes. The Law of Large Numbers concerns the tendency over many trials, not a step-by-step rule.

Worked Example: Interpreting a Short Run of Die Rolls

A student simulates 12 rolls of a fair six-sided die and observes four sixes. Estimate the probability of rolling a six from this run, then compare the estimate with the model probability.

Identify the event and trial: One trial is one simulated die roll. The event is rolling a six. The event occurred 4 times in 12 trials.

Calculate the relative frequency:

$$ \text{Relative frequency} = \frac{4}{12} = 0.3333\ldots \approx 0.3333 $$

The simulation estimates the probability of rolling a six as \(0.3333\), or about 33.33%. The model probability is \(1/6 \approx 0.1667\), or about 16.67%. The estimate is about \(0.1666\) above the model probability, using the rounded values.

This difference is not, by itself, evidence that the die is unfair. Twelve rolls are a short run, and short runs can vary noticeably. The Law of Large Numbers suggests that the relative frequency tends to settle near \(1/6\) as the number of rolls increases. It does not say that this estimate must already be close, or that any specific continuation will bring it closer immediately.

Why Short Runs Can Vary Widely

In a short run, each observed six makes a relatively large change to the proportion. For example, one six in 12 rolls contributes \(1/12 \approx 0.0833\) to the relative frequency. When the total is only 12, adding or removing one success has a noticeable effect on the estimate. With 1,200 rolls, one additional six changes the relative frequency by only \(1/1{,}200 \approx 0.0008\).

That is one reason short runs can look quite different from one another: a small number of outcomes has a large influence on the proportion. In a long run, each individual outcome has less influence on the total relative frequency. The results still vary by chance, but a few unusually high or low outcomes tend to have less impact on the overall proportion.

This does not mean that every short run will be far from \(1/6\), or that every long run will be very close. A short run can happen to give a proportion near \(1/6\), and a long run can still be somewhat above or below it. The law describes what tends to happen as repetitions increase, rather than promising a particular outcome or a fixed amount of closeness.

Worked Example: Comparing Separate Short Runs

Five students each simulate 12 rolls of a fair die. Their numbers of sixes are 0, 1, 2, 3, and 5. Compare the relative frequencies across the five runs, then calculate the relative frequency for all the rolls combined.

Calculate each run’s relative frequency: For each student, divide the number of sixes by 12. The five proportions are \(0/12 = 0.0000\), \(1/12 \approx 0.0833\), \(2/12 \approx 0.1667\), \(3/12 = 0.2500\), and \(5/12 \approx 0.4167\). These short runs give quite different estimates even though they use the same fair-die model.

Pool the outcomes: There are \(5 \times 12 = 60\) simulated rolls in total. The combined number of sixes is \(0 + 1 + 2 + 3 + 5 = 11\). The relative frequency across all 60 rolls is:

$$ \frac{11}{60} = 0.1833\ldots \approx 0.1833 $$

The pooled estimate, \(0.1833\), is about \(0.0166\) above the model probability \(1/6 \approx 0.1667\). The individual estimates ranged from \(0.0000\) to \(0.4167\), while the combined estimate is much closer to \(1/6\) than either extreme. Combining the runs gives one proportion based on more trials; it does not make the separate runs identical or guarantee that every pooled result will be close to the model probability.

Reading a Cumulative Relative-Frequency Display

A useful way to inspect a simulation is to plot the cumulative relative frequency after each trial, with the model probability marked as a reference value. For this die example, the reference is \(1/6\). Early values may move above and below that line quite a bit. As the sequence grows, the cumulative relative frequency tends to fluctuate in a narrower region around the reference.

This display uses cumulative results: the value after roll 100 includes rolls 1 through 100, and the value after roll 101 includes rolls 1 through 101. It is not a display of the outcome on each individual roll. A single roll is either a six or not a six; the cumulative relative frequency summarizes the sequence up to that point.

A cumulative graph can still move away from the reference line for a while. Suppose a long sequence is close to \(1/6\), and several additional rolls are sixes. The proportion may rise. If many additional rolls are not sixes, it may fall. What the Law of Large Numbers suggests is that, over a long sequence of independent rolls, the cumulative proportion tends to settle near the model probability—not that its path must be smooth or always move in one direction.

Worked Example: A Longer Sequence Moves, Then Settles

In one simulated sequence, 82 of the first 500 rolls are sixes. The student then adds 10 rolls, all of which are sixes. Calculate the new cumulative relative frequency and compare it with the earlier one.

Update the cumulative totals: After the additional rolls, there are \(500 + 10 = 510\) rolls and \(82 + 10 = 92\) sixes.

Calculate and compare the proportions:

$$ \frac{82}{500} = 0.1640 \qquad \frac{92}{510} \approx 0.1804 $$

The relative frequency increases from \(0.1640\) to approximately \(0.1804\), moving farther above the model probability \(1/6 \approx 0.1667\). This short continuation does not contradict the Law of Large Numbers. The law does not require the cumulative relative frequency to move closer to the model probability after every group of rolls; it describes its long-run tendency as many more trials accumulate.

Common Mistakes and AP Exam Tips

  • Saying the relative frequency must equal the probability. A simulation gives an estimate. A careful statement is, “The simulated relative frequency was \(0.1833\), compared with the model probability \(1/6\).” Do not call the estimate the exact probability.
  • Claiming every longer run is closer. The proportion can move toward or away from the model probability as trials are added. Say that it tends to settle near the probability over many repeated trials.
  • Confusing counts and proportions. A long run will generally contain more sixes simply because it contains more rolls. Compare the number of sixes divided by the number of rolls—not the count alone—with \(1/6\).
  • Assuming the law changes the probability of the next roll. If the die is fair, the probability of a six on the next roll remains \(1/6\), regardless of how many sixes have already appeared.
  • Treating one run as proof about fairness. A short simulation that produces a high or low proportion can occur by chance. Interpret it as a result from that run, not as proof that the model is wrong.
  • Forgetting the model assumptions. The example uses a fair die and repeated independent rolls. State the chance model being simulated when explaining why its relative frequency is expected to settle near \(1/6\).

For a clear AP response, identify the event and its model probability, calculate the relative frequency using the correct total number of trials, and explain what the result suggests. When describing the Law of Large Numbers, use wording such as “tends to get closer” or “tends to settle near.” Avoid saying “must,” “always,” or “will equal.”

Key takeaway: In repeated independent trials with the same event probability, the relative frequency tends to settle near that probability as the number of trials grows. Short runs can vary widely, and even a long-run proportion is not guaranteed to equal the model probability or move closer after every added trial.

Check Your Understanding

Use the model probability \(1/6\) for rolling a six on a fair die.

  1. A simulation records 7 sixes in 30 rolls. Calculate the relative frequency and compare it with the model probability.
  2. Explain why a relative frequency of sixes can rise after several additional rolls, even when the simulation follows a fair-die model.
  3. One simulation has a relative frequency of \(0.10\) after 20 rolls and \(0.17\) after 2,000 rolls. What does this illustrate about the Law of Large Numbers?
  4. Why is it misleading to compare the number of sixes in 100 rolls directly with the number in 1,000 rolls without calculating proportions?
  5. State one thing the Law of Large Numbers suggests and one thing it does not guarantee.