Tutorials › AP Statistics › Full Simulation Problem Walkthrough for the AP Exam

Estimating probability by simulation · Tutorial 220 of 1000

Full Simulation Problem Walkthrough for the AP Exam

Learn how to design, carry out, summarize, and explain a complete probability simulation in scoring-ready language.

Beginner 9 min read

What You'll Learn

  • Translate a probability question into a chance model and a clearly defined simulated trial.
  • Assign random digits to outcomes so the simulation reflects the stated probabilities.
  • Identify which trial results meet an event rule and calculate the estimated probability.
  • Write a conclusion that interprets a simulation estimate in context without treating it as exact.
  • Spot simulation-design errors that can make an estimate misleading.

From a Word Problem to a Scoring-Ready Simulation

In Describing a Simulation in Words, you learned to connect a chance model to a random assignment of outcomes, a complete trial, repeated trials, and a recorded result. This tutorial brings those steps together in a full free-response style solution. The goal is not just to get a proportion: it is to explain why the simulation represents the situation and what its estimate means.

A well-organized response makes the logic easy to follow. First state the model and event of interest. Then describe a chance mechanism that matches the model, define one complete trial, and say how the result will be recorded. Finally, count the simulated trials that meet the event rule, divide by the total number of trials, and interpret the estimate in context.

Key takeaway: A complete simulation answer follows one connected chain: the model matches the situation, the random-number assignments match the model, one trial matches the question, and the calculation counts exactly the results that meet the event rule.

A Four-Step Structure for a Full Response

Use the familiar State, Plan, Do, and Conclude organization. For a simulation question, the Plan must describe the simulation in enough detail that another person could reproduce it. The Do must show which outcomes count and how the estimate is calculated. The conclusion must answer the original question, in context, as an estimate based on the model.

1
State.
Identify the probability being estimated, the event of interest, and the relevant chance model.
2
Plan.
Assign random digits or numbers to possible outcomes, define one complete trial, and explain what will be recorded and how many trials will be simulated.
3
Do.
Count the trials that meet the event rule, divide by all completed trials, and report the estimated probability.
4
Conclude.
Interpret the estimate as a proportion or approximate chance in the situation, conditional on the model used.

The key planning check is alignment. If the model says an event has probability 0.20, the random-number assignment must give that event 20% of the equally likely labels. If the question asks about six commutes, one trial must represent all six commutes—not just one. These ideas build on Setting Up a Simulation Model and Common Errors in Designing Simulations.

Worked Example: Estimate the Chance of Four or More Late Arrivals

A student takes a campus shuttle on six mornings during a week. For planning, the student assumes that on any morning the shuttle is late with probability 0.20, independently from one morning to the next. The student wants to estimate the probability that the shuttle is late on at least four of the six mornings. Describe and use a simulation. A simulation of 1,000 weeks produced the summary below.

Late arrivals in one simulated weekNumber of simulated weeks
0260
1390
2245
386
417
52
60

State: We want to estimate the probability that at least four of the six shuttle arrivals are late, under the model that each morning has a 0.20 probability of being late and mornings are independent.

Plan: Use two-digit numbers from 00 through 99, each equally likely. Assign 00–19 to “late” and 20–99 to “on time.” This gives 20 of the 100 labels to late, matching the model probability of 0.20. Generate six two-digit numbers for one simulated week. Count the numbers from 00 through 19; that count is the number of late arrivals in that week. Repeat the complete six-number trial 1,000 times.

For example, the generated numbers 08, 42, 19, 77, 53, and 11 represent late, on time, late, on time, on time, and late. This simulated week has three late arrivals. The event of interest—at least four late arrivals—does not occur in this trial.

Do: The event occurs in simulated weeks with 4, 5, or 6 late arrivals. The table accounts for all 1,000 weeks because the counts sum to \(260+390+245+86+17+2+0=1000\). There are \(17+2+0=19\) qualifying weeks, so the estimated probability is:

$$ \frac{17+2+0}{1000}=\frac{19}{1000}=0.019 $$

Conclude: Under the model that each shuttle arrival has an independent 0.20 probability of being late, the estimated probability of at least four late arrivals in a six-morning week is 0.019, or about 1.9%. This is a simulation estimate, so another run could produce a somewhat different proportion.

Make the Trial and the Event Rule Explicit

A simulation result is only useful if its unit is clear. In the shuttle example, the unit being counted in the final table is a simulated week. Each week contains six simulated arrivals, and the recorded result is the number of late arrivals. The 1,000 repetitions are 1,000 complete weeks. Counting 1,000 individual arrivals instead would not directly answer a question about the chance of at least four late arrivals in one week.

The event rule must also be applied literally. “At least four” includes exactly four, as well as five and six. A careful response names those values before adding their frequencies. This prevents a common off-by-one error: counting only values greater than four would estimate the probability of more than four late arrivals, which is a different event.

Formula: The estimated probability of an event from simulation results is the number of completed simulated trials in which the event occurs divided by the total number of completed trials.
$$ \text{Estimated probability}= \frac{\text{number of simulated trials in which the event occurs}} {\text{total number of simulated trials}} $$

As explained in Estimating a Probability from Simulation Results and How Many Trials Are Enough, this relative frequency is an estimate, not a guarantee of the exact model probability. A larger number of trials generally makes the estimate less variable, but the conclusion should still describe the result as an estimate from the simulation.

Worked Example: Simulate a Quality-Inspection Question

A small fictional workshop assumes that 35% of its items have a surface flaw. An inspector randomly checks five items, and the model treats the flaw status of different items as independent. The question is: what is the probability that at least two of the five inspected items have a flaw? A simulation of 200 inspections of five items gave the following results.

