Tutorials › AP Statistics › Comparing Simulated and Theoretical Probability

Estimating probability by simulation · Tutorial 215 of 1000

Comparing Simulated and Theoretical Probability

Find the exact probability of a sum of 7, compare it with simulation results, and explain why the two values may differ.

Beginner 8 min read

What You'll Learn

  • Find the exact probability of a sum of 7 by counting equally likely ordered outcomes for two fair dice
  • Calculate a simulated probability estimate from the number of successful trials
  • Compare a simulated estimate with the theoretical probability in decimal and percentage-point form
  • Explain how chance variation produces differences between a simulation and its model probability
  • Describe why more trials tend to produce steadier estimates without guaranteeing a closer result

Two Ways to Describe the Chance of a Sum of 7

In How Many Trials Are Enough, you saw that a simulated probability estimate is a relative frequency and that it can vary from run to run. Now we will compare such an estimate with a probability calculated directly from a model: the chance that two fair six-sided dice sum to 7.

The two values answer closely related questions. The theoretical probability is calculated from the chance model, using the possible outcomes and their probabilities. The simulated estimate is calculated from the outcomes that happened in a particular run. If the dice in the model are fair and the rolls are independent, the theoretical value is exact. A simulation gives an estimate, and that estimate may be above or below the exact probability.

Definition: A theoretical probability is calculated from a specified chance model. A simulated probability estimate is the relative frequency of the event in the completed simulated trials. They may differ because a finite simulation run is affected by chance variation.

Calculate the Exact Probability First

For two dice, record each outcome as an ordered pair: the first number is the result on Die 1, and the second is the result on Die 2. For example, \((2,5)\) means that Die 1 shows 2 and Die 2 shows 5. The order matters because \((2,5)\) and \((5,2)\) are distinct outcomes: they specify different results for the two dice.

If both dice are fair, each has six equally likely results. There are \(6 \times 6=36\) equally likely ordered pairs in all. Six of these pairs have a sum of 7: \((1,6)\), \((2,5)\), \((3,4)\), \((4,3)\), \((5,2)\), and \((6,1)\). Therefore, the exact probability is the number of outcomes that meet the condition divided by the total number of equally likely outcomes.

$$ P(\text{sum of 7}) = \frac{6}{36} = \frac{1}{6} \approx 0.1667 $$

Thus, the theoretical probability is \(1/6\), or about 16.67%. This value comes from the model; it is not calculated by rolling the dice a certain number of times. It also does not mean that exactly one out of every six rolls must produce a sum of 7. In any finite run, the actual relative frequency can be different.

Worked Example: Count the Outcomes That Make 7

A student says that there are five ways to get a sum of 7 because the possible first-die results are 1, 2, 3, 4, 5, and 6, and the result 7 itself is not on a die. Check the claim by listing the ordered pairs.

For each possible result on Die 1, there is exactly one result on Die 2 that makes the sum 7:

Die 1Die 2 neededOrdered pairSum
16(1, 6)7
25(2, 5)7
34(3, 4)7
43(4, 3)7
52(5, 2)7
61(6, 1)7

There are six successful ordered pairs, not five. Each possible result on Die 1 has a matching result on Die 2, including a 6 on Die 1 paired with a 1 on Die 2. There are 36 equally likely ordered pairs overall, so the theoretical probability is \(6/36=1/6\). Counting ordered pairs makes sure that outcomes with the dice switched are not accidentally overlooked.

Compare a 30-Trial Simulation with the Exact Value

A simulation should imitate the chance model. For this example, one trial means rolling two fair dice once and recording the ordered pair. A trial is a success if the two results sum to 7. Repeat that same process for every trial, and calculate the simulated estimate as the number of successful trials divided by the total number of trials.

Here is one invented set of 30 simulated outcomes. Each row shows ten trials. The pairs are listed in trial order; the count at the right is the number of pairs in that row that sum to 7.

Worked Example: Compare 30 Simulated Rolls with the Model

Find the relative frequency of sums of 7 in the listed simulation, then compare it with the theoretical probability.

TrialsOrdered pairsSuccesses
1–10(1,6), (2,5), (3,4), (4,4), (6,2), (5,1), (2,2), (1,3), (6,1), (3,3)4
11–20(2,5), (1,1), (6,1), (3,6), (4,2), (5,5), (2,3), (1,4), (6,6), (3,1)2
21–30(4,3), (1,2), (5,2), (6,6), (2,4), (3,3), (1,6), (4,1), (5,5), (2,2)3

In trials 1–10, the pairs \((1,6)\), \((2,5)\), \((3,4)\), and \((6,1)\) sum to 7, so there are 4 successes. In trials 11–20, \((2,5)\) and \((6,1)\) sum to 7, so there are 2 successes. In trials 21–30, \((4,3)\), \((5,2)\), and \((1,6)\) sum to 7, so there are 3 successes. The total is \(4+2+3=9\) successes in \(10+10+10=30\) trials.

Divide the number of successful trials by the total number of trials:

$$ \text{Simulated estimate} = \frac{9}{30} = \frac{3}{10} = 0.30 = 30\% $$

The theoretical probability is \(1/6\approx0.1667\), or about 16.67%. The simulated estimate is higher. The difference is

$$ \frac{9}{30}-\frac{1}{6} = \frac{9}{30}-\frac{5}{30} = \frac{4}{30} = \frac{2}{15} \approx 0.1333 $$

So, in this run, the estimate is about 0.1333 higher than the theoretical probability, a difference of about 13.33 percentage points. In a 30-trial run, each success changes the estimate by \(1/30\), or about 3.33 percentage points. A handful more successes than usual can therefore make the relative frequency noticeably higher.

