Grade by Grade
B. Probability Distributions · Discrete Probability Distributions

Discrete Random Variables and Probability Distributions

B1.1About 70 minutes
Learning goals
  • I can explain what a random variable is and tell a discrete random variable from a continuous one.
  • I can list the values a discrete random variable can take and find the probability of each value.
  • I can build a probability distribution table and check that its probabilities add to 1.
  • I can use a distribution table to find probabilities such as P(X ≥ 4) or P(2 < X ≤ 5).

Words to know

random variable
A variable whose value is a number decided by the outcome of a random experiment. It is written with a capital letter, such as X.
discrete random variable
A random variable that can take only separate, countable values (usually whole numbers), such as the number of heads in 3 tosses.
continuous random variable
A random variable that can take any value in an interval, such as a person's height or a waiting time.
probability distribution
A list, table, graph or formula that gives the probability of every possible value of a random variable.
P(X = x)
The probability that the random variable X takes the particular value x. Capital X is the variable; small x is one of its values.

From outcomes to numbers

In the unit Probability you listed sample spaces such as {H, T} or all 36 rolls of two dice, and you found probabilities of events. In this unit we go one step further. Instead of asking about outcomes, we ask about numbers that come from outcomes.

Toss three coins. The outcome might be HTH. But often you only care about how many heads you got. That number (here, 2) is the value of a random variable.

A random variable is a rule that gives a number to every outcome of a random experiment. We name random variables with capital letters (X, Y, N) and their values with small letters (x, y, n). So "X = 2" means "the random variable X came out as 2", and P(X = 2) is the probability of that.

outcome (sample space)value of XP(X = x)HHHHHTHTHTHHHTTTHTTTHTTT01/813/823/831/8X = number of heads in 3 tosses
Every one of the 8 outcomes is sent to one value of X. Three outcomes land on X = 2, so P(X = 2) = 3/8. The random variable groups outcomes by the number we care about.

Discrete or continuous?

A random variable is discrete if you can list its possible values, with gaps between them. Usually it counts something.

  • the number of heads in 3 tosses (0, 1, 2 or 3)
  • the sum of two dice (2 to 12)
  • the number of defective phones in a box of 20 (0 to 20)
  • the number of snow days in a school year (0, 1, 2, ...)

A random variable is continuous if it can take any value in an interval. Usually it measures something.

  • the time you wait for a bus (any amount, like 4.37 min)
  • the mass of a bag of apples
  • tomorrow's high temperature in Thunder Bay

This unit is about discrete random variables. The sibling unit Continuous Distributions and the Normal Distribution handles continuous ones.

Count or measure?

Ask: "Am I counting or measuring?" Counting usually gives a discrete variable. Measuring usually gives a continuous one. Money is a special case: amounts in cents are countable, so a prize of $0, $5 or $100 is treated as discrete.

Probability distributions

A probability distribution lists every value the random variable can take, together with its probability. For a discrete random variable it is often a table.

Every probability distribution must follow two rules:

  1. Each probability is between 0 and 1: 0 ≤ P(X = x) ≤ 1.
  2. The probabilities add to 1: Σ P(X = x) = 1. (The symbol Σ, capital sigma, means "add them all up".)

Rule 2 says that the values in the table cover everything that can happen, with nothing left out and nothing counted twice.

second diefirst die112233445566234567345678456789567891067891011789101112Sample space: 36 equally likelyordered outcomes (a, b).Random variable X = a + b.X can be 2, 3, 4, ..., 12.Shaded: the 6 outcomes with X = 7,so P(X = 7) = 6/36 = 1/6.Only 1 outcome gives X = 2 (1, 1),so P(X = 2) = 1/36.
Rolling two dice gives 36 equally likely outcomes. The sum X groups them: every cell on a diagonal running from lower left to upper right has the same sum. The longest diagonal is X = 7.
x (sum)23456789101112
P(X = x)1/362/363/364/365/366/365/364/363/362/361/36
The probability distribution of the sum of two dice. The numerators 1 + 2 + 3 + 4 + 5 + 6 + 5 + 4 + 3 + 2 + 1 add to 36, so the probabilities add to 1.
Worked example

Example 1: Building a distribution from a sample space

