From the free course AP Statistics on Lykke

2.3 Estimating Probabilities Using Simulation

Key concepts: Random process — outcomes fixed by chance, not by rule · Trial, outcome, event — one repetition, its result, a set of results · Simulation — a chance model whose outcomes mimic the real process · Long-run relative frequency — the meaning of a probability · Empirical estimate — simulated relative frequency approximates true probability · Law of large numbers — more trials, tighter agreement with the truth

A random process generates results that are determined entirely by chance, where individual outcomes are unpredictable in the short term but exhibit a predictable pattern over many repetitions.

A random process generates results that are determined entirely by chance, where individual outcomes are unpredictable in the short term but exhibit a predictable pattern over many repetitions. While we cannot say for certain whether a single coin flip will land on heads, we can estimate with high confidence that approximately 50% of 10,000 flips will be heads. This bridge between short-term uncertainty and long-term predictability is the foundation of probability.

2.3.1 The Anatomy of Randomness

To analyze a random process, we must distinguish between the individual results and the broader goals of our investigation. In the language of the AP Statistics framework, we categorize these as trials, outcomes, and events.

Term Definition Example (Rolling a Die)
Trial A single performance of a random process. One roll of the die.
Outcome The specific result of a single trial (2.3.A.2). Rolling a "4".
Event A collection of one or more outcomes (2.3.A.3). Rolling an even number {2, 4, 6}.

Essential Knowledge 2.3.A.1–3: A random process generates results determined by chance. An outcome is the result of one trial, while an event is a collection of those outcomes.

2.3.2 The Logic of Simulation

Simulation is a method used to model random events so that the simulated outcomes closely match real-world behavior (2.3.A.4). We use simulations when the theoretical probability is too complex to calculate easily or when we want to visualize the variability of a process. To perform a valid simulation, every possible real-world outcome must be associated with a value determined by chance (such as a random number), and we must record the counts of these outcomes over many trials.

Contextual Example: The "Perfect Attendance" Prize

A school gives out a "Mystery Swag Bag" to students with perfect attendance. There are four different stickers possible in each bag (A, B, C, and D), each with an equal 25% chance of appearing. How many bags, on average, must a student collect to get all four stickers?

Instead of buying hundreds of bags, we can simulate this:

  1. Assign Digits: Let 1 = Sticker A, 2 = B, 3 = C, and 4 = D. Ignore digits 0 and 5–9.
  2. Define a Trial: Generate random digits until all four stickers (1, 2, 3, and 4) have appeared. Record the number of "bags" (digits) it took.
  3. Repeat: Perform this trial 50 times.
  4. Calculate: Find the average number of bags across all 50 trials to estimate the true expected value.

2.3.3 Probability as Long-Run Relative Frequency

The probability of an outcome is defined as its long-run relative frequency (2.3.A.5). This means that if we repeat a trial a very large number of times, the proportion of times a specific outcome occurs will settle toward a single, constant value.

The Law of Large Numbers (LLN)

The Law of Large Numbers states that for independent trials, as the number of trials increases, the relative frequency of an event gets closer and closer to its actual, or true, probability (2.3.A.7). This is why empirical data—data collected through observation or simulation—is a powerful tool for estimation (2.3.A.6). A simulation of 10 trials might give a relative frequency of 0.70 for a fair coin, but a simulation of 10,000 trials will almost certainly be very close to 0.50.

2.3.4 Misconception Clinic: The "Law of Averages"

A common error is confusing the Law of Large Numbers with the non-existent "Law of Averages."

  • The Misconception: "I've flipped five heads in a row; the next one has to be tails because it's 'due' to even out."
  • The Reality: The coin has no memory. The probability of tails remains 0.50 for the next flip.
  • The Statistical Truth: The Law of Large Numbers doesn't work by "compensating" for past outcomes with different future outcomes. Instead, it works by swamping the early results. If you have 5 heads and 0 tails, the relative frequency is 100%. If you then flip 1,000 more times and get roughly 500 heads and 500 tails, your total becomes 505 heads out of 1,005 flips—a relative frequency of 50.2%. The early "streak" didn't disappear; it just became insignificant.

2.3.5 Discrete Probability Distributions via Simulation

A random variable is a variable whose numerical outcomes result from a random phenomenon (2.8.A.1). We can use simulations to estimate the probability distribution of a discrete random variable—a display of every possible value and its associated probability (2.8.A.2, 2.8.A.3). By recording the results of thousands of simulated trials, we can construct a table or histogram that approximates the true distribution of the variable.

Interpretation Check

A researcher simulates a medical procedure that has a known 20% success rate. They run 500 trials, where each trial consists of 10 procedures, and they record the number of successes in each trial.

  1. What is the random process in this scenario?
  2. If the event "exactly 2 successes" occurred in 150 of the 500 trials, what is the estimated probability of that event?
  3. According to the Law of Large Numbers, what would happen to that estimate if the researcher increased the simulation to 50,000 trials?
2.3 Estimating Probabilities Using Simulation - AP Statistics - image 1
2.3 Estimating Probabilities Using Simulation - AP Statistics - image 1
2.3 Estimating Probabilities Using Simulation - AP Statistics - diagram 1
2.3 Estimating Probabilities Using Simulation - AP Statistics - diagram 1

Source Materials

The whole course on Lykke · Browse all public course wikis