Math 2 • Statistics & Probability

Simulating Probabilities — I can design and run a simulation to estimate a probability and evaluate the accuracy of the estimate.

Use random experiments to approximate probabilities when exact calculations are difficult or impossible.

Math 2 emblem with a variable, a triangle, and a ruler.
Inside this lesson 10 sections 5 questions 8 figures

SECTION 1

Historical Context & Motivation

Not every probability problem has a clean formula you can plug numbers into. Sometimes the situation is so complex — involving multiple stages, unusual conditions, or real-world messiness — that the only practical way to estimate a probability is to simulate the process many times and observe how often the outcome of interest occurs. This idea, running random experiments to approximate answers, has a surprisingly rich history that stretches back centuries.

1777 • Buffon's Needle Problem

French mathematician Comte de Buffon proposed dropping a needle on parallel lines to estimate π. This is one of the earliest recorded examples of using a physical random experiment to estimate a mathematical quantity.

1946 • The Monte Carlo Method

Stanislaw Ulam and John von Neumann, working on nuclear physics at Los Alamos, formalized the idea of using repeated random sampling to solve problems too complex for direct calculation. They named it the Monte Carlo method after the famous casino.

1964 • Computer-Driven Simulations

As computers became faster, scientists began running millions of simulated trials in seconds. Fields from weather forecasting to financial modeling adopted simulation as a standard tool.

2000s–Present • Simulation in Everyday Life

Today, simulations drive everything from video game physics to medical research. High school students can run thousands of trials on a graphing calculator or a simple spreadsheet in moments.

The core question this lesson addresses is: How can you design a random experiment, run it many times, and use the results to estimate a probability — and how do you know if your estimate is any good?

SECTION 2

Core Principles & Definitions

Before you run a simulation, you need to understand a few foundational ideas that make the whole process work. These principles explain why random repetition can give you a trustworthy answer, and what steps are involved in setting one up.

1

Trial

A single run of your simulated experiment — for example, flipping a coin 10 times or rolling a die. Each trial produces one outcome you can record.
2

Experimental (Simulated) Probability

The proportion of trials in which the event of interest occurs. It equals the number of successes divided by the total number of trials.
3

Theoretical Probability

The exact probability calculated from a mathematical model (e.g., P(heads) = 0.5). Simulations aim to approximate this value when it is unknown or hard to compute.
4

Law of Large Numbers

As the number of trials increases, the experimental probability tends to converge toward the theoretical probability. More trials generally mean a better estimate.
5

Random Number Generator

A tool (calculator function, spreadsheet, or app) that produces numbers with equal likelihood, serving as the engine behind every simulation.
✦

KEY TAKEAWAY

Think of a simulation like a batting average in baseball. A player who has only batted 5 times might have a misleading average, but after 500 at-bats you get a very reliable picture of their true hitting ability. Similarly, a simulation with just 10 trials can be way off, but with 1,000 or more trials, the estimate settles in close to the real probability.

SECTION 3

Visualizing the Simulation Process

Designing a simulation follows a clear sequence of steps. The flowchart below shows the entire process from identifying the real-world problem to evaluating your estimate. Every simulation you build in this course will follow this same loop.

Simulation Design Flowchart1. Define the Problem2. Choose a Random Device(coin, die, RNG, spinner)3. Map Outcomes to the Model(e.g., 1–3 = success, 4–6 = failure)4. Run Many Trials & Record5. Compute Experimental PP̂ = successes ÷ trials6. Evaluate AccuracyRepeat formore trials
The six-step simulation loop. Notice the feedback arrow on Step 4: if your estimate seems unstable, you run more trials until the result settles down.

Steps 1 through 3 are the design phase — you decide what question you are answering and how a random device (like a die or a random-number generator) will stand in for the real-world event. Steps 4 and 5 are the execution phase, where you actually gather data. Step 6 is the evaluation phase, where you ask whether your sample size was large enough to produce a trustworthy estimate.

