Grade by Grade
B. Probability Distributions · Discrete Probability Distributions

The Discrete Uniform Distribution

B1.7 B1.1 B1.2About 60 minutes
Learning goals
  • I can recognize situations that give a discrete uniform distribution.
  • I can find probabilities for a uniform random variable, including over a range of values.
  • I can find the expected value of a uniform distribution, using (a + b)/2 for consecutive integers.
  • I can use uniform random numbers to model (simulate) other events.

Words to know

discrete uniform distribution
A distribution in which each of n possible values has the same probability, 1/n.
random integer
A whole number chosen so that every allowed value is equally likely, for example with RANDBETWEEN(1, 20) in a spreadsheet.
inclusive
Including both endpoints. The integers from 10 to 30 inclusive are 30 − 10 + 1 = 21 numbers.

Every value equally likely

Roll a fair die. Pick a raffle ticket from a well-mixed drum. Ask a calculator for a random integer from 1 to 100. In each case, every possible value has the same chance. This is the simplest probability distribution, the discrete uniform distribution.

If X can take n different values, all equally likely, then

P(X = x) = 1/n for each of the n values.

The probability histogram is flat: every bar has the same height.

1234567811/821/831/841/851/861/871/881/8P(X = x) = 1/8 for x = 1, 2, ..., 8x
A spinner with 8 equal sectors gives a uniform distribution on 1 to 8. Every bar of the probability histogram has height 1/8, and the 8 bars add to 1.

Expected value of a uniform distribution

If the values are the consecutive integers a, a + 1, ..., b, then there are n = b − a + 1 values and the histogram is symmetric about the middle. So

E(X) = (a + b)/2,

the average of the smallest and largest values. For a die (a = 1, b = 6), E(X) = 7/2 = 3.5, as you found in lesson 3.

If the values are not consecutive (for example a spinner with sectors 2, 4, 6, 8, or 1, 5, 20), use the general formula E(X) = Σ x·P(x) = (sum of the values)/n.

Worked example

Example 1: A random number generator

A spreadsheet picks a random integer X from 1 to 20 inclusive. Find (a) P(X = 7), (b) P(X ≤ 5), (c) P(X is a multiple of 3), (d) E(X).

  1. n = 20, so each value has probability 1/20.
  2. (a) P(X = 7) = 1/20 = 0.05.
  3. (b) X ≤ 5 means 1, 2, 3, 4, 5: 5 values, so 5/20 = 1/4.
  4. (c) Multiples of 3 up to 20: 3, 6, 9, 12, 15, 18: 6 values, so 6/20 = 3/10.
  5. (d) E(X) = (1 + 20)/2 = 10.5.

(a) 1/20; (b) 1/4; (c) 3/10; (d) 10.5

Probabilities over a range

For a uniform variable on consecutive integers, P(c ≤ X ≤ d) is just

(number of integers from c to d) ÷ n = (d − c + 1)/n.

The "+ 1" is the most common place to slip: from 15 to 20 inclusive there are 6 integers, not 5.

10111213141516171819202122232425262728293015 to 20: 20 − 15 + 1 = 6 valuesX is uniform on the 21 integers 10, 11, ..., 30
Count the values, do not subtract the endpoints. The shaded dots 15 to 20 are 6 of the 21 equally likely values, so P(15 ≤ X ≤ 20) = 6/21 = 2/7.
Worked example

Example 2: Uniform on 10 to 30

X is a random integer from 10 to 30 inclusive. Find n, P(15 ≤ X ≤ 20), P(X > 26) and E(X).

  1. n = 30 − 10 + 1 = 21.
  2. P(15 ≤ X ≤ 20) = (20 − 15 + 1)/21 = 6/21 = 2/7.
  3. X > 26 means 27, 28, 29, 30: 4 values. P = 4/21.
  4. E(X) = (10 + 30)/2 = 20.

n = 21; P(15 ≤ X ≤ 20) = 2/7; P(X > 26) = 4/21; E(X) = 20

Worked example

Example 3: Uniform but not consecutive

A game spinner has 5 equal sectors worth 1, 5, 10, 20 and 64 points. Find the expected score per spin and the probability of scoring at least 10.

  1. Each sector: probability 1/5.
  2. E(X) = (1 + 5 + 10 + 20 + 64)/5 = 100/5 = 20.
  3. P(X ≥ 10) = 3/5 (the values 10, 20 and 64).
  4. Note: (a + b)/2 = (1 + 64)/2 = 32.5 would be wrong here, because the values are not evenly spaced.

E(X) = 20 points; P(X ≥ 10) = 3/5

Is it really uniform?

Check that every value is equally likely. The sum of two dice is not uniform (7 is six times as likely as 2). The month of a randomly chosen person's birthday is not exactly uniform, because months have different numbers of days. A well-shuffled deck, a fair die and a computer's random integer function are good uniform models.

Worked example

Example 4: Using uniform random numbers to simulate an event

