AP · Statistics · Probability

Probability and Simulation

13 min readUpdated December 1, 2026FreeAP Statistics, Probability, Random Variables and Probability Distributions

The probability of an outcome is the proportion of times it would happen in a very long series of repetitions. The law of large numbers says the observed proportion settles toward that probability as repetitions grow, and a simulation imitates the process with random digits to estimate probabilities.

Quick check

  1. A hypothetical spinner lands on red 18 times in 120 spins. What is the relative frequency of red?Show answerHide answer

    18120=0.15\dfrac{18}{120} = 0.15, the proportion of spins that landed on red.

  2. After 5 tails in a row, is a fair coin more likely to land heads next?Show answerHide answer

    No. The coin has no memory, so the probability of heads is still 0.5.

Know these already? Jump to the practice questions

What you'll be able to do

  • Interpret a probability as a long-run relative frequency, in context.
  • Explain what the law of large numbers does and does not promise.
  • Describe a simulation: assign digits to outcomes and define one trial.
  • Calculate an estimate from simulation results and judge a claim with it.

Key terms

Probability

A number from 0 to 1: the proportion of times an outcome would occur in a very long series of repetitions.

In plain English
How often it happens in the long run.
Don't write
"probability 0.3 means exactly 3 times in every 10".

Law of large numbers

As a chance process is repeated more and more, the relative frequency of an outcome tends to get closer to its probability.

In plain English
Long-run proportions settle down; short runs are unpredictable.
Don't write
"after a run of misses, a hit is due".

Simulation

Imitating a chance process with a random device that matches its probabilities; each repetition is a trial.

In plain English
Fake the process many times, then count.
Don't write
"the simulation gives the exact probability"; it gives an estimate.

What does a probability mean?

Suppose the probability that a hypothetical machine fills an underweight cereal box is 0.03. Then, over a very large number of boxes, about 3 percent will be underweight. It does not say which boxes, and it does not promise exactly 3 in every 100.

Probabilities run from 0 (never) to 1 (always). To interpret one, name the process, the outcome and the long run.

Examiner's eye

Marks are lost for repeating the number ("a 3 percent chance") instead of interpreting it: say what happens over many repetitions, in context.

Check yourself

A hypothetical basketball player has probability 0.8 of making each free throw. Interpret 0.8 in context.
Show answerHide answer

If she takes a very large number of free throws, she will make about 80 percent of them.

What does the law of large numbers say?

In 10 tosses of a fair coin, a proportion of 0.7 heads is unremarkable. In 10,000 tosses it would be astonishing, because the proportion will almost certainly be very close to 0.5. That is the law of large numbers at work.

It says nothing about the short run: a coin has no memory, so after 5 tails in a row P(heads)P(\text{heads}) is still 0.5. And it is about proportions, not counts: the number of heads can drift further from half the tosses even while the proportion closes in.

Check yourself

A hypothetical spinner lands on blue with probability 0.25. In 40 spins it lands on blue 14 times. Does this prove the probability is not 0.25?
Show answerHide answer

No. The proportion 1440=0.35\dfrac{14}{40} = 0.35 comes from a short run, which can differ from 0.25 by chance.

How do you design a simulation?

  1. Assign digits to outcomes so the probabilities match. For 0.3, use 0–2 for "yes" and 3–9 for "no". For 0.35, use pairs: 00–34 for "yes", 35–99 for "no".
  2. Describe one trial: how many digits to read, whether repeats are allowed, and what to record.
  3. Repeat many trials.
  4. Estimate the probability as the proportion of trials with the outcome.

If the real process cannot repeat (choosing people without replacement), skip repeated labels within a trial. With a random number generator, say what to generate: "an integer from 1 to 100; 1 to 35 means yes".

Check yourself

Which single digits could simulate an event with probability 0.6?
Show answerHide answer

Any 6 of the 10 digits, for example 0–5 for "the event happens" and 6–9 for "it does not".

How do you use simulation results?

By the law of large numbers, more trials give a better estimate. Simulation can also test a claim: assume the claim is true, simulate many samples under it, and see how often a result at least as extreme as the real one appears.

  • Rarely: the real result is convincing evidence against the claim.
  • Fairly often: the result is plausible by chance, so there is no convincing evidence against the claim.

Significance tests, in later notes, use the same reasoning.

Key idea

A simulation estimate is the proportion of trials with the outcome, and it improves with more trials.

Check yourself

In 250 simulated trials, an event happened 40 times. Estimate its probability.
Show answerHide answer

40250=0.16\dfrac{40}{250} = 0.16.