Roll two dice. Let X be the larger of the two numbers (if they match, X is that number). Build the probability distribution of X.

  1. X can be 1, 2, 3, 4, 5 or 6.
  2. X = 1 only for (1, 1): 1 outcome.
  3. X = 2 for (1, 2), (2, 1), (2, 2): 3 outcomes.
  4. In general, X = k when both dice are at most k but not both less than k. That is k² − (k − 1)² = 2k − 1 outcomes.
  5. So the counts are 1, 3, 5, 7, 9, 11 for k = 1 to 6. Check: 1 + 3 + 5 + 7 + 9 + 11 = 36. ✓

For x = 1, 2, 3, 4, 5, 6: P(X = x) = 1/36, 3/36, 5/36, 7/36, 9/36, 11/36. Larger numbers are more likely, because there are more ways for a big number to be the larger one.

Worked example

Example 2: A distribution without equally likely outcomes

A bag holds 3 red and 2 blue marbles. You draw 2 marbles without replacement. Let X be the number of red marbles drawn. Find the distribution of X.

  1. The number of ways to choose 2 marbles from 5 is C(5, 2) = 10. (You met C(n, r) in Permutations and Combinations.)
  2. X = 0: both blue. C(2, 2) = 1 way. P(X = 0) = 1/10.
  3. X = 1: one red and one blue. C(3, 1) × C(2, 1) = 3 × 2 = 6 ways. P(X = 1) = 6/10.
  4. X = 2: both red. C(3, 2) = 3 ways. P(X = 2) = 3/10.
  5. Check: 1/10 + 6/10 + 3/10 = 10/10 = 1. ✓

P(X = 0) = 0.1, P(X = 1) = 0.6, P(X = 2) = 0.3

Worked example

Example 3: Finding a missing probability and using the table

A café tracks X, the number of hot chocolates a customer orders on a snowy day. The distribution is: P(X = 0) = 0.15, P(X = 1) = 0.50, P(X = 2) = 0.20, P(X = 3) = k, P(X = 4) = 0.05. Find k, then find P(X ≥ 2) and P(1 ≤ X < 3).

  1. The probabilities must add to 1: 0.15 + 0.50 + 0.20 + k + 0.05 = 1.
  2. 0.90 + k = 1, so k = 0.10.
  3. P(X ≥ 2) = P(2) + P(3) + P(4) = 0.20 + 0.10 + 0.05 = 0.35.
  4. Or use the complement: P(X ≥ 2) = 1 − P(X ≤ 1) = 1 − (0.15 + 0.50) = 0.35. ✓
  5. P(1 ≤ X < 3) includes 1 and 2 but not 3: 0.50 + 0.20 = 0.70.

k = 0.10; P(X ≥ 2) = 0.35; P(1 ≤ X < 3) = 0.70

Read the inequality signs carefully

For a discrete variable, P(X < 3) and P(X ≤ 3) are different: the second one includes the value 3. Write out the values that are included (for example, X < 3 means X = 0, 1, 2) before you add.

Worked example

Example 4: Is it a probability distribution?

Can P(X = x) = x/10 for x = 1, 2, 3, 4 be a probability distribution? What about P(X = x) = (x − 2)/5 for x = 1, 2, 3, 4, 5?

  1. First rule: 1/10, 2/10, 3/10, 4/10 are all between 0 and 1. Second rule: they add to 10/10 = 1. So the first one is a distribution.
  2. Second: x = 1 gives (1 − 2)/5 = −1/5, a negative probability. That breaks the first rule, so it is not a distribution (even though the five values add to (−1 + 0 + 1 + 2 + 3)/5 = 1).

The first is a probability distribution; the second is not, because a probability cannot be negative.

Just for fun

A random variable is neither random nor a variable in the usual sense: it is a function that turns outcomes into numbers. Mathematicians are excellent at many things, but naming things is not always one of them.

Hands-on activity

Toss, count and tabulate