About 23% of the fish in a lake are a certain species. Explain how to use random integers from 1 to 100 to simulate catching 5 fish, and say what each run of 5 numbers represents.

  1. Each integer 1 to 100 has probability 1/100.
  2. Let the 23 numbers 1 to 23 stand for "this species" (probability 23/100 = 0.23) and 24 to 100 stand for "another species".
  3. Generate 5 random integers. Count how many are 23 or less. That count is one simulated value of X = number of this species among 5 fish.
  4. Repeat many times and build a frequency table of X. (Lesson 10 develops simulation fully, and the binomial lessons give the exact answer.)

Uniform random integers can model any probability: assign the right number of values to each outcome. Here 23 of the 100 values represent a success.

Just for fun

A fair die is the most democratic object you own: every face gets exactly one vote, and the uniform distribution is just the election result.

Hands-on activity

Is your random number generator uniform?

You need: a calculator or phone with a random-number function, a spreadsheet (Google Sheets or Excel), or a deck of cards with the 10s and face cards removed (36 cards: ace = 1 to 9, four of each).

  1. Generate 90 random digits from 1 to 9 (spreadsheet: type =RANDBETWEEN(1,9) and fill down 90 cells; cards: draw, record, replace and shuffle each time).
  2. Tally how many times each digit appears. Theory says about 90 × 1/9 = 10 each.
  3. Draw a frequency histogram. Is it flat? Find the mean of your 90 digits and compare with E(X) = (1 + 9)/2 = 5.
  4. Without replacing cards, would the draws still be uniform each time? Try drawing 9 cards without replacement and think about why the probabilities change.

What to look for: counts between about 4 and 16 are normal for 90 draws; the histogram is "roughly flat" but never perfectly so. The mean should be within about half a unit of 5. Without replacement, the probability of each digit changes after each draw (this dependence leads to the hypergeometric distribution in lesson 8).

Your turn

1

X is a random integer from 1 to 50. Find P(X = 50) and E(X).

2

X is a random integer from 1 to 50. Find P(X ≥ 41).

3

A random integer is chosen from 0 to 9 (a random digit). Find P(the digit is odd) and E(X).

4

How many integers are there from 25 to 60 inclusive?

5

A spinner has 4 equal sectors worth 2, 4, 6 and 20. Find E(X).

6

Which of these is uniform: (a) the number on a fair 12-sided die; (b) the number of heads in 2 coin tosses; (c) the suit of a card drawn from a full deck?

7

A class of 28 draws one student's name from a hat for a prize. What is the probability that the winner is one of the 5 students in the chess club?

More practice: warm-up

1

In a uniform distribution with 10 values, what is the probability of each value?

2

What is E(X) for a random integer from 1 to 9?

3

What shape is the probability histogram of a uniform distribution?

4

How many integers are there from 1 to 100 inclusive?

5

Is the sum of two dice uniform?

More practice: on your own

1

X is a random integer from −5 to 5 inclusive. Find n, P(X < 0) and E(X).

2

X is a random integer from 100 to 199. Find P(X has a units digit of 7) and P(130 ≤ X ≤ 149).

3

A random integer X from 1 to n has E(X) = 30.5. Find n.

4

A random digit X (0 to 9) is chosen and Y = 3X + 2. Find E(Y).

5

Describe how to simulate a basketball player who makes 72% of free throws using RANDBETWEEN(1,100).

Challenge

1

X is uniform on the integers 1 to n. Show that P(X ≤ k) = k/n for k = 1, ..., n, and use it to find the smallest n so that P(X ≤ 10) is less than 5%.

2

A 4-digit PIN is chosen uniformly at random from 0000 to 9999. Find the probability that all four digits are different.

3

Two random digits (0 to 9) are chosen independently. Is their sum uniform? Find P(sum = 9) and P(sum = 0).

Check your understanding

Quiz

1.

X is a random integer from 1 to 40. What is P(X = 13)?

2.

What is E(X) for a random integer from 5 to 25 inclusive?

3.

X is a random integer from 1 to 30. What is P(11 ≤ X ≤ 20)?

4.

Which situation gives a uniform distribution?

5.

A spinner has 4 equal sectors worth 1, 2, 3 and 10. What is E(X)?

6.

How many integers are there from 18 to 45 inclusive?

For parents and teachers

Big idea (B1.7, B1.1): in a discrete uniform distribution every value has probability 1/n. For consecutive integers a to b, there are b − a + 1 values and the expected value is (a + b)/2. Uniform random numbers are also the basic tool for simulating any other probability.

How to help: ask your teen to count "how many whole numbers from 15 to 20?" on their fingers: it is 6, not 5. Look at a random-number feature on a phone or calculator together.

Common difficulties:

  • Forgetting the "+ 1" when counting integers in a range.
  • Using (a + b)/2 when the values are not evenly spaced.
  • Assuming any situation with a list of values is uniform (two-dice sums are not).