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.250.25. Generate an integer from 0000 to 9999, 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.2525/100=0.25

25–99

Does not request gift wrapping

75/100=0.7575/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.


Four connected boxes show coding outcomes, running one trial, repeating trials, and estimating a probability.


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:


p^=number of trials containing the target eventtotal number of completed trials.\widehat{p}=\frac{\text{number of trials containing the target event}}{\text{total number of completed trials}}.


Example: If at least two gift-wrapping requests occur in 159 of 600 complete trials, the estimated probability is 159/600=0.265159/600=0.265, or 26.5%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.2650.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.400.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 00 to 99, 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.400.40, the number assigned to bringing a cup is


0.40(10)=4.0.40(10)=4.


There must therefore be ________ cup digits. Starting from the lowest digit gives 0,1,2,30,1,2,3, with 4,5,6,7,8,94,5,6,7,8,9 representing no refillable cup.


The final assignment is digits 00–33 for bringing a cup and digits 44–99 for not bringing one. This gives probabilities 4/10=0.404/10=0.40 and 6/10=0.606/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 33 and 00 indicate cups, while 77 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,13,1,1,1,2,1. The full sequence of counts is therefore 2,1,2,0,3,1,1,1,2,12,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.


p^=successful trialscompleted trials=410=0.40.\widehat{p}=\frac{\text{successful trials}}{\text{completed trials}}=\frac{4}{10}=0.40.


Convert the decimal to a percentage:


0.40(100%)=40%.0.40(100\%)=40\%.


The estimated probability is 0.400.40, or 40%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 sports centre estimates that each returned rental item needs a minor repair with probability 0.150.15. A simulation generates integers from 0000 to 9999, all equally likely. Which assignment correctly models whether an item needs repair?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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.

Match each term
A.

A rule linking ranges of random numbers to outcomes in proportion to their chances

B.

The result of one random number has no effect on the result of the next

C.

A model that imitates a chance process with random numbers so its behaviour can be studied

D.

As runs accumulate, the observed relative frequency tends to settle near the true chance

E.

One complete repetition of the modelled process, ending with a single record of whether the event happened

F.

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

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A courier models each parcel as delayed with probability 0.200.20, independently of other parcels. Random digits 00 and 11 represent delay; digits 22–99 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.

TrialRandom digitsDelayed parcelsAt least one delayed
102
271
383
419
545
610

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice