Math Core

Lesson 4.5 · Probability, Random Variables and Distributions

Discrete random variables

Instead of asking about one event at a time, you often want the whole picture: every value a random outcome can take and how likely each value is. A random variable turns the outcomes of a chance process into numbers, and its probability distribution lists those numbers with their probabilities.

Random variables

Definition

Random variable

A random variable takes numerical values that describe the outcomes of a random process. Its probability distribution gives each possible value and its probability.

Random variables are written with capital letters like XX and YY. For example, if you flip a coin 3 times, let XX = the number of heads. Then XX can be 0,1,20, 1, 2 or 33.

There are two kinds:

  • A discrete random variable takes a countable set of separate values, such as 0,1,2,3,…0, 1, 2, 3, \dots. Counts are discrete: number of heads, number of cars per household, number of defective items.
  • A continuous random variable can take any value in an interval, such as height, time or weight. Probabilities for continuous variables are areas under a density curve, like the normal curve from Unit 1. The probability of any single exact value is 00.

This lesson focuses on discrete random variables.

Building a probability distribution

Worked example: Number of heads in three flips

Flip a fair coin 3 times and let XX = number of heads. Find the probability distribution of XX.

Solution. The 8 equally likely outcomes are

HHH, HHT, HTH, THH, HTT, THT, TTH, TTT.

Count heads in each: one outcome has 3 heads, three have 2, three have 1 and one has 0.

xx0123
P(X=x)P(X = x)1/83/83/81/8

The probabilities add to 88=1\dfrac{8}{8} = 1.

A probability histogram displays the distribution. Each bar sits over one value of XX, and its height is that value's probability.

Probability histogram of X = number of heads in 3 flips. The distribution is symmetric about 1.5.

You describe a probability distribution the same way you describe data: shape, center and variability. This one is symmetric with center 1.51.5. In the next lesson you'll measure its center and spread with a mean and standard deviation.

Valid distributions

Rules for a discrete probability distribution

  1. Every probability is between 00 and 11.
  2. The probabilities add up to exactly 11.

These rules let you find a missing probability: subtract the known probabilities from 11.

Finding probabilities from a distribution

To find the probability of a range of values, add the probabilities of the values in the range. Pay close attention to the inequality: for a discrete variable, X≥2X \ge 2 includes 22, but X>2X > 2 does not.

Worked example: Cars per household

Let XX = the number of cars owned by a randomly selected household in a town.

xx01234
P(X=x)P(X = x)0.080.320.380.160.06

Find (a) P(X≥2)P(X \ge 2), (b) P(X>2)P(X > 2), (c) P(1≤X<3)P(1 \le X \lt 3).

Solution.

(a) P(X≥2)=0.38+0.16+0.06=0.60P(X \ge 2) = 0.38 + 0.16 + 0.06 = 0.60.

(b) P(X>2)=0.16+0.06=0.22P(X > 2) = 0.16 + 0.06 = 0.22.

(c) The values 1 and 2 satisfy 1≤X<31 \le X \lt 3: 0.32+0.38=0.700.32 + 0.38 = 0.70.

For (a) you could also use the complement: 1−P(X≤1)=1−(0.08+0.32)=0.601 - P(X \le 1) = 1 - (0.08 + 0.32) = 0.60.

Worked example: Difference of two dice

Roll two fair dice and let DD = the larger number minus the smaller (so D=0D = 0 for doubles). Find the distribution of DD and P(D≥3)P(D \ge 3).

Solution. Of the 36 outcomes, count how many give each difference. A difference of d≥1d \ge 1 can happen in 6−d6 - d ordered ways with the first die larger, and the same number with the second die larger.

dd012345
P(D=d)P(D = d)6/3610/368/366/364/362/36

The numerators add to 36. Then

P(D≥3)=6+4+236=1236=13.P(D \ge 3) = \dfrac{6 + 4 + 2}{36} = \dfrac{12}{36} = \dfrac{1}{3}.

This distribution is skewed right.

Common mistake

The most common mistake is including or excluding an endpoint by accident. Write out the values that satisfy the inequality before adding. "At most 2" means X≤2X \le 2; "fewer than 2" means X<2X \lt 2; "at least 2" means X≥2X \ge 2; "more than 2" means X>2X > 2.

Practice

Practice 1

The random variable XX has the distribution below. Find the missing probability P(X=3)P(X = 3).

xx01234
P(X=x)P(X = x)0.100.250.30?0.15

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

For the distribution in the previous problem, find P(X≥2)P(X \ge 2).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

For the same distribution, find P(1<X≤3)P(1 \lt X \le 3).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Which table gives a valid probability distribution?

Practice 5

Which random variable is continuous?

Practice 6

Roll two fair dice and let XX = the number of sixes. Find P(X=1)P(X = 1). Give an exact fraction or a decimal rounded to 3 places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

The probability histogram shows the distribution of YY, the number of pets in a randomly chosen household in a neighborhood. Find P(Y≤1)P(Y \le 1).

Probability histogram of Y = number of pets. Bar heights are the probabilities.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.