Simulation of Random Processes
A simulation of a random process uses chance outcomes to imitate a situation whose result is uncertain. You can use it to estimate a probability when listing every possible outcome would be inconvenient. For example, a shop might estimate how often at least two customers in a group request gift wrapping. The important work is deciding what the random outcomes represent and what counts as one complete repetition.
Build a probability model
Start by identifying the possible outcomes and their probabilities. Choose a chance device, such as random digits or software, and assign its outcomes so that the model reproduces those probabilities. A random result is useful only if its coding represents the situation appropriately.
Example: Suppose each customer requests gift wrapping with probability 0.25. Generate an integer from 00 to 99, with all 100 integers equally likely. The following assignment gives gift wrapping 25 of the 100 possible outcomes.
Random integer | Customer outcome | Probability |
|---|---|---|
00–24 | Requests gift wrapping | 25/100=0.25 |
25–99 | Does not request gift wrapping | 75/100=0.75 |
Every possible integer has exactly one meaning. Overlapping ranges would make some results ambiguous, while unassigned integers would require an explicit rule for handling them. With this assignment, neither problem occurs.
If customer decisions are assumed independent, use a fresh independent integer for each customer. If the situation instead has probabilities that change after earlier outcomes, the simulation must reproduce those changes.
Define and repeat a complete trial
A trial is one complete simulated repetition of the situation described by the probability question. Its length depends on the event you want to study.
For the gift-wrapping example, suppose the target is at least two requests among four customers. One trial requires four random integers, one for each customer. Translate all four integers into customer outcomes, count the requests, and record whether the target event occurred. A single customer's result is only part of this trial.
Repeat the complete trial many times using fresh random outcomes. Start each trial under the same initial conditions, while preserving any changing probabilities required within a trial. Record the target event once per trial, even if several individual outcomes contribute to it.
Read the result
The estimated probability is the proportion of complete trials in which the target event occurs:
Example: If at least two gift-wrapping requests occur in 159 of 600 complete trials, the estimated probability is 159/600=0.265, or 26.5%. The numerator counts qualifying groups, rather than the total number of requests across all groups.
Another run may produce a different estimate because the simulated outcomes are random. For independent repeated trials of the same model, more repetitions generally reduce random variation in the estimate. However, more trials do not repair an incorrect model, and a larger run is not guaranteed to be closer to the true probability every time.
Report the estimate with its context and trial count. Saying that the model produced the event in 159 of 600 trials communicates more than presenting 0.265 alone. The estimate is evidence about the model's probability, not a promise about the next group.
What to remember
- Assign random outcomes in the correct proportions.
- Define one complete trial from the event being estimated.
- Preserve the stated independence or changing probabilities.
- Divide qualifying trials by all completed trials.
- Use more repetitions for greater stability, while checking the model itself.
Example: Refillable cups at a café
A café assumes that each customer brings a refillable cup with probability 0.40, independently of other customers. It wants to estimate the probability that at least two customers in a group of three bring refillable cups. A success in this simulation means that the complete group meets that target.
Each row below contains three independent random digits from 0 to 9, one per customer. All ten digits are equally likely at each draw. The rows represent ten complete trials.
Trial | Random digits |
|---|---|
1 | 307 |
2 | 482 |
3 | 135 |
4 | 669 |
5 | 023 |
6 | 741 |
7 | 850 |
8 | 294 |
9 | 318 |
10 | 506 |
a) Assign random digits to bringing a refillable cup or not bringing one. Use the lowest possible digits for bringing a cup.
The chance device has ________ equally likely digits. To represent probability 0.40, the number assigned to bringing a cup is
There must therefore be ________ cup digits. Starting from the lowest digit gives 0,1,2,3, with 4,5,6,7,8,9 representing no refillable cup.
The final assignment is digits 0–3 for bringing a cup and digits 4–9 for not bringing one. This gives probabilities 4/10=0.40 and 6/10=0.60.
b) Identify the successful trials and find the total number of successes.
Read every digit separately using the assignment. In trial 1, digits 3 and 0 indicate cups, while 7 does not, so the cup count is ________. Trial 2 has one cup, trial 3 has two, and trial 4 has ________.
For trials 5 through 10, the cup counts are respectively 3,1,1,1,2,1. The full sequence of counts is therefore 2,1,2,0,3,1,1,1,2,1.
A success requires at least two cups, including three cups. Trials 1, 3, 5, and 9 meet this condition.
There are 4 successful trials.
c) Calculate the estimated probability as a decimal and a percentage. Explain what the estimate describes.
The denominator is the number of complete groups, which is ________. Although 30 customers were simulated, the target event concerns groups of three.
Convert the decimal to a percentage:
The estimated probability is 0.40, or 40%. Under the stated model, this run suggests that about 40% of groups of three meet the target. Ten trials give a rough estimate; another run can differ. The result does not mean that exactly 40% of the next ten groups will qualify.
A probability simulation uses random numbers to imitate a chance process, and its results are reported with specific vocabulary. Match each term to the description that fits it.
A rule linking ranges of random numbers to outcomes in proportion to their chances
The result of one random number has no effect on the result of the next
A model that imitates a chance process with random numbers so its behaviour can be studied
As runs accumulate, the observed relative frequency tends to settle near the true chance
One complete repetition of the modelled process, ending with a single record of whether the event happened
The number of runs in which the event occurred divided by the total number of complete runs
Independence
Experimental probability
Simulation
Trial
Assignment of digits
Law of large numbers
A courier models each parcel as delayed with probability 0.20, independently of other parcels. Random digits 0 and 1 represent delay; digits 2–9 represent no delay. One trial models two parcels, using the two digits shown in order. Complete the table with the exact number of delayed parcels and either yes or no for whether at least one parcel is delayed.
| Trial | Random digits | Delayed parcels | At least one delayed |
| 1 | 02 | ||
| 2 | 71 | ||
| 3 | 83 | ||
| 4 | 19 | ||
| 5 | 45 | ||
| 6 | 10 |