For 30 trials, the model probability gives an expected count of \(30(1/6)=5\) sums of 7. That is a model-based average count, not a required number of successes in every run. Observing 9 instead of 5 is one way chance variation can appear. The difference in this example does not by itself show that the dice were unfair or that the simulation was set up incorrectly.

A Larger Simulation Can Give a Closer Estimate

To see a smaller gap, consider a separate invented simulation of 600 trials. As in the earlier tutorial How Many Trials Are Enough, more repetitions generally make a relative-frequency estimate steadier. They do not guarantee that any particular larger run will be closer to the theoretical value.

Worked Example: Compare a 600-Trial Estimate with the Exact Probability

Suppose 103 of 600 simulated rolls produce a sum of 7. Compare this estimate with \(1/6\), and describe the difference in context.

The simulated estimate is the count of successes divided by the number of completed trials:

$$ \text{Simulated estimate} = \frac{103}{600} \approx 0.1717 = 17.17\% $$

Write the theoretical probability with a denominator of 600 to make the difference easy to calculate: \(1/6=100/600\). The simulated run has three more successes than that model-based count of 100, so the difference between the relative frequencies is

$$ \frac{103}{600}-\frac{1}{6} = \frac{103}{600}-\frac{100}{600} = \frac{3}{600} = 0.005 $$

The estimated probability in this run is 0.005 higher than the theoretical probability, a difference of 0.5 percentage points. In context, 17.17% of the 600 simulated rolls produced a sum of 7, compared with the model probability of about 16.67%. The estimate is close to, but not exactly equal to, the theoretical value.

This comparison illustrates the Law of Large Numbers, introduced in The Law of Large Numbers in Simulations: as repeated, independent trials with the same event probability accumulate, the relative frequency tends to settle near the model probability. The 600-trial example is closer to \(1/6\) than the 30-trial example, but that is not a guarantee about every pair of runs. A new 600-trial run could end up farther from \(1/6\) than a particular 30-trial run.

Why the Values Differ

The exact probability describes what the specified model says about one trial. A simulation estimate describes what happened across a finite collection of trials. Even when the simulation correctly models two fair dice, chance can produce more or fewer sums of 7 than the model-based average count. That variation in results from repeated chance processes is the reason a simulated relative frequency may differ from the theoretical probability.

A useful comparison includes both values and the direction of the gap. For the 30-trial run, the simulated estimate \(9/30=0.30\) is about 0.1333 higher than \(1/6\approx0.1667\). For the separate 600-trial run, the estimate \(103/600\approx0.1717\) is 0.005 higher. These are outcomes of different simulated runs; they are not competing answers to the exact probability question.

Before explaining a difference as chance variation, check that the model and event match the question. In this setting, each trial must represent one roll of two dice, each die must have the six outcomes represented fairly, and the success event must be defined as a sum of 7. If the simulation accidentally gives some faces more chances than others, or counts the wrong event, the results may differ because the model was not implemented correctly.

Key takeaway: For two fair dice, the exact probability of a sum of 7 is \(6/36=1/6\). A simulation estimates that probability by a relative frequency. The estimate can be above or below \(1/6\) because of chance variation, and more trials generally make it steadier without guaranteeing a closer result in every run.

Common Mistakes and AP Exam Tips

  • Leaving out ordered outcomes. The pairs \((2,5)\) and \((5,2)\) are distinct outcomes for two dice. Count all six pairs that make 7, including both orders where the dice show different values.
  • Using the sum as the outcome. The 36 equally likely outcomes are ordered pairs of die results, not the possible sums. Sums are not all equally likely; for example, more ordered pairs make 7 than make 2.
  • Calling a simulation estimate exact. A relative frequency such as \(9/30\) describes that run. The theoretical probability \(1/6\) comes from the specified model. Identify which value is which.
  • Reporting counts without denominators. Nine successes alone is not a probability estimate. State that there were 9 successes out of 30 trials, then calculate \(9/30\).
  • Calling every gap a setup error. A correctly modeled finite simulation can differ from the exact value because of chance variation. Check the trial definition, outcome assignments, and event before deciding that the simulation is flawed.
  • Claiming more trials always gives a closer result. Say that more trials generally reduce variability and tend to make estimates settle near the theoretical probability. Do not claim that a larger run is guaranteed to be closer.
  • Confusing percentage points with percent change. When comparing 30% and 16.67%, their difference is about 13.33 percentage points. Describe the subtraction of the percentages as a percentage-point difference.

A full-credit comparison names the model probability, reports the simulated relative frequency with its denominator, and explains the difference in context. For example: “The theoretical probability of rolling a sum of 7 is \(1/6\). In this 30-trial simulation, 9 trials had a sum of 7, so the estimated probability is \(9/30=0.30\). The estimate is about 0.1333, or 13.33 percentage points, higher than the theoretical probability; this can happen because of chance variation in a finite run.”

Check Your Understanding

Use the model of two fair six-sided dice and the event “the sum is 7.”

  1. How many ordered pairs are possible when two dice are rolled, and how many of them sum to 7?
  2. A simulation records 12 sums of 7 in 72 trials. Calculate its relative-frequency estimate and compare it with \(1/6\).
  3. In 30 trials, the model-based expected count of sums of 7 is 5. Does that mean every 30-trial simulation must have exactly 5 successes? Explain.
  4. Why must \((1,6)\) and \((6,1)\) both be counted among the outcomes that sum to 7?
  5. What is a careful way to describe the effect of increasing the number of simulated trials?