Chapter 8: Random Variables and Probability Distributions
Learning Objectives
- Define a random variable and construct a discrete probability distribution
- Calculate and interpret the mean (expected value) and standard deviation of a discrete random variable
- Identify binomial settings and apply the binomial distribution formula
- Calculate binomial probabilities, mean, and standard deviation
- Identify geometric settings and apply the geometric distribution formula
- Apply rules for linear transformations and combining independent random variables
8.1 Discrete Random Variables
A random variable $X$ assigns a numerical value to each outcome of a chance process. When the set of possible values is a countable list, we call $X$ a discrete random variable.
Definition: Probability Distribution
The probability distribution of a discrete random variable $X$ is a table (or formula) that lists all possible values of $X$ and their corresponding probabilities $P(X = x)$.
Requirements:
- Every probability is non-negative: $P(x) \ge 0$ for all $x$.
- All probabilities sum to 1: $\displaystyle\sum_{\text{all } x} P(x) = 1$.
Mean and Variance of a Discrete Random Variable
The expected value (mean) of $X$ is:
$$\mu_X = E(X) = \sum x \cdot P(x)$$
The variance of $X$ is:
$$\sigma_X^2 = \sum (x - \mu_X)^2 \cdot P(x)$$
The standard deviation is $\sigma_X = \sqrt{\sigma_X^2}$.
Example 8.1 — Rolling a Fair Die
Let $X$ = the number showing when a fair six-sided die is rolled. The probability distribution is:
| $x$ | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| $P(X=x)$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ | $\frac{1}{6}$ |
Mean: $\mu = \frac{1+2+3+4+5+6}{6} = \frac{21}{6} = 3.5$
Variance: $\sigma^2 = \frac{(1-3.5)^2 + (2-3.5)^2 + (3-3.5)^2 + (4-3.5)^2 + (5-3.5)^2 + (6-3.5)^2}{6}$
$= \frac{6.25 + 2.25 + 0.25 + 0.25 + 2.25 + 6.25}{6} = \frac{17.5}{6} \approx 2.917$
Standard deviation: $\sigma = \sqrt{2.917} \approx 1.71$
Example 8.2 — Expected Profit from a Game
Let $X$ = profit from playing a game once, with the following distribution:
| Outcome | $x$ (profit) | $P(X=x)$ |
|---|---|---|
| Win | $5 | 0.3 |
| Break even | $0 | 0.4 |
| Lose | $-3 | 0.3 |
Expected profit: $E(X) = 5(0.3) + 0(0.4) + (-3)(0.3) = 1.50 - 0.90 = \$0.60$
On average, a player gains $0.60 per game. A fair game would have $E(X) = 0$.
A lottery ticket costs $2. The distribution of winnings is: $P(\text{win } \$10) = 0.05$, $P(\text{win } \$2) = 0.15$, $P(\text{win } \$0) = 0.80$. Find the expected net profit per ticket.
Show Answer
Probability distribution histogram for $X$ = outcome of one fair die roll. Each value has probability $\frac{1}{6} \approx 0.167$.
Figure 8.1 — Probability Distribution: Fair Die Roll
8.2 Binomial Distribution
A binomial setting arises when we perform a fixed number of independent trials, each with only two possible outcomes (success or failure) and the same probability of success. Use the acronym BINS to check the conditions:
BINS: Conditions for a Binomial Setting
- Binary — each trial has exactly two outcomes: success or failure
- Independent — trials are independent of each other
- Number — the number of trials $n$ is fixed in advance
- Same probability — each trial has the same probability $p$ of success
If all four conditions hold, then $X$ = number of successes follows a Binomial$(n, p)$ distribution.
Binomial Formula and Parameters
If $X \sim \text{Binomial}(n, p)$, then for $k = 0, 1, 2, \ldots, n$:
$$P(X = k) = \binom{n}{k} p^k (1-p)^{n-k}$$
where $\displaystyle\binom{n}{k} = \frac{n!}{k!(n-k)!}$ is the number of ways to choose $k$ successes from $n$ trials.
- Mean: $\mu_X = np$
- Standard deviation: $\sigma_X = \sqrt{np(1-p)}$
Example 8.3 — Flipping a Fair Coin
A fair coin is flipped 10 times. Let $X \sim \text{Binomial}(10,\ 0.5)$.
P(exactly 4 heads):
$$P(X=4) = \binom{10}{4}(0.5)^4(0.5)^6 = 210 \cdot \frac{1}{1024} \approx 0.205$$
Mean: $\mu = 10 \times 0.5 = 5$ heads expected.
Standard deviation: $\sigma = \sqrt{10 \times 0.5 \times 0.5} = \sqrt{2.5} \approx 1.58$
Example 8.4 — Free-Throw Shooter
A basketball player makes 70% of free throws. Let $X \sim \text{Binomial}(8,\ 0.7)$. Find $P(X \ge 6)$.
$$P(X=6) = \binom{8}{6}(0.7)^6(0.3)^2 = 28 \times 0.1176 \times 0.09 \approx 0.296$$
$$P(X=7) = \binom{8}{7}(0.7)^7(0.3)^1 = 8 \times 0.0824 \times 0.3 \approx 0.198$$
$$P(X=8) = (0.7)^8 \approx 0.0576$$
$$P(X \ge 6) = 0.296 + 0.198 + 0.0576 \approx \mathbf{0.552}$$
The player makes at least 6 of 8 free throws about 55.2% of the time.
On a multiple-choice test with 5 answer options per question, a student guesses randomly on 12 questions. Let $X$ = number of correct guesses. Find $\mu$ and $\sigma$ for $X$.
Show Answer
$\mu = np = 12 \times 0.20 = 2.4$ correct answers expected.
$\sigma = \sqrt{np(1-p)} = \sqrt{12 \times 0.20 \times 0.80} = \sqrt{1.92} \approx 1.39$
AP Exam Tip: "At least $k$" means $P(X \ge k) = 1 - P(X \le k-1)$. On the AP exam, use the complement whenever it reduces calculation. With a calculator, use binomcdf for cumulative probabilities and binompdf for exact probabilities.
Binomial$(10, 0.5)$ probability distribution. The distribution is symmetric about $\mu = 5$. The amber dashed line marks the mean.
Figure 8.2 — Binomial Distribution: $n=10$, $p=0.5$
8.3 Geometric Distribution
The geometric distribution counts the number of trials needed to get the first success. Unlike the binomial, there is no fixed number of trials — we keep going until we succeed. Check conditions using BITS:
BITS: Conditions for a Geometric Setting
- Binary — each trial has two outcomes: success or failure
- Independent — trials are independent
- Trials — the number of trials is not fixed; we count until first success
- Same probability — each trial has the same probability $p$ of success
If $X$ = number of trials until first success, then $X \sim \text{Geometric}(p)$.
Geometric Distribution Formula and Parameters
If $X \sim \text{Geometric}(p)$, then for $k = 1, 2, 3, \ldots$:
$$P(X = k) = (1-p)^{k-1} \cdot p$$
- Mean: $\mu_X = \dfrac{1}{p}$
- Variance: $\sigma_X^2 = \dfrac{1-p}{p^2}$
Interpretation: $\mu = 1/p$ is the expected number of trials needed to get the first success.
Example 8.5 — Rolling Until a Six
Roll a fair die repeatedly until a 6 appears. Let $X$ = number of rolls needed. Then $X \sim \text{Geometric}(1/6)$.
$$P(X = k) = \left(\frac{5}{6}\right)^{k-1} \cdot \frac{1}{6}$$
Expected rolls: $\mu = \dfrac{1}{1/6} = 6$ rolls on average.
For example, $P(X = 3) = (5/6)^2 \cdot (1/6) = 25/216 \approx 0.116$.
Example 8.6 — First Miss in Free Throws
A player makes 80% of free throws, so $P(\text{miss}) = 0.20$. Let $X$ = number of shots until first miss. Then $X \sim \text{Geometric}(0.20)$.
P(first miss on the 3rd shot): $P(X=3) = (0.80)^2(0.20) = 0.64 \times 0.20 = 0.128$
Expected shots until first miss: $\mu = 1/0.20 = 5$ shots.
A basketball player makes 60% of free throws. Find the probability that the first miss occurs on the 4th shot.
Show Answer
$P(X = 4) = (0.60)^3 \times 0.40 = 0.216 \times 0.40 = 0.0864$
There is about an 8.6% chance the first miss happens on the 4th shot.
AP Exam Tip: The key difference between binomial and geometric: in a binomial setting, $n$ is fixed and $X$ counts successes. In a geometric setting, $X$ counts the number of trials until the first success — there is no fixed $n$. Always verify which distribution applies before calculating.
8.4 Combining Random Variables
When random variables are transformed or combined, the mean and variance follow specific rules. These rules appear frequently on the AP exam, especially in free-response questions.
Linear Transformations
If $Y = aX + b$ (a constant multiple plus a constant shift), then:
- $\mu_Y = a\mu_X + b$
- $\sigma_Y = |a|\,\sigma_X$ (standard deviation scales by $|a|$; adding a constant does not change spread)
Rules for Combining Independent Random Variables
For any two random variables $X$ and $Y$:
$$\mu_{X+Y} = \mu_X + \mu_Y \qquad \mu_{X-Y} = \mu_X - \mu_Y$$
If $X$ and $Y$ are independent:
$$\sigma^2_{X+Y} = \sigma^2_X + \sigma^2_Y \qquad \sigma^2_{X-Y} = \sigma^2_X + \sigma^2_Y$$
Important: Variances always add for independent random variables — even when subtracting. Standard deviations do NOT add directly.
Example 8.7 — Combining Hours
Let $X$ = hours studying per day, $\mu_X = 3$, $\sigma_X = 1$. Let $Y$ = hours sleeping per day, $\mu_Y = 7$, $\sigma_Y = 1.5$. Assume $X$ and $Y$ are independent. Find $\mu$ and $\sigma$ for $X + Y$.
Mean: $\mu_{X+Y} = 3 + 7 = 10$ hours
Variance: $\sigma^2_{X+Y} = 1^2 + 1.5^2 = 1 + 2.25 = 3.25$
Standard deviation: $\sigma_{X+Y} = \sqrt{3.25} \approx 1.80$ hours
Example 8.8 — Net Profit After Entry Fee
A game costs $4 to play. Let $X$ = winnings from the game, with $\mu_X = \$3$ and $\sigma_X = \$1.50$. Net profit $W = X - 4$.
Mean net profit: $\mu_W = \mu_X - 4 = 3 - 4 = -\$1.00$
Standard deviation: $\sigma_W = \sigma_X = \$1.50$ (subtracting a constant does not change the spread)
On average, the player loses $1 per game, with a typical deviation of $1.50.
$X$ and $Y$ are independent random variables with $\sigma_X = 3$ and $\sigma_Y = 4$. Find $\sigma_{X+Y}$ and $\sigma_{X-Y}$. Are they the same? Why?
Show Answer
$\sigma^2_{X-Y} = 9 + 16 = 25$, so $\sigma_{X-Y} = 5$ as well.
Yes, they are the same! For independent RVs, variances always add — even when subtracting $Y$. This is because variance measures spread, and spreading in either direction increases overall variability.
AP Exam Tip: NEVER add standard deviations directly. Always add variances ($\sigma^2$) first, then take the square root to find the combined standard deviation. Writing $\sigma_{X+Y} = \sigma_X + \sigma_Y$ is one of the most common errors on the AP Statistics exam.
Geometric$(p = 1/6)$ distribution: probability of first success on trial $k$. The distribution is right-skewed; most first successes occur in early trials.
Figure 8.3 — Geometric Distribution: $p = 1/6$ (Rolling Until a Six)
Practice Problems
$X$ has the following distribution: $P(0)=0.1$, $P(1)=0.3$, $P(2)=0.4$, $P(3)=0.2$. Verify the probabilities sum to 1. Find $\mu$, $\sigma^2$, and $\sigma$.
Show Solution
$\mu = 0(0.1)+1(0.3)+2(0.4)+3(0.2) = 0+0.3+0.8+0.6 = 1.7$
$\sigma^2 = (0-1.7)^2(0.1)+(1-1.7)^2(0.3)+(2-1.7)^2(0.4)+(3-1.7)^2(0.2)$
$= 2.89(0.1)+0.49(0.3)+0.09(0.4)+1.69(0.2) = 0.289+0.147+0.036+0.338 = 0.81$
$\sigma = \sqrt{0.81} = 0.90$
Let $X \sim \text{Binomial}(15,\ 0.4)$. Find $P(X=5)$, $\mu$, and $\sigma$.
Show Solution
$\mu = np = 15 \times 0.4 = 6.0$
$\sigma = \sqrt{15 \times 0.4 \times 0.6} = \sqrt{3.6} \approx 1.897$
Is this a binomial setting? "Draw 5 cards without replacement from a standard deck; $X$ = number of aces." Explain which BINS condition fails.
Show Solution
Let $X \sim \text{Geometric}(0.25)$. Find $P(X=3)$, $P(X \le 3)$, and $\mu$.
Show Solution
$P(X \le 3) = P(1)+P(2)+P(3) = 0.25 + 0.75(0.25) + (0.75)^2(0.25)$
$= 0.25 + 0.1875 + 0.1406 = 0.5781$
$\mu = 1/0.25 = 4$ trials expected until first success.
A quality control inspector tests items; 10% are defective. Find the probability that the first defective item is the 5th one tested.
Show Solution
$P(X=5) = (0.90)^4 \times 0.10 = 0.6561 \times 0.10 = 0.0656$
There is about a 6.6% chance the first defective item is the 5th one tested.
Let $X \sim \text{Binomial}(20,\ 0.6)$. Use the complement to find $P(X \ge 15)$.
Hint: $P(15)\approx0.0746$, $P(16)\approx0.0350$, $P(17)\approx0.0100$, $P(18)\approx0.0020$, $P(19)\approx0.0002$, $P(20)\approx0.0000$.
Show Solution
$\approx 0.0746+0.0350+0.0100+0.0020+0.0002+0.0000$
$\approx \mathbf{0.1218}$
Alternatively: $P(X \ge 15) = 1 - P(X \le 14)$, using binomcdf(20, 0.6, 14) on a calculator.
Two independent random variables: $E(X)=10$, $\text{Var}(X)=4$; $E(Y)=6$, $\text{Var}(Y)=9$. Find $E(3X - 2Y + 5)$ and $\text{Var}(3X - 2Y)$.
Show Solution
$\text{Var}(3X - 2Y) = 3^2\,\text{Var}(X) + (-2)^2\,\text{Var}(Y) = 9(4) + 4(9) = 36 + 36 = \mathbf{72}$
(Adding constants does not affect variance; subtracting $2Y$ means multiplying $Y$ by $-2$, so the coefficient is squared.)
AP FRQ: A carnival game: spin a wheel with $P(\text{win}) = 0.3$ each spin. A player keeps spinning until they win.
(a) Find $P(\text{winning on the 4th spin})$.
(b) Find the expected number of spins.
(c) The game costs $2 per spin and pays $5 when won. Find expected net profit/loss.
Show Solution
$P(X=4) = (0.7)^3(0.3) = 0.343 \times 0.3 = 0.1029 \approx \mathbf{10.3\%}$
(b) $\mu = 1/p = 1/0.3 \approx \mathbf{3.33}$ spins expected.
(c) Net profit = $5 - 2X$ (win $5, lose $2 per spin for $X$ spins).
$E(\text{net}) = 5 - 2E(X) = 5 - 2(3.33) = 5 - 6.67 = -\mathbf{\$1.67}$
On average, a player loses about $1.67 per game played.
📋 Chapter Summary
Discrete Random Variables
$\mu_X = E(X) = \sum x_i \cdot P(X = x_i)$ — the long-run average value of $X$.
$\sigma_X^2 = \sum (x_i - \mu_X)^2 P(X=x_i)$ $\sigma_X = \sqrt{\sigma_X^2}$ — measures spread of the distribution.
$n$ independent trials, probability $p$ of success. $P(X=k) = \binom{n}{k}p^k(1-p)^{n-k}$. $\mu = np$, $\sigma = \sqrt{np(1-p)}$.
Number of trials until first success. $P(X=k) = (1-p)^{k-1}p$. $\mu = 1/p$. Requires independence and constant $p$.
Linear Combinations
$\mu_{X \pm Y} = \mu_X \pm \mu_Y$ — always true (means always add/subtract).
$\sigma_{X+Y}^2 = \sigma_X^2 + \sigma_Y^2$ — ONLY when $X$ and $Y$ are independent. Same for difference: $\sigma_{X-Y}^2 = \sigma_X^2 + \sigma_Y^2$.