SECTION 4

Mathematical Framework

Two key formulas underpin every simulation. The first tells you how to compute your estimate; the second helps you judge how close that estimate is likely to be to the true probability.

EXPERIMENTAL PROBABILITY

P^=numberofsuccesses/numberoftrials=s/nP̂ = number of successes / number of trials = s / n

P̂ (read "P-hat") is the experimental probability, s is the count of trials where the event of interest occurred, and n is the total number of trials.

LAW OF LARGE NUMBERS (INFORMAL)

Asn→∞,P^→P(true)As n → ∞, P̂ → P(true)

This law guarantees that as the number of trials n grows without bound, the experimental probability P̂ approaches the true theoretical probability. In practice, "large" usually means hundreds or thousands of trials.

MARGIN OF ERROR APPROXIMATION

MarginofError≈1/√nMargin of Error ≈ 1 / √n

A quick rule of thumb: the margin of error of a simulation is roughly 1 divided by the square root of the number of trials. For example, 100 trials give a margin of about 0.10, while 2,500 trials shrink it to about 0.02.

💡

Why More Trials Help

Notice that the margin of error formula has √n in the denominator. This means that to cut the margin of error in half, you need to quadruple the number of trials — not just double them. Going from 100 trials (margin ≈ 0.10) to 400 trials (margin ≈ 0.05) cuts the error by half.

SECTION 5

How Estimates Converge — The Law of Large Numbers in Action

One of the most powerful ways to understand simulations is to watch how the experimental probability changes as you accumulate more trials. The graph below shows a simulation of flipping a fair coin (true P = 0.50). Early on, the estimate bounces wildly; as the number of flips grows, the line flattens out near the true value.

Convergence of Experimental Probability (Coin Flip)Number of TrialsP̂ (Experimental Probability)P = 0.501.000.750.500.250.00010050010002000High variability zoneFew trials → unstableestimateConvergence zoneMany trials → stable estimate
This graph shows one simulated sequence of coin flips. After the first 2 flips, the estimate is wildly off (the first flip was heads → P̂ = 1.00, then the second was tails → P̂ = 0.00). By 500 trials, the estimate is close to 0.50, and by 2,000 trials it has virtually settled on the true value.
Number of Trials (n)Approximate Margin of Error (1/√n)Typical Range of P̂ for true P = 0.50
10≈ 0.3160.18 – 0.82
100≈ 0.1000.40 – 0.60
500≈ 0.0450.46 – 0.54
2,500≈ 0.0200.48 – 0.52
10,000≈ 0.0100.49 – 0.51

Margin of error shrinks as n increases, but the improvement slows down.

SECTION 6

Worked Example — Simulating Free-Throw Shooting

Suppose a basketball player makes 70% of her free throws. What is the probability that she makes at least 8 out of her next 10 free throws? Rather than computing this with a complicated binomial formula, let's estimate it with a simulation.

Simulation: P(at least 8 out of 10 free throws made) when P(make) = 0.70

  1. 1

    Step 1 — Define the Problem

    We want to estimate the probability that the player makes 8, 9, or 10 out of 10 free throws, given that each individual shot has a 70% chance of going in.
  2. 2

    Step 2 — Choose a Random Device and Mapping

    Use a random number generator that produces integers from 1 to 10. Let the numbers 1 through 7 represent a made shot (7 out of 10 = 70%), and let 8, 9, 10 represent a missed shot (30%).
    1–7 = make, 8–10 = miss
  3. 3

    Step 3 — Define One Trial

    One trial consists of generating 10 random integers (one per free throw), counting how many fall between 1 and 7, and recording whether that count is ≥ 8.
  4. 4

    Step 4 — Run Trials (Example: 20 Trials Shown)

    We ran 20 trials. Here are the counts of made shots per trial: 8, 6, 7, 9, 5, 7, 8, 7, 6, 10, 7, 8, 6, 7, 5, 9, 7, 8, 6, 7. Out of these 20 trials, the ones with 8 or more makes are: Trial 1 (8), Trial 4 (9), Trial 7 (8), Trial 10 (10), Trial 12 (8), Trial 16 (9), Trial 18 (8). That is 7 successes out of 20 trials.
    7 successes out of 20 trials
  5. 5

    Step 5 — Compute Experimental Probability

    P̂ = 7 / 20 = 0.35. So based on 20 trials, we estimate a 35% chance the player makes at least 8 out of 10 free throws.
    P̂ = 0.35
  6. 6

    Step 6 — Evaluate Accuracy

    With only 20 trials, the margin of error is about 1/√20 ≈ 0.224, which is quite large. To improve accuracy, we could run 500 trials (margin ≈ 0.045) or even 2,000 trials (margin ≈ 0.022). For reference, the exact binomial answer is about 0.3828, so our estimate of 0.35 is in the ballpark but could be refined with more trials.
    Margin of error ≈ 0.224 — need more trials for precision

