B. Probability Distributions · Discrete Probability DistributionsThe 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.
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 exampleExample 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).
- n = 20, so each value has probability 1/20.
- (a) P(X = 7) = 1/20 = 0.05.
- (b) X ≤ 5 means 1, 2, 3, 4, 5: 5 values, so 5/20 = 1/4.
- (c) Multiples of 3 up to 20: 3, 6, 9, 12, 15, 18: 6 values, so 6/20 = 3/10.
- (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.
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 exampleExample 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).
- n = 30 − 10 + 1 = 21.
- P(15 ≤ X ≤ 20) = (20 − 15 + 1)/21 = 6/21 = 2/7.
- X > 26 means 27, 28, 29, 30: 4 values. P = 4/21.
- E(X) = (10 + 30)/2 = 20.
n = 21; P(15 ≤ X ≤ 20) = 2/7; P(X > 26) = 4/21; E(X) = 20
Worked exampleExample 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.
- Each sector: probability 1/5.
- E(X) = (1 + 5 + 10 + 20 + 64)/5 = 100/5 = 20.
- P(X ≥ 10) = 3/5 (the values 10, 20 and 64).
- 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 exampleExample 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.
- Each integer 1 to 100 has probability 1/100.
- Let the 23 numbers 1 to 23 stand for "this species" (probability 23/100 = 0.23) and 24 to 100 stand for "another species".
- 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.
- 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 funA 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 activityIs 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).
- 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).
- Tally how many times each digit appears. Theory says about 90 × 1/9 = 10 each.
- Draw a frequency histogram. Is it flat? Find the mean of your 90 digits and compare with E(X) = (1 + 9)/2 = 5.
- 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
1X is a random integer from 1 to 50. Find P(X = 50) and E(X).
2X is a random integer from 1 to 50. Find P(X ≥ 41).
41 to 50 is 10 values: 10/50 = 1/5.
3A random integer is chosen from 0 to 9 (a random digit). Find P(the digit is odd) and E(X).
Odd digits 1, 3, 5, 7, 9: 5/10 = 1/2. E = (0 + 9)/2 = 4.5.
4How many integers are there from 25 to 60 inclusive?
5A spinner has 4 equal sectors worth 2, 4, 6 and 20. Find E(X).
6Which 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?
(a) and (c) are uniform. (b) is not: P(1 head) = 1/2 but P(0 heads) = 1/4.
7A 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?
Each student has probability 1/28, so 5/28.
More practice: warm-up
1In a uniform distribution with 10 values, what is the probability of each value?
2What is E(X) for a random integer from 1 to 9?
3What shape is the probability histogram of a uniform distribution?
4How many integers are there from 1 to 100 inclusive?
5Is the sum of two dice uniform?
No: 7 is the most likely sum.
More practice: on your own
1X is a random integer from −5 to 5 inclusive. Find n, P(X < 0) and E(X).
n = 11. Negative values −5 to −1: P = 5/11. E(X) = 0 (symmetric).
2X is a random integer from 100 to 199. Find P(X has a units digit of 7) and P(130 ≤ X ≤ 149).
n = 100. Units digit 7: 107, 117, ..., 197 = 10 values: 1/10. 130 to 149: 20 values: 1/5.
3A random integer X from 1 to n has E(X) = 30.5. Find n.
(1 + n)/2 = 30.5, so n = 60.
4A random digit X (0 to 9) is chosen and Y = 3X + 2. Find E(Y).
E(X) = 4.5, so E(Y) = 3(4.5) + 2 = 15.5.
5Describe how to simulate a basketball player who makes 72% of free throws using RANDBETWEEN(1,100).
Let 1 to 72 represent made and 73 to 100 represent missed. Each random integer is one shot.
Challenge
1X 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%.
X ≤ k includes k equally likely values out of n, so P = k/n. We need 10/n < 0.05, so n > 200: the smallest is n = 201.
2A 4-digit PIN is chosen uniformly at random from 0000 to 9999. Find the probability that all four digits are different.
There are 10⁴ = 10 000 equally likely PINs. Ones with all digits different: 10 × 9 × 8 × 7 = 5040. P = 5040/10 000 = 0.504.
3Two random digits (0 to 9) are chosen independently. Is their sum uniform? Find P(sum = 9) and P(sum = 0).
Not uniform. There are 100 equally likely pairs. Sum 9: (0,9), (1,8), ..., (9,0) = 10 pairs, P = 1/10. Sum 0: only (0,0), P = 1/100. Adding uniform variables gives a peaked distribution, just like two dice.
Check your understandingQuiz
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 teachersBig 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).