You need: 3 coins (any kind), a pencil and paper.

  1. Before you start, use the diagram in this lesson to write the theoretical distribution of X = number of heads in 3 tosses: 1/8, 3/8, 3/8, 1/8.
  2. Toss all three coins together 40 times. Each time, record the number of heads (0, 1, 2 or 3) with a tally mark.
  3. Turn your tallies into relative frequencies by dividing each count by 40.
  4. Compare your table with the theoretical one. Which value came up most? Did any value come up more or less often than you expected?
  5. Repeat with 4 coins for 40 more tosses. Predict the distribution first by listing outcomes (there are 2⁴ = 16).

What to look for: with 3 coins, about 5 tosses of 0 heads, 15 of 1, 15 of 2 and 5 of 3, but expect real counts to wander by several from these. With 4 coins the theory is 1/16, 4/16, 6/16, 4/16, 1/16, so 2 heads should be the most common. In the next lesson you will graph tables like these.

Your turn

1

Classify each random variable as discrete or continuous: (a) the number of goals in a hockey game; (b) the time a goalie spends on the ice; (c) the number of text messages you get in an hour; (d) the volume of maple sap collected from one tree in a day.

2

A spinner has 4 equal sectors labelled 1, 1, 2, 5. Let X be the number spun. Give the distribution of X.

3

Toss 4 coins. Let X be the number of tails. Give the distribution of X.

4

Use the two-dice sum table. Find P(X ≥ 10).

5

Use the two-dice sum table. Find P(4 < X < 8).

6

P(X = 0) = 0.2, P(X = 1) = 0.35, P(X = 2) = 0.3 and P(X = 3) = k. Find k.

7

A bag has 2 green and 3 yellow counters. Draw 2 without replacement. Let X be the number of green counters. Find the distribution.

More practice: warm-up

1

Is "the number of red lights you stop at on the way to school" discrete or continuous?

2

Is "the length of a snowfall in hours" discrete or continuous?

3

What must the probabilities in a probability distribution add to?

4

Two dice are rolled. What is P(sum = 7)?

5

Toss 3 coins. What is P(X = 3), where X is the number of heads?

More practice: on your own

1

Roll two dice. Let D be the absolute difference of the two numbers (for example, 5 and 2 give D = 3). Build the distribution of D.

2

For D in the previous question, find P(D ≤ 1) and P(D ≥ 3).

3

Find c so that P(X = x) = c·x² for x = 1, 2, 3 is a probability distribution.

4

Two spinners each have equal sectors 1, 2, 3. Let Y be the product of the two spins. Find the distribution of Y.

5

Explain why "P(X = 1) = 0.6, P(X = 2) = 0.5, P(X = 3) = −0.1" is not a probability distribution, even though it adds to 1.

Challenge

1

A box has 4 batteries, 1 of which is dead. You test them one at a time, without replacement, until you find the dead one. Let X be the number of tests needed. Find the distribution of X.

2

Roll a die until a 6 appears, but stop after 3 rolls no matter what. Let X be the number of rolls made. Find the distribution of X and check that it adds to 1.

3

Two dice are rolled. Let X = the sum. Find P(X is prime | X is odd). (Use the distribution; | means "given that".)

Check your understanding

Quiz

1.

Which of these is a discrete random variable?

2.

For a probability distribution, the probabilities must...

3.

Toss 3 coins. If X is the number of heads, what is P(X = 1)?

4.

P(X = 0) = 0.4, P(X = 1) = 0.3, P(X = 2) = 0.2 and P(X = 3) = k. What is k?

5.

Two dice are rolled and X is the sum. What is P(X ≤ 4)?

6.

For a discrete X with values 0 to 5, which expression equals P(X < 2)?

For parents and teachers

Big idea (B1.1): a random variable turns each outcome of a chance experiment into a number, and its probability distribution lists every possible value with its probability. All later lessons in this unit (expected value, binomial and hypergeometric distributions) are built on these tables.

How to help: Toss coins or roll dice with your teen and ask, "What are all the values the count could take? Which is most likely?" Ask them to check that their table adds to 1; this one habit catches most errors.

Common difficulties:

  • Confusing outcomes (HTH) with values of the variable (2 heads).
  • Forgetting that (1, 2) and (2, 1) are different outcomes when two dice are rolled.
  • Mixing up < and ≤ when adding probabilities.
  • Calling a measured quantity (time, mass) discrete because the answer was rounded.