SECTION 7

Strengths and Limitations of Simulation

Simulation is an incredibly flexible tool, but like any method, it has trade-offs. Understanding when to use simulation versus an exact calculation is an important part of statistical reasoning.

StrengthsLimitations
Works even when no formula exists or the formula is too complex to apply.Only gives an estimate, not an exact answer. Results vary each time you run it.
Easy to set up with a calculator, spreadsheet, or simple code.Requires many trials to achieve high accuracy (hundreds or thousands).
Highly adaptable — can model multi-step, conditional, or non-standard scenarios.Accuracy depends on having a correctly designed model; a flawed mapping leads to flawed results.
Builds intuition about how randomness actually behaves.Cannot prove a probability exactly — only approximate it.

Comparison of simulation strengths and limitations

✦

KEY TAKEAWAY

Simulation is like using a GPS navigation app: it gives you a very good estimate of your arrival time based on real-time data, but it is never perfectly exact because traffic can shift unpredictably. The more data the app collects (more trials), the better its predictions become. When an exact road map (formula) exists, you should use it — but when the route is too complicated, GPS (simulation) is your best friend.

SECTION 8

Connection to Advanced Probability & Statistics

The simulation techniques you learn here are the foundation for more powerful statistical methods that you will encounter in AP Statistics, college courses, and professional fields. The table below shows how the concepts in this lesson connect to their more advanced counterparts.

This LessonAdvanced Version
Experimental probability (P̂ = s / n)Sample proportion with confidence intervals (AP Statistics)
Law of Large Numbers (informal)Formal Law of Large Numbers with rigorous proof (Probability Theory)
Margin of error ≈ 1/√nStandard error of a proportion: SE = √[P̂(1 − P̂)/n]
Random number generatorsMonte Carlo simulations in physics, finance, and machine learning
Evaluating accuracy with trial countPower analysis and sample size determination (Research Methods)

How today's concepts scale into college-level and professional statistics

In AP Statistics, you will formalize the margin of error using the standard error and construct confidence intervals that give a range of plausible values for the true probability. In college and beyond, Monte Carlo simulations are used to price financial derivatives, model climate systems, and train artificial intelligence. The intuition you build now — that more random trials yield better estimates — is the same intuition that drives all of these applications.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Why does increasing the number of trials in a simulation generally improve the estimate of a probability? What law guarantees this?
Show answer
The Law of Large Numbers states that as the number of trials increases, the experimental probability converges toward the true (theoretical) probability. With few trials, individual random outcomes can skew the estimate significantly. With many trials, the impact of any single unusual outcome is diluted, so the proportion of successes stabilizes near the actual probability. This is why statisticians recommend running hundreds or thousands of trials rather than a handful.

Question 2: BASIC CALCULATION