Worked example 1: Carrying out a simulation

Question: A hypothetical school bus is late on 30 percent of days, independently. Let the digits 0, 1 and 2 stand for a late day and 3 to 9 for an on-time day. Use these random digits, one group per trial, to estimate the probability that it is late on at least 2 of the 5 days in a week: 03365 02021 21155 03946 59246 07783 42901 09124 86515 98310.

What tells you the method

A probability, a repeated process and random digits.

  1. Step 1: Assign digits.

    0, 1 and 2 mean late; 3 to 9 mean on time.

    Why

    3 of the 10 digits gives 0.3.

  2. Step 2: Count late days in each trial.

    The counts are 1, 5, 3, 1, 1, 1, 3, 3, 1 and 2.

    Why

    Each group of 5 digits is one simulated week.

  3. Step 3: Estimate.

    Five trials have at least 2 late days, so the estimate is 510=0.5\dfrac{5}{10} = 0.5.

    Why

    The estimate is the proportion of trials with the outcome.

Check it

The exact value (see the note on Binomial Distributions) is about 0.4718, so this rough estimate is close.

Answer

The estimated probability is 0.50.5.

Worked example 2: Judging a claim

Question: A hypothetical coffee shop claims that 40 percent of customers order a pastry. In a random sample of 25 customers, only 5 did. Of 200 samples of 25 simulated with the claim true, 6 had 5 or fewer pastry orders. (a) Estimate the probability of 5 or fewer orders if the claim is true. (b) Is there convincing evidence that fewer than 40 percent order a pastry?

What tells you the method

Samples simulated under a claim, and a real result to compare.

  1. Step 1: Estimate the probability.

    6200=0.03\dfrac{6}{200} = 0.03.

    Why

    6 of the 200 simulated samples were at least as extreme as the real one.

  2. Step 2: Judge the claim.

    If the claim is true, 5 or fewer orders happens only about 3 percent of the time. That is rare, so the sample is convincing evidence that the true proportion is less than 0.40.

    Why

    A result very unlikely under the claim casts doubt on it.

Check it

The claim predicts about 25×0.4=1025 \times 0.4 = 10 orders, so 5 is well below it.

Answer

(a) The estimated probability is 0.030.03. (b) Yes, there is convincing evidence that fewer than 40 percent of customers order a pastry.

Your turn

Question: A student guesses all 4 answers on a hypothetical quiz with 5 choices per question. Using one group of digits per trial, with 0 or 1 meaning a correct guess, estimate the probability of at least 2 correct: 6787 3941 3821 7840 2485 7397 0017 4352 9990 9501.

  1. Step 1:

    Two of the 10 digits mean correct, matching 15=0.2\dfrac{1}{5} = 0.2; each group of 4 digits is one quiz.

  2. Step 2:

    The first group, 6787, has 0 correct; the second, 3941, has 1 correct.

  3. Step 3: Your go: count the correct guesses in the other 8 groups, then estimate the probability.

Show the full solutionHide the solution

The counts for all 10 groups are 0, 1, 1, 1, 0, 0, 3, 0, 1 and 2. Two trials (0017 and 9501) have at least 2 correct, so the estimate is 210=0.2\dfrac{2}{10} = 0.2.

Answer: The estimated probability is 0.20.2.

Traps

Trap

Thinking that after a run of one outcome, the other outcome is "due".

It seems right because the law of large numbers says proportions even out. But chance has no memory: each independent trial keeps the same probability, and streaks are swamped, not corrected.

Check yourself

A hypothetical machine jams with probability 0.1 on each run, independently. After 30 runs without a jam, what is the probability it jams next run?
Show answerHide answer

0.10.1. The runs are independent, so the earlier runs do not change the next one.

Trap

Thinking that the digits 0–3 simulate a probability of 0.3.

It seems right because 3 appears in the range. But 0, 1, 2 and 3 are four digits, so they simulate 0.4. Count the digits assigned.

Check yourself

Pairs of digits 00–20 are used for "success" and 21–99 for "failure". What probability is being simulated?
Show answerHide answer

21100=0.21\dfrac{21}{100} = 0.21, because 00 to 20 is 21 pairs out of 100.

What's examined

Probability and simulation are tested on the AP® Statistics exam (Probability), in multiple-choice and free-response questions: interpret a probability in context, design or carry out a simulation, and use simulated results to judge a claim.

Practice questions

  1. Recall The probability that a hypothetical factory's battery is defective is 0.15. Which interpretation is correct?
    • A) Exactly 15 of every 100 batteries are defective.
    • B) Over a very large number of batteries, about 15 percent are defective.
    • C) If the first 10 batteries are fine, the next one is probably defective.
    • D) Each battery is 15 percent defective.
