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.

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?

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.

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.

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.

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̂ = 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)
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
Margin 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.

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.

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.
Margin of error shrinks as n increases, but the improvement slows down.
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

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
Step 1 — Define the ProblemWe 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
Step 2 — Choose a Random Device and MappingUse 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
Step 3 — Define One TrialOne 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
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
Step 5 — Compute Experimental ProbabilityP̂ = 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
Step 6 — Evaluate AccuracyWith 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

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.

Comparison of simulation strengths and limitations
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.
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.

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.

How today's concepts scale into college-level and professional statistics
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)

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.

Practice Problems

PROBLEM 1CONCEPTUAL
Why does increasing the number of trials in a simulation generally improve the estimate of a probability? What law guarantees this?
PROBLEM 2BASIC 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?
PROBLEM 3INTERMEDIATE
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.
PROBLEM 4APPLIED
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.
PROBLEM 5CRITICAL 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?

Lesson 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