A student runs a simulation of 200 trials to estimate the probability of a certain event. The event occurs in 56 of those trials. (a) What is the experimental probability? (b) What is the approximate margin of error?
Show answer
(a) P̂ = 56 / 200 = 0.28. (b) Margin of error ≈ 1 / √200 ≈ 1 / 14.14 ≈ 0.071. So the experimental probability is about 0.28 with a margin of error of roughly ±0.07, meaning the true probability is likely somewhere between about 0.21 and 0.35. If the student wants a more precise estimate, they would need to run more trials.

Question 3: INTERMEDIATE

You want to estimate the probability that a family with 4 children has at least 3 girls, assuming P(girl) = 0.50 for each child. Describe how you would design a simulation using a standard six-sided die, and explain what constitutes one trial.
Show answer
Since P(girl) = 0.50, you need a random device that has a 50% chance for each outcome. With a six-sided die, let odd numbers (1, 3, 5) represent a girl and even numbers (2, 4, 6) represent a boy — each has a 3/6 = 0.50 probability. One trial consists of rolling the die 4 times (once for each child) and recording the number of odd rolls. A trial is counted as a "success" if 3 or 4 of the 4 rolls are odd. After running many trials (e.g., 500), you compute P̂ = (number of successes) / 500. The theoretical answer is 5/16 ≈ 0.3125, so your simulation should produce an estimate near that value.

Question 4: APPLIED

A weather app claims there is a 30% chance of rain each day for the next 5 days (independently). You want to estimate the probability that it rains on exactly 2 of the 5 days. Design a simulation using a random number generator that produces integers from 1 to 10, and explain how you would run and evaluate 400 trials.
Show answer
Let random integers 1–3 represent rain (3 out of 10 = 30%) and integers 4–10 represent no rain (70%). One trial consists of generating 5 random numbers and counting how many are between 1 and 3 inclusive. A success is when exactly 2 of the 5 numbers fall in the range 1–3. Run 400 trials and count the successes. P̂ = (successes) / 400. The margin of error would be approximately 1/√400 = 0.05, meaning the estimate is likely within ±0.05 of the true probability. For reference, the exact binomial probability is C(5,2) × 0.30² × 0.70³ ≈ 0.3087. With 400 trials, you should expect an estimate between about 0.26 and 0.36.

Question 5: CRITICAL THINKING

Two students both simulate the same probability. Student A runs 50 trials and gets P̂ = 0.40. Student B runs 800 trials and gets P̂ = 0.34. (a) Whose estimate is likely more accurate and why? (b) Is it possible that the true probability is 0.37? Justify using margins of error. (c) What would you recommend to settle the disagreement?
Show answer
(a) Student B's estimate is almost certainly more accurate because 800 trials yield a much smaller margin of error than 50 trials. Specifically, Student A's margin of error ≈ 1/√50 ≈ 0.141, while Student B's ≈ 1/√800 ≈ 0.035. (b) Student A's range is roughly 0.26 to 0.54, and Student B's range is roughly 0.305 to 0.375. Since 0.37 falls within both ranges, it is plausible that the true probability is 0.37. (c) To settle the disagreement, they could combine their data (850 total trials) or run an even larger simulation — say, 5,000 trials — which would give a margin of error of about 0.014 and a much more precise estimate. The key insight is that disagreements between simulations are often resolved simply by increasing the total number of trials.

SUMMARY

Lesson Summary

Summary

A probability simulation uses a random device (coin, die, random number generator) to model a real-world situation and then repeats the experiment over many trials to estimate a probability. The experimental probability is calculated as P̂ = successes ÷ trials. The Law of Large Numbers guarantees that this estimate approaches the true probability as the number of trials grows.

To evaluate the accuracy of your estimate, use the margin of error approximation of 1/√n. More trials shrink the margin but with diminishing returns — you must quadruple the number of trials to halve the error. The six-step process — define the problem, choose a random device, map outcomes, run trials, compute P̂, and evaluate accuracy — gives you a reliable framework for any simulation you encounter.

Varsity Tutors • Math 2 • Simulating Probabilities