Flawed items in one simulated inspectionNumber of simulated inspections
023
162
273
334
47
51

State: We want to estimate the probability of at least two flawed items among five, assuming each item independently has a 0.35 probability of a flaw.

Plan: Generate two-digit numbers from 00 through 99. Assign 00–34 to “flawed” and 35–99 to “not flawed,” giving 35 of the 100 labels to the flaw outcome. One trial consists of five generated numbers, one for each inspected item. Record the number assigned to “flawed,” and repeat the five-number trial 200 times.

For instance, 08, 71, 34, 95, and 18 represent flawed, not flawed, flawed, not flawed, and flawed. That trial records three flawed items. Because the question asks for at least two, this trial meets the event rule.

Do: The table counts sum to \(23+62+73+34+7+1=200\). At least two flaws means a simulated result of 2, 3, 4, or 5. The total number of qualifying trials is \(73+34+7+1=115\), so:

$$ \frac{115}{200}=0.575 $$

Conclude: Under the stated model, the estimated probability that at least two of five inspected items have a surface flaw is 0.575, or about 57.5%. This estimate describes the model-based chance for five items; it is not a claim that exactly 57.5% of every group of five will contain at least two flawed items.

Check Whether the Random-Number Assignment Fits

The digit assignment is part of the model, not a decoration. If outcomes are represented by equally likely two-digit numbers from 00 to 99, there are 100 labels available. An event with probability 0.12 should receive 12 labels, not 10 or 20. A mismatch changes the probability built into every simulated trial and can make even a large simulation estimate the wrong model probability.

This is a useful scoring check: explain both the labels and why their count matches the stated chance. “Use random digits to simulate” is too vague by itself. A complete plan states what each label means, how many numbers are generated per trial, what is recorded, and how the trial is repeated.

Worked Example: Find and Fix a Probability-Mapping Error

A community center’s model says a motion sensor has a 0.12 probability of giving a false alarm on each of four independent tests. A student proposes using one random digit per test, with 0 or 1 meaning “false alarm” and 2 through 9 meaning “no false alarm.” A corrected simulation uses two-digit numbers and was repeated 500 times; its results are shown below.

False alarms in one simulated set of four testsNumber of simulated sets
0300
1160
235
35
40

State: We want to estimate the probability of at least two false alarms in four tests, using a model with a 0.12 false-alarm probability per test.

Plan: The proposed one-digit assignment is incorrect: 0 and 1 give two of ten digits to a false alarm, which represents probability 0.20 rather than 0.12. Instead, generate two-digit numbers from 00 through 99 and assign 00–11 to “false alarm” and 12–99 to “no false alarm.” There are 12 false-alarm labels out of 100, matching probability 0.12. One trial consists of four generated numbers; record how many represent false alarms, and repeat the full trial 500 times.

Do: The table frequencies sum to \(300+160+35+5+0=500\). At least two false alarms means a result of 2, 3, or 4. There are \(35+5+0=40\) qualifying trials:

$$ \frac{40}{500}=0.080 $$

Conclude: Using the corrected simulation, the estimated probability of at least two false alarms in four tests is 0.080, or 8.0%, under the model. The original one-digit plan would not be a valid simulation of the stated 0.12 probability, so results from that plan should not be used for this estimate.

Common Mistakes and AP Exam Tips

  • Giving a vague plan. “Use random numbers and repeat” does not show how the simulation matches the model. State the labels and their meanings, the number of generated outcomes per trial, the recorded result, and the number of repetitions.
  • Using the wrong probability in the assignment. Count the labels assigned to each outcome and compare that fraction with the model probability. For 0.12 using labels 00–99, assign exactly 12 labels to the event.
  • Defining one trial too narrowly. If the situation involves four tests, one trial must contain four simulated test outcomes. Repeating single tests does not directly simulate the requested four-test event.
  • Misreading the event. Translate phrases such as “at least two” into the qualifying recorded values: 2 or more. Include the boundary value named in the phrase.
  • Using the wrong denominator. Divide the number of qualifying trials by all completed trials. Do not divide only by trials with a particular intermediate result.
  • Calling the estimate exact or guaranteed. Say “the estimated probability from the simulation” or “about 8.0% under this model.” Simulation results vary from run to run.
  • Making an unconditional claim. Tie the conclusion to the model’s assumptions. A simulation estimates a probability under the stated chance model; it does not verify that model or establish what will happen in a particular future set of trials.

A strong free-response answer makes the reasoning visible. It describes a chance mechanism with the correct probabilities, defines a complete trial, identifies the event-counting rule, shows the numerator and denominator, and answers the question in context. If a part asks for a simulation plan only, do not invent results; explain how the results would be summarized. If results are supplied, use those results rather than substituting a theoretical calculation.

Key takeaway: For a full simulation walkthrough, connect the chance model to the number assignment, define one complete trial, count exactly the trials that meet the event rule, and interpret the relative frequency as an estimate in context.

Check Your Understanding

Use the examples to explain the planning and interpretation choices in each question.

  1. In the shuttle example, why does a simulated week require six generated numbers rather than one?
  2. For the quality-inspection results, how would the numerator change if the question asked for exactly two flawed items instead of at least two?
  3. For a model probability of 0.12 using labels 00–99, how many labels should represent the event? Give one valid consecutive assignment.
  4. In the sensor example, calculate the simulated estimate for at least three false alarms using the table.
  5. Write one sentence explaining why a simulation estimate should be described as an estimate under a model rather than as an exact guarantee.