Unit 2 · Topic 2.8 · about 20 minutes

Introduction to Random Variables and Probability Distributions

Define a discrete random variable in context and construct its probability distribution, including its cumulative distribution, from the rules of probability or from a simulation.

Predict first

Roll two fair dice and let X be the larger of the two numbers (if they match, X is that number). Which value of X is the most likely?

Random variables

A random variable is a variable whose values are numbers produced by a random process. It is named with a capital letter, like X, and its possible values are written in lowercase, like x. The larger of two dice is a random variable. So are the number of free throws a player makes in a game and the number of texts you get in the next hour.

This lesson is about discrete random variables, which take a countable set of values such as 0, 1, 2 and so on. Variables that can take any value in an interval, like a time or a height, come in 2.11 The Normal Distribution.

Probability distributions

A probability distribution for a discrete random variable gives the probability of every possible value. Every probability in it is between 0 and 1, and the probabilities add to exactly 1.

A distribution can be worked out with the rules of probability, or estimated with a simulation. It can be shown as a table, as a graph, or as a function, meaning a formula that gives the probability for each value.

Worked exampleThe distribution of the larger die

Two fair dice are rolled, and X is the larger of the two numbers. Construct the probability distribution of X.

  1. List the possible values. X can be 1, 2, 3, 4, 5 or 6.

  2. Count the outcomes for each value. All 36 ordered pairs are equally likely. X = 1 only for (1, 1). X = 2 for (1, 2), (2, 1) and (2, 2), three pairs. Each step up adds two more pairs, so the counts are 1, 3, 5, 7, 9 and 11.

  3. Divide each count by 36. The probabilities are 136,336,536,736,936 and 1136.

  4. Check the total. 1+3+5+7+9+11=36, so the probabilities add to 3636=1, as every distribution must.

Answer.

The table below. As a function, P(X=x)=2x−136 for x=1,2,…,6.

Probability distribution of X, the larger of two dice
x123456
P(X=x)1363365367369361136
As a decimal0.0280.0830.1390.1940.2500.306

The same distribution as a graph

00.10.20.3Probability1: 0.02812: 0.08323: 0.13934: 0.19445: 0.2556: 0.3066Larger of the two dice, x

Each bar's height is the probability of that value of X, and the six heights add to 1.

Cumulative probabilities

A cumulative probability distribution gives, for each value, the probability that X is less than or equal to that value. Build it by adding probabilities from the left: P(X≤3)=136+336+536=936=0.25.

For the larger die the cumulative probabilities are square numbers over 36, so as a function, P(X≤x)=x236. The grid of rolls from 2.4 Introduction to Probability shows why: X≤3 means both dice show 3 or less, which is a 3-by-3 block of 9 cells.

Cumulative distribution of X, the larger of two dice
x123456
P(X≤x)136436936163625363636

A cumulative table answers "at most" questions directly and "at least" questions through the complement: P(X≥5)=1−P(X≤4)=1−1636=2036≈0.556. The larger die is 5 or 6 more than half the time.

Estimating a distribution by simulation

Some distributions are easier to simulate than to work out. In basketball's one-and-one, a player shoots one free throw. A miss ends the trip with 0 points. A make earns a second shot, so the trip ends with 1 or 2 points. Take a 70% shooter whose shots are independent, and let X be the points she scores. A simulation of 1,000 trips to the line gave the counts below.

The rules of probability give the exact distribution to compare against: P(X=0)=0.30, P(X=1)=0.70(0.30)=0.21 and P(X=2)=0.70(0.70)=0.49. Each simulated relative frequency lands within 0.02 of the exact value.

One-and-one for a 70% shooter: 1,000 simulated trips against the exact distribution
Points scored, x012Total
Simulated count2922284801,000
Relative frequency0.2920.2280.4801
Exact probability0.300.210.491

Lab

Binomial Explorer

The distributions in this lab belong to one family, the binomial, which is coming in 2.10 The Binomial Distribution. For now, use the lab to read a distribution as a graph: each bar is one value of X, the heights always add to 1, and choosing P(X ≤ k) under Find shades "at most k", a cumulative probability.

Open the full Binomial Explorer lab

Check your understanding

1

Each list gives probabilities for the values 0, 1, 2 and 3 of a random variable X, in that order. Which list is a valid probability distribution?

2

Let X be the number of cars owned by a randomly chosen household in a town. Its distribution is below, with one probability missing.

x01234P(X=x)0.080.35?0.170.06

Find P(X≥2). Give a decimal.

3

The number of siblings X of a randomly chosen student at a school has this cumulative distribution:

x0123P(X≤x)0.200.550.851

What is P(X=2)?

4

Let X be the number of goals a soccer team scores in a randomly chosen game, with P(X=0)=0.25, P(X=1)=0.35, P(X=2)=0.25 and P(X=3)=0.15. What is P(X<2)?

5

A player who makes 60% of her free throws goes to the line for a one-and-one. If she makes the first shot she takes a second; if she misses the first, the trip is over. Her shots are independent. Let X be the number of points she scores. What is P(X=1)?

Course alignment, for teachers

AP Statistics topic 2.8, Unit 2: Probability, Random Variables, and Probability Distributions.

  • Skill 3.A: Construct tabular and graphical representations of data and distributions.