If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## High school statistics

### Course: High school statistics>Unit 6

Lesson 4: Probability from simulations

# Simulation and randomness: Random digit tables

We can simulate events involving randomness like picking names out of a hat using tables of random digits. Tables of random digits can be used to simulate a lot of different real-world situations. Here's $2$ lines of random digits we'll use in this worksheet:
Line $1$: $96565\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}05007\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}16605\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}81194\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}14873\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}04197\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}85576\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}45195$
Line $2$: $11169\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}15529\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}33241\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}83594\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}01727\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}86595\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}65723\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}82322$
Things to know about random digit tables:
• Each digit is equally likely to be any of the $10$ digits $0$ through $9$.
• The digits are independent of each other. Knowing about one part of the table doesn't give away information about another part.
• The digits are put in groups of $5$ just to make them easier to read. The groups and rows have no special meaning. They are just a long list of random digits.

## Problem 1: Getting a random sample

There are $90$ students in a lunch period, and $5$ of them will be selected at random for cleaning duty every week. Each student receives a number $01-90$ and the school uses a random digit table to pick the $5$ students as follows:
• Start at the left of Line $1$ in the random digits provided.
• Look at $2$-digit groupings of numbers.
• If the 2-digit number is anything between $01$ and $90$, that student is assigned lunch duty. Skip any other $2$-digit number.
• Skip a $2$-digit number if it has already been chosen.
Line $1$:
Which $5$ students should be assigned cleaning duty?

## Problem 2: Doing a simulation

A cereal company is giving away a prize in each box of cereal and they advertise, "Collect all $6$ prizes!" Each box of cereal has $1$ prize, and each prize is equally likely to appear in any given box. Caroline wonders how many boxes it takes, on average, to get all $6$ prizes.
She decides to do a simulation using random digits as follows:
• Start at the left of Line $2$ in the random digits provided.
• Look at single digit numbers.
• The digits $1-6$ represent the different prizes.
• She ignores the digits $0,7,8,9$.
• One trial of the simulation is done when all $6$ digits have appeared.
• At the end of the trial, she counts how many digits it took for every digit $1-6$ to appear (ignoring the other digits).
Line $2$:
question a
How many boxes of cereal did it take to get all $6$ prizes?
boxes

question b
Caroline did some more trials of her simulation. Each trial, she recorded how many boxes it took to get all $6$ prizes. Her results are shown in the table below.
Trial #Number of boxes
$1$$12$
$2$$17$
$3$$15$
$4$$7$
$5$$20$
On average, how many boxes of cereal did it take Caroline to get all $6$ prizes?
boxes

question c
Caroline's friend Grant did his own simulation. He did his just like Caroline, but he did $20$ trials instead of $5$. On average, it took him $14.8$ boxes to get all $6$ prizes.
Whose results are more likely to give a closer estimate to the true average number of boxes it takes to get all $6$ prizes?

## Want to join the conversation?

• I still don’t understand how to assign random digits for a simulation. For example, if the problem gives you something like “Bob makes freethrow shots 70% of the time, and his coach wants to calculate the likelihood of Bob making his free throws 4 out of the 5 times”. How would you assign digits to that type of problem??
• Let each random digit represent one free throw. We could let a digit less than 7 represent making a free throw (note that this occurs with probability 7/10=70% since 7 of the 10 possible values from 0 to 9 are less than 7), and let a digit greater than or equal to 7 represent missing a free throw.

Now generate a larger number of separate groups of 5 random digits. Count the number of groups, and also count how many of these groups contain 4 or more digits that are less than 7 (or equivalently no more than 1 digit that is greater than or equal to 7) . The number of groups containing 4 or more digits that are less than 7, divided by the number of groups, is an estimate of the likelihood (or probability) of making at least 4 out of 5 free throws.

Example: let's look at the 16 groups of 5 random digits given in this lesson.

96565 05007 16605 81194 14873 04197 85576 45195 11169 15529 33241 83594 01727 86595 65723 82322

Out of these 16 groups, we find that 9 have 4 or more digits that are less than 7. So 9/16 is an estimate of the likelihood of making at least 4 out of 5 free throws.

By the way, the theoretical likelihood is
(5 choose 4)(0.7)^4 (0.3) + (5 choose 5)(0.7)^5 = 5*0.07203 + 1*0.16807 = 0.52822.

So the estimate 9/16 = 0.5625 is not bad, considering that we used only 16 groups of 5 random digits.
• So when assigning random digits, how do you know when to use double digits and when to use singe digits?
• How many digits you use all depends on your sample size. If you are assigning digits to a sample of 100 people, then you'll need double digits, all numbers from 0 to 99.
A general rule of thumb is to subtract your sample size by one and assign that many digits. So for a sample size of 20, you'll need the amount of digits in 19 (20 - 1), which is 2 digits.

Hope this helped.
• How could we solve Question A of problem 2 without using random tables?
(1 vote)
• I don't understand the first and third one about choosing numbers between 1-90 and why more chances for the prizes?
• it basically tries to say in a random sense what are the chances of 5 students to be assigned for cleaning duty. And in a random sense what are the chances of someone winning 6 prizes.
• I am still confused on how to do the first 2 questions.
• The reason I missed the first question the first time is because I included the number 96 when we were asked to just include the numbers 1 through 90. Does that help? For the second question you look at start at the beginning of the line of numbers and count from left to right until you have counted all the numbers 1 through 6. Afterward you count how many times it took you to get from 1 to 6 starting at the left (once again) and this time you're going to count all the numbers 1 through 6 (you're going to ignore any numbers above 6 because there were only 6 prizes that she needed to get) therefore once you count every number that it took (even counting repeating numbers) you come up with the answer of 12 boxes that it took. Does that make sense?
(1 vote)
• Is it just me or there is a typo in Problem 1 when the parameters are given? It says
'If the 2-digit number is anything between 01 and 90, that student is assigned LUNCH duty. Skip any other 2-digit number.'
Then the question goes on an asks about CLEANING duty. I spent a good ten minutes thinking about how I'm supposed to solve it with no cleaning duty related information.. So it's a bit confusing.
(1 vote)
• Yeah mate. Cleaning duty or Lunch duty, I think they are talking about ignoring numbers 0 and 91-99.
• How likely are three "1"s in sequence to appear in one table of random digits?
(1 vote)
• Assume every digit in the sequence is independent of each other, the digit generator is fair, so that would leave us with 3 digits in sequence.

Your question is a bit vague, but let us assume
we have a sequence of 10 digits.

We know, that the probability of 3 digits in sequence is
1/10 * 1/10 * 1/10 = 1/1000.

Now, let's look at the number of places in a sequence of 10 digits, where 3 ones can be placed.

111xxxxxxx
x111xxxxxx
...
xxxxxxx111

which leaves us with 8 possibilities.

So in total, we have 8 times 1/1000 = 8/1000 or
a probability of 1/125 so a bit less than 1%.