Learn how to use simulation to model random processes, understand probability, and apply the Law of Large Numbers to predict long-term patterns. This guide covers sampling methods and using random number generators.
Chance is an ever-present force in our lives, from the coin toss that decides a football game's kickoff to the genetic lottery that determines our physical traits. While individual instances of chance can feel chaotic, there is an underlying mathematical structure to this behavior. By using statistical tools, we can move from simply observing luck to predicting long-term patterns. One of the most effective ways to bridge the gap between unpredictable individual events and predictable long-term patterns is through simulation.
Understanding Randomness and Probability
To master simulation, we must first understand the nature of the phenomena we are trying to imitate. This begins with the concept of a random process. A random process is a mechanism that generates outcomes determined purely by chance.
A defining characteristic of a random process is its dual nature: it is unpredictable in the short run, but it exhibits a regular and predictable pattern in the long run. For example, if you toss a coin ten times, you might get a run of five heads in a row, which feels "unlucky" or "non-random." However, if you toss that same coin ten thousand times, the proportion of heads will inevitably settle near a specific value.
This long-term stability is expressed through probability. Probability is a numerical value between 0 (the event never occurs) and 1 (the event always occurs). In the context of repeated trials, we define probability as the long-run relative frequency of an outcome.
A simulation showing the proportion of heads in coin tosses over time, with adjustable probability of heads and number of tosses.
The principle that guarantees this stability is the Law of Large Numbers. This law states that as we observe more and more trials of a random process, the proportion of times a specific outcome occurs will approach its actual probability.
These graphs illustrate the proportion of heads in coin tosses over increasing numbers of tosses. Graph (a) shows the proportion over 10 tosses, while graph (b) shows it over 500 tosses, demonstrating convergence towards 0.5.
The Simulation Process
A simulation is a method used to imitate a random process so that the simulated outcomes are consistent with real-world outcomes. Instead of waiting for real-world events to unfold (which might be slow, expensive, or impossible), we use "random devices"—such as dice, cards, or computer-generated numbers—to model the process.
To conduct a valid simulation, you must follow a structured three-step procedure:
Describe one trial: Clearly define how you will use a random device to perform a single repetition of the process. You must also specify exactly what data will be recorded at the end of that trial.
Perform many trials: Repeat the process numerous times. The more trials you perform, the more closely your results will adhere to the Law of Large Numbers.
Analyze results: Use the accumulated data to estimate the probability of the event in question and determine if observed real-world outcomes are statistically unusual.
Example: The "1 in 6 Wins" Game
Imagine a soda company claims that "1 in 6 bottles wins a prize." To test this, a class of 30 students buys one bottle each, and only two students win. Is the company lying?
To simulate this, we can use a six-sided die:
One trial: Roll a die 30 times. Let the number 6 represent a winner and 1 through 5 represent a non-winner. Record the total number of winners.
Many trials: Repeat this 30-roll process 40 times.
Analysis: If the simulation shows that getting 2 or fewer winners happens frequently (e.g., 10% of the time), then the company's claim is plausible.
A dot plot showing the distribution of data points.
Implementation Details and Best Practices
When designing a simulation, the technical details of how you select your "random" data are critical to the validity of your results.
Sampling Methods: With vs. Without Replacement
You must determine if your simulation involves sampling with replacement or sampling without replacement:
Sampling with replacement: Outcomes can repeat. For example, if you are simulating collecting NASCAR cards from thousands of cereal boxes, finding a specific driver in one box doesn't change the probability of finding them in the next.
Sampling without replacement: Once an outcome is selected, it cannot be selected again in that same trial. For example, if you are simulating a lottery for 95 students, once a student's name is drawn, you must ignore any repeated numbers for that same trial to ensure the same person doesn't win twice.
Using Random Number Generators and Tables
Modern simulations often use a random number generator to produce integers quickly. However, you may also use a table of random digits.
AP® Exam Tip: When using a table of random digits, ensure every label is the same length. If you are labeling students from 1 to 95, use 01 to 95 rather than 1 to 95 to ensure consistency and clarity in your design.
Summary Table of Concepts
Concept
Definition
Random Process
A process where outcomes are determined by chance; unpredictable in short term, predictable in long term.
Probability
A value between 0 and 1 representing the long-run relative frequency of an outcome.
Law of Large Numbers
The principle that as trials increase, the observed proportion approaches the true probability.
Simulation
An imitation of a random process used to estimate probabilities.
Keep reading for free.
Create an account to finish this reading and make it part of your study routine.