Show answer

Answer: B) Over a very large number of batteries, about 15 percent are defective.

Marking points:

  • A probability is a long-run proportion.
  • A wants an exact count in every 100. C is the "due" fallacy. D misreads an outcome probability as a fraction of each battery.
  1. Apply Which assignment correctly simulates an event with probability 0.45?
    • A) Single digits 0–4 for the event, 5–9 for not
    • B) Pairs 00–45 for the event, 46–99 for not
    • C) Pairs 00–44 for the event, 45–99 for not
    • D) Pairs 00–44 for the event, 45–89 for not, ignoring 90–99
Show answer

Answer: C) Pairs 00–44 for the event, 45–99 for not

Marking points:

  • 00 to 44 is 45 pairs out of 100, so the probability is 0.45.
  • A gives 510=0.5\dfrac{5}{10} = 0.5. B gives 46100=0.46\dfrac{46}{100} = 0.46. D gives 4590=0.5\dfrac{45}{90} = 0.5.
  1. Exam-style A hypothetical basketball player makes 70 percent of her free throws, independently. Using digits 0–6 for a make and 7–9 for a miss, with one group of 3 digits per trial, estimate the probability that she makes all 3 of her next 3 free throws: 404 467 438 061 174 528 688 746 850 641.
Show answer

Answer: The estimated probability is 0.30.3.

Marking points:

  • 0–6 is 7 of 10 digits, matching 0.7; each group of 3 digits is one set of 3 shots.
  • Only 404, 061 and 641 contain no 7, 8 or 9, so 3 of the 10 trials are all makes: 310=0.3\dfrac{3}{10} = 0.3.
  1. Recall Which statement is the law of large numbers?
    • A) In 10 tosses of a fair coin there will be exactly 5 heads.
    • B) After several tails in a row, heads becomes more likely.
    • C) The number of heads gets closer and closer to exactly half the tosses.
    • D) As the number of tosses grows, the proportion of heads tends to get closer to 0.5.
Show answer

Answer: D) As the number of tosses grows, the proportion of heads tends to get closer to 0.5.

Marking points:

  • The law is about the long-run proportion.
  • A is about a short run. B is the "due" fallacy. C is about counts, which can drift away from half.
  1. Exam-style A hypothetical delivery company claims that 90 percent of its packages arrive on time. In a random sample of 50 packages, 40 did. Of 500 samples of 50 simulated with the claim true, 11 had 40 or fewer on time. (a) Estimate the probability of 40 or fewer on-time packages if the claim is true. (b) Is there convincing evidence that fewer than 90 percent of packages arrive on time?
Show answer

Answer: (a) The estimated probability is 0.0220.022. (b) Yes: a result this low is rare if the claim is true, so there is convincing evidence that fewer than 90 percent arrive on time.

Marking points:

  • 11500=0.022\dfrac{11}{500} = 0.022.
  • Under the claim about 50×0.9=4550 \times 0.9 = 45 packages arrive on time; 40 or fewer happens in only about 2 percent of simulated samples.
  • The conclusion is stated in context, about the true proportion of on-time packages.
  1. Apply A hypothetical simulation with 50 trials estimates a probability as 0.31. Which change is most likely to give a more accurate estimate?
    • A) Run 5,000 trials instead of 50
    • B) Repeat the same 50 trials with a new line of digits
    • C) Round the estimate to 0.3
    • D) Stop the simulation the first time the event happens
Show answer

Answer: A) Run 5,000 trials instead of 50

Marking points:

  • By the law of large numbers, the proportion settles toward the true probability as trials increase.
  • B keeps the same small number of trials. C changes nothing about accuracy. D gives a biased, tiny set of trials.

Key points

Recall, then reveal

Say the main points from memory first, then check them.

Show key pointsHide key points
  • A probability is the long-run proportion of times an outcome happens; interpret it in context with "over many repetitions".
  • The law of large numbers is about proportions in the long run; it never makes an outcome "due".
  • Assign digits so their share of all digits or pairs equals the probability, then define what one trial reads and records.
  • Estimate = trials with the outcome ÷ total trials; more trials give a better estimate.
  • A real result that rarely occurs in simulations under a claim is convincing evidence against that claim.

Keep learning

Explore AP Statistics tutoring →

View the full Statistics syllabus →

More in this unit

Probability, Random Variables and Probability Distributions

All Probability notes

Part of Novark's AP Statistics notes