Key takeaway: A random variable is a numerical quantity whose value is determined by the outcome of a chance process, together with a probability distribution that says how likely each value is.
Grade 12 – AP StatisticsAP Statistics Unit 2Probability and Counting
Definition of Random Variable
A random variable turns the results of a random process into numbers. Flip four coins and let \(X\) count the tails: the process has sixteen outcomes, but \(X\) takes only the values 0 through 4. Capital letters name the variable and lowercase letters name its possible values.
A discrete random variable has values that can be listed, such as counts. A continuous one takes any value in an interval, such as a wait time. The probability distribution pairs every value with its chance of occurring.
Formula and notation
For a discrete random variable \(X\) with values \(x_i\) and probabilities \(p_i\):
\[ \mu_X=E(X)=\sum x_i\,p_i,\qquad p_1+p_2+\cdots=1. \]
Write \(P(X=2)\) for the probability that \(X\) equals 2, and \(P(X\ge 3)\) for the probability of at least 3.
Key facts
- No probability can be negative or exceed 1, and the full list must total exactly one.
- Its expected value is the long-run average, which the variable itself may never equal.
- Many different outcomes can map to the same value of the variable.
- Continuous variables use areas under a density curve, and any single exact value has probability 0.
Random Variable example
A fair coin is flipped four times . Let \(X\) be the number of tails. Find \(P(X\ge 3)\) and the expected value of \(X\).
-
There are \(2^4=16\) equally likely outcomes. The counts with 0, 1, 2, 3, 4 tails are 1, 4, 6, 4, 1.
-
At least three tails: \(P(X\ge 3)=\frac{4}{16}+\frac{1}{16}=\frac{5}{16}\).
-
Expected value: \(0\cdot\frac{1}{16}+1\cdot\frac{4}{16}+2\cdot\frac{6}{16}+3\cdot\frac{4}{16}+4\cdot\frac{1}{16}=\frac{32}{16}=2\).
\(P(X\ge 3)=\)\(\frac{5}{16}=0.3125\), and on average there are 2 tails in four flips.
Common mistake
Watch out
A student says \(P(X=2)=\frac{1}{16}\), because the sequence TTHH has probability \(\frac{1}{16}\).
Why it is wrong
The event \(X=2\) includes every arrangement with exactly two tails: TTHH, THTH, THHT, HTTH, HTHT and HHTT. That is six outcomes, so the probability is \(\frac{6}{16}=0.375\). A value of the variable collects all outcomes that produce it.
Related terms and lessons
Browse the glossary: A–Z list · AP Statistics vocabulary · Probability and Counting

