Random Variables and Probability Distributions
What a random variable is, how to build the probability distribution of a discrete random variable with the rules of probability or a simulation, how to show it as a table or graph, and how cumulative probabilities work.
A random variable attaches a number to each outcome of a random process, such as the number of heads in three tosses. Its probability distribution lists every value it can take and the probability of each, and those probabilities add to 1. With the distribution in hand, “at least,” “at most,” and “between” questions become sums.
1Random variables
A random variable is a variable whose values are numerical outcomes of a random process. Random variables are written with capital letters, like \(X\), and their particular values with lowercase letters, like \(x\). The probability that \(X\) takes the value \(x\) is written \(P(X = x)\).
| Random process | Random variable | Possible values |
|---|---|---|
| Toss a coin three times | X = number of heads | 0, 1, 2, 3 |
| Pick a junior at random | X = number of AP classes taken | 0, 1, 2, 3, 4 |
| A 70% shooter takes 3 free throws | X = number made | 0, 1, 2, 3 |
| Roll two dice | X = sum of the dice | 2, 3, …, 12 |
All of these are discrete random variables: their possible values can be listed and counted.
2Probability distributions
The probability distribution of a discrete random variable shows the probability of every possible value. Two rules always hold: each probability is between 0 and 1, and the probabilities over all possible values add to 1. A distribution can be found with the rules of probability or estimated with a simulation.
Three coins
Toss a fair coin three times. Let X be the number of heads. Find the probability distribution of X.
- 1List the sample space: HHH, HHT, HTH, THH, HTT, THT, TTH, TTT. The 8 outcomes are equally likely.
- 2Count the outcomes for each value of X: 0 heads (1 outcome), 1 head (3), 2 heads (3), 3 heads (1).
- 3Divide each count by 8, and check that the probabilities add to 1: \(\tfrac{1}{8} + \tfrac{3}{8} + \tfrac{3}{8} + \tfrac{1}{8} = 1\).
AP classes
Let X be the number of AP classes taken by a randomly chosen junior at a school.
| x | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| P(X = x) | 0.30 | 0.25 | 0.20 | ? | 0.10 |
Find P(X = 3).
- 1The probabilities over all possible values of a discrete random variable add to 1.
- 2\(P(X = 3) = 1 - (0.30 + 0.25 + 0.20 + 0.10) = 1 - 0.85 = 0.15\).
- 3Check: 0.15 is between 0 and 1, so the distribution is valid.
If the probabilities add to 0.95 or 1.10, a value is missing, a probability is wrong, or two values overlap. Always add them up before using the table. (Rounding can leave the sum at 0.999 or 1.001; that is fine.)
3Tables, graphs, and functions
A discrete probability distribution can be shown as a table, a graph, or a function that gives the probability for each value of the random variable.
| x | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| P(X = x) | 0.30 | 0.25 | 0.20 | 0.15 | 0.10 |
A function works when the probabilities follow a rule. For example, a spinner where \(P(X = x) = x/10\) for \(x = 1, 2, 3, 4\) gives probabilities 0.1, 0.2, 0.3 and 0.4, which add to 1.
At least, fewer than, between
Use the completed AP-class distribution. Find P(X ≥ 2), P(X < 2), and P(1 ≤ X ≤ 3).
- 1“At least 2” includes 2: \(P(X \ge 2) = 0.20 + 0.15 + 0.10 = 0.45\).
- 2“Fewer than 2” means 0 or 1: \(P(X \lt 2) = 0.30 + 0.25 = 0.55\). It is the complement of \(X \ge 2\): \(1 - 0.45 = 0.55\).
- 3“Between 1 and 3, inclusive”: \(P(1 \le X \le 3) = 0.25 + 0.20 + 0.15 = 0.60\).
For a discrete random variable the boundary value matters. \(P(X \ge 2)\) includes 2 (0.45); \(P(X \gt 2)\) does not (0.25). Translate the words first: “at least” and “no fewer than” mean \(\ge\); “more than” means \(\gt\); “at most” means \(\le\); “fewer than” means \(\lt\).
4Estimating a distribution by simulation
When the rules of probability are hard to apply, a simulation can estimate the whole distribution: run many trials, record the value of the random variable each time, and use the relative frequency of each value.
Free throws
A 70% free-throw shooter takes 3 shots. Describe how to estimate the distribution of X = number made by simulation, and compare with Figure 3.
- 1For each shot, use a random digit: 0 to 6 means made, 7 to 9 means missed. Three digits make one trial; record X, the number made.
- 2Repeat for many trials, say 1,000, and find the relative frequency of X = 0, 1, 2, and 3.
- 3In Figure 3, 1,000 simulated trials gave 0.022, 0.180, 0.441, 0.357, close to the exact values 0.027, 0.189, 0.441, 0.343.
5Cumulative probability
A cumulative probability distribution shows, for each value \(x\), the probability that the random variable is less than or equal to \(x\): \(P(X \le x)\). It is a running total of the ordinary probabilities, and it always ends at 1.
| x | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| P(X = x) | 0.30 | 0.25 | 0.20 | 0.15 | 0.10 |
| P(X ≤ x) | 0.30 | 0.55 | 0.75 | 0.90 | 1.00 |
Running totals
Build the cumulative distribution of the AP-class variable, and use it to find P(X > 2).
- 1Each cumulative probability adds all the probabilities up to and including that value: \(P(X \le 0) = 0.30\), \(P(X \le 1) = 0.55\), \(P(X \le 2) = 0.75\), \(P(X \le 3) = 0.90\), \(P(X \le 4) = 1.00\).
- 2“More than 2” is the complement of “at most 2”: \(P(X \gt 2) = 1 - P(X \le 2) = 1 - 0.75 = 0.25\).
Cumulative probabilities include the value itself: \(P(X \le 2) = 0.30 + 0.25 + 0.20 = 0.75\). To get \(P(X \lt 2)\), use the entry before it, \(P(X \le 1) = 0.55\).
Quick reference
| Idea | What to remember |
|---|---|
| Random variable | A number attached to each outcome of a random process |
| Probability distribution | Every value with its probability; probabilities between 0 and 1, adding to 1 |
| Ways to show it | Table, probability histogram, or function |
| Ways to find it | Rules of probability, or estimate by simulation |
| Cumulative distribution | \(P(X \le x)\): running total, ends at 1 |