01 / 21

Simulating
Probabilities

Learn to design and run simulations that estimate probabilities, then evaluate how accurate those estimates really are.

Math 2

What Is a Simulation?

A simulation is an experiment that uses random devices: coins, dice, random number generators, or spinners to model a real-world situation. Instead of computing an exact probability with formulas, you run many trials and observe what happens.

Why Simulate Instead of Calculate?

Complex Situations
Some problems have too many outcomes to list. Simulation lets you explore them without exhaustive counting.
No Formula Needed
When the math is hard or unknown, you can still get a reliable estimate by running enough trials.
Verify Theory
Simulations confirm (or challenge) your calculated answers, building confidence in your reasoning.

Key Vocabulary

1
Trial: One complete run of the simulation from start to outcome.
2
Outcome: The result of a single trial (e.g., "Heads" or rolling a 4).
3
Relative Frequency: The fraction of trials that produced the event of interest: \(\frac{\text{successes}}{n}\).
4
Law of Large Numbers: As \( n \to \infty \), the relative frequency approaches the true probability.

The Law of Large Numbers

P = 0.5 0 0.5 1.0 0 50 100 150 200 Number of Trials (n) Rel. Freq. Volatile early Converges to P

Theoretical vs Experimental Probability

Theoretical Experimental
Source Mathematical reasoning Actual trials / simulation
Formula \( P(E) = \frac{\text{favorable}}{\text{total}} \) \( \hat{P}(E) = \frac{\text{successes}}{n} \)
Precision Exact Approximate (improves with more trials)
When to use All outcomes equally likely & countable Complex scenarios or verification

How to Design a Simulation

1
Identify the event whose probability you want to estimate.
2
Choose a random device that matches the real-world probabilities (coin, die, RNG, spinner).
3
Define one trial: what steps make up a single run, and what counts as a "success."
4
Run many trials (at least 30, ideally 100+). Record outcomes.
5
Calculate the relative frequency: \( \hat{P} = \frac{\text{successes}}{n} \).

Choosing the Right Device

The device must match the probabilities in the real situation. Each equally likely outcome of the device maps to an outcome in the problem.

Coin Flip
Two equally likely outcomes. Perfect for \( P = 0.5 \).
Die Roll
Six equally likely outcomes. Model \( P = \frac{1}{6}, \frac{1}{3}, \frac{1}{2} \), etc.
RNG (1-10)
Ten equally likely outcomes. Model any probability that is a multiple of 0.1.

Example 1: Flipping 3 Coins

Question: What is the probability of getting exactly 2 heads when flipping 3 fair coins?

H Coin 1 H Coin 2 T Coin 3 Trial result: HHT → 2 heads ✓ Repeat this trial many times

Example 2: Free Throw Streak

Question: A player makes \(80\%\) of free throws. What is the probability she makes all 5 shots in a set?

1
Device: Random digits 1-10. Digits \(1-8 = \text{make}\), digits \(9-10 = \text{miss}\).
2
One trial: Generate 5 random digits. Success = all five are \( \le 8 \).
3
Run \( n = 200 \) trials. Suppose 67 successes.
4
Estimate: \( \hat{P} = \frac{67}{200} = 0.335 \). Theoretical: \( 0.8^5 = 0.32768 \).

Example 3: The Birthday Problem

Question: In a class of 23 students, what is the probability that at least two share a birthday? This is hard to calculate directly: simulation to the rescue!

1
Device: RNG producing integers from 1 to 365 (each representing a day).
2
One trial: Generate 23 random days. Success = any duplicate found.
3
Run 1,000 trials. Count how many trials had at least one shared birthday.
4
Typical result: about 507 successes → \( \hat{P} \approx 0.507 \). The exact answer is \( \approx 0.5073 \).

Evaluating Accuracy

How do you know if your simulation estimate is any good? Two key strategies:

Increase n
More trials = smaller variation. Going from 50 to 500 trials dramatically narrows the estimate.
Repeat the Simulation
Run the entire simulation multiple times. If results cluster tightly, your estimate is stable.

Variability Shrinks with More Trials

P 0 0.5 1.0
\(n=10\)
\(n=50\)
\(n=200\)
\(n=1000\)
Sample Size Wide spread Tight cluster

The Simulation Workflow

1. Define the Event 2. Choose Device 3. Run n Trials 4. Count Successes 5. Calculate Relative Frequency

Common Mistakes

✕ Too Few Trials
Running only 10-20 trials gives wildly inaccurate estimates. Always aim for at least 100.
✕ Wrong Device Match
Using a coin for a \( P = 0.3 \) event. The device must mirror the real-world probability.
✕ Confusing Trial with Outcome
One trial may require multiple random events (e.g., 5 free throws). Don't stop after one flip.

Simulation Summary

Concept What It Means Example
Trial One complete run Flip 3 coins once
Success Outcome you are counting Exactly 2 heads
Relative Frequency \( \frac{\text{successes}}{n} \) \( \frac{38}{100} = 0.38 \)
Accuracy Improves as \( n \) grows \( n = 1000 \) beats \( n = 50 \)
Device Choice Must match real \( P \) RNG 1-10 for \( P = 0.7 \)

Question 1 of 5

A simulation of 200 trials produces 56 successes. What is the experimental probability?

Question 2 of 5

A soccer player scores on \(40\%\) of penalty kicks. Which random device best models one kick?

Question 3 of 5

According to the Law of Large Numbers, what happens as you increase the number of trials?

Question 4 of 5

You want to simulate the probability of rolling at least one 6 when rolling two dice. What is one trial?

Question 5 of 5

Two students each simulate the same event. Student A runs 50 trials and gets \( \hat{P} = 0.42 \). Student B runs 500 trials and gets \( \hat{P} = 0.36 \). Whose estimate is likely more accurate?