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.

Main content

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: 9656505007166058119414873041978557645195
Line 2: 1116915529332418359401727865956572382322
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 0190 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:  9656505007166058119414873041978557645195
Which 5 students should be assigned cleaning duty?
Choose 1 answer:

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 16 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 16 to appear (ignoring the other digits).
Line 2:  1116915529332418359401727865956572382322
question a
How many boxes of cereal did it take to get all 6 prizes?
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
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
112
217
315
47
520
On average, how many boxes of cereal did it take Caroline to get all 6 prizes?
If necessary, round your answer to the nearest tenth.
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
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?
Choose 1 answer:

Want to join the conversation?

  • aqualine ultimate style avatar for user Aarti Jain
    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??
    (9 votes)
    Default Khan Academy avatar avatar for user
    • primosaur seed style avatar for user Ian Pulizzotto
      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.
      (42 votes)
  • aqualine ultimate style avatar for user Aarti Jain
    So when assigning random digits, how do you know when to use double digits and when to use singe digits?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Owen S
      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.
      (10 votes)
  • duskpin ultimate style avatar for user Igor
    How could we solve Question A of problem 2 without using random tables?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • piceratops seed style avatar for user Darriel Meadows
    I don't understand the first and third one about choosing numbers between 1-90 and why more chances for the prizes?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user zsofivamos
    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.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user 9725952
    I am still confused on how to do the first 2 questions.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Saul Chavez
      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?
      (2 votes)
  • blobby green style avatar for user denilsonfbar
    How likely are three "1"s in sequence to appear in one table of random digits?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • leaf grey style avatar for user dashpointdash
      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%.
      (4 votes)
  • blobby green style avatar for user 20wati01
    How did they get 12 boxes and not 14?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • aqualine tree style avatar for user Zahara Sherif
    I don't understand the instruction used for question A, is there another way to solve the Simulation problems?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user 20wati01
    I'm still confused on Problem 2 and why it is 12 boxes and not 14.
    (2 votes)
    Default Khan Academy avatar avatar for user