01 / 21

Simulation for
Probability

Learn how to estimate probabilities by running experiments many times, using random number generators and the power of repetition.

Finite Mathematics

What Is a Simulation?

A simulation is a method that uses random experiments to model a real-world process. Instead of calculating an exact probability with formulas, we run the experiment many times and observe what happens.

Model
Define a random process that mirrors the real situation you want to study.
Repeat
Run the experiment many times (called trials) to collect data.
Estimate
Use the results to estimate the probability of the event of interest.

Key Vocabulary

1
Trial: A single run of the simulation experiment.
2
Outcome: The result of a single trial.
3
Event: A specific outcome or set of outcomes you are interested in.
4
Relative Frequency: The fraction of trials in which the event occurs: \(\frac{\text{number of successes}}{\text{total trials}}\).
5
Random Number Generator (RNG): A tool that produces unpredictable numbers used to drive the simulation.

Why Simulation Matters

Many real-world probability problems are too complex for exact formulas. Simulation lets us tackle problems that would otherwise be unsolvable at the introductory level.

Weather
Meteorologists run thousands of atmospheric simulations to forecast rain probability.
Games
Game designers simulate millions of rounds to balance difficulty and fairness.
Medicine
Clinical researchers simulate drug trials to estimate treatment success rates.

The Law of Large Numbers

\( P = 0.5 \)
Number of Trials Relative Freq. 0 50 100 200 500 1000 0 0.5 1.0 Volatile early Converges to P

With few trials, results are volatile. With many trials, the estimate stabilizes near the true probability.

Experimental vs. Theoretical Probability

Experimental (Simulation) Theoretical (Calculated)
Method Run trials, observe outcomes Count favorable / total outcomes
Formula \(\frac{\text{successes}}{n}\) \(\frac{|E|}{|S|}\)
Precision Approximate (improves with more trials) Exact
When to Use Complex or unknown models All outcomes equally likely & countable
Example Flip a coin 1000 times \(P(\text{heads}) = \frac{1}{2}\)

How to Set Up a Simulation

1
Identify the event: Clearly state what probability you want to estimate.
2
Choose a model: Pick a random device (coin, die, RNG, random digit table) that matches the situation's probabilities.
3
Define one trial: Specify exactly what actions constitute a single run of the experiment.
4
Run many trials: Repeat the trial a large number of times (at least \( n \geq 100 \) for a reasonable estimate).
5
Calculate relative frequency: Divide the number of successful outcomes by the total trials: \(\hat{P}(E) = \frac{\text{successes}}{n}\).

Example 1: Coin Flip Simulation

Problem: Estimate the probability of getting exactly 2 heads when flipping a fair coin 3 times.

Trial 1 H H T Trial 2 T H T Trial 3 H T H Trial 4 T T H ... Count trials with exactly 2 heads Trials 1 and 3 have 2 heads: 2 out of 4 so far

Coin Flip: Scaling Up

Let's see how the estimate improves as we increase the number of trials:

Trials \( n \) Successes \(\hat{P}\) Error from \(\frac{3}{8}\)
1050.5000.125
50210.4200.045
200780.3900.015
10003740.3740.001

Example 2: Using a Random Digit Table

Problem: A basketball player makes 70% of her free throws. Estimate the probability she makes all 3 free throws in a bonus situation.

1
Assign digits: Let digits 0-6 = make (7 out of 10 = 70%), digits 7-9 = miss.
2
One trial: Read 3 consecutive digits from the table. If all 3 are in 0-6, the trial is a success.
3
Repeat: Perform many trials and count successes.

Random Digit Table: Walkthrough

Random Digits: 5 2 3 ✓ All 0-6 8 1 4 ✕ Has 8 6 0 5 ✓ All 0-6 2 9 1 ✕ Has 9 3 4 6 ✓ All 0-6 5 trials: 3 successes, 2 failures
Estimated \( P(\text{all 3 made}) = \frac{3}{5} = 0.60 \)
Only 5 trials: far from true value of \( 0.343 \)
Need hundreds of trials for a reliable estimate

Example 3: Dice Simulation

Problem: Estimate the probability that the sum of two dice equals 7.

Die 1 = 5 + Die 2 = 2 = 7
✓ \( \text{Sum} = 7 \)
This trial is a success. Record it and repeat.

Choosing the Right Model

The key to a good simulation is choosing a random device whose outcomes match the probabilities in the real situation:

Situation Model Mapping
50/50 outcome Fair coin H = success, T = failure
1 in 6 chance Fair die Roll 1 = success, 2-6 = failure
30% probability Digits 0-9 0-2 = success, 3-9 = failure
73% probability Digits 00-99 00-72 = success, 73-99 = failure

How Many Trials Do You Need?

Number of Trials Typical Error 0 0.05 0.10 0.15 0.13 10 0.09 50 0.05 100 0.02 1000

Common Mistakes

✕ Too Few Trials
Running only 5-10 trials and treating the result as the true probability. Need at least 100 trials for a reasonable estimate.
✕ Wrong Model
Using a coin (50/50) to simulate a 70% probability event. The model must match the actual probabilities.
✕ Not Independent
Reusing the same random digits for different parts of a trial. Each trial must use fresh random numbers.

Summary: Simulation at a Glance

Step Action Key Point
1. IdentifyState the event of interestBe specific
2. ModelChoose an appropriate random deviceProbabilities must match
3. Define TrialSpecify what counts as one trialOne complete run
4. RepeatRun many trials (\( n \geq 100 \))More trials = better estimate
5. CalculateCompute \(\hat{P} = \frac{\text{successes}}{n}\)This is your estimate

Question 1 of 5

A student wants to simulate an event with probability 40% using single digits (0-9). Which digit assignment is correct?

Question 2 of 5

A simulation of 200 coin flips yielded 112 heads. What is the experimental probability of heads?

Question 3 of 5

Which statement best describes the Law of Large Numbers?

Question 4 of 5

To simulate a situation where there is a 1 in 6 chance of winning, which model is most appropriate?

Question 5 of 5

A student runs a simulation with 20 trials and gets an estimated probability of 0.65. The true probability is \( 0.50 \). What should the student do?