Discrete random variables
🎯What you need to be able to do
- Construct a probability distribution table and use the fact that the probabilities sum to 1.
- Calculate the expectation \( \mathrm{E}(X) \) and variance \( \mathrm{Var}(X) \).
- Recognise when the binomial distribution applies, and state its conditions.
- Calculate binomial probabilities, including cumulative ones.
- Use the binomial mean and variance.
- Recognise and use the geometric distribution.
📚The mathematics
Probability distributions
A discrete random variable takes separate values, each with a probability. The distribution is usually given as a table, and the defining property is
which is how an unknown in the table is found. Always use it before anything else — several questions are unanswerable until you do.
The variance formula mirrors the one for data in S1 1: the mean of the squares minus the square of the mean. Compute \( \mathrm{E}(X) \) first, since the variance needs it.
The expectation is a long-run average, not a value \(X\) has to be able to take. The expected score on a fair die is 3.5, which no throw ever produces. In a game where \(X\) is the player’s gain, \( \mathrm{E}(X) = 0 \) means the game is fair.
The binomial distribution
\( X \sim \mathrm{B}(n, p) \) applies when all four conditions hold, and questions ask you to state them:
- A fixed number \(n\) of trials.
- Each trial has only two outcomes, success or failure.
- The trials are independent.
- The probability of success \(p\) is constant throughout.
with
Cumulative binomial probabilities
Most binomial questions ask for a range rather than a single value, and the boundaries are where marks are lost. For a discrete variable:
Note the shifts by one. “More than 3” excludes 3; “at least 3” includes it. Writing out which values of \(X\) you actually want — \( 3, 4, 5, \dots \) — before converting to cumulative form removes the guesswork entirely.
The geometric distribution
\( X \sim \mathrm{Geo}(p) \) counts the number of trials up to and including the first success, under the same independence and constant-probability conditions.
The first formula says it directly: \( r - 1 \) failures, then a success. The second is worth knowing as a shortcut — “more than \(r\) trials needed” means the first \(r\) all failed. And \( \mathrm{E}(X) = \dfrac{1}{p} \) matches intuition: if the probability is \( \tfrac{1}{6} \), you expect to wait 6 trials.
The distinguishing question: is the number of trials fixed (binomial) or is the number of successes fixed at one, with the trials continuing until it happens (geometric)?
✏️Worked example
\( x \): 1, 2, 3, 4 \( \mathrm{P}(X = x) \): 0.1, 0.3, \(k\), 0.2
(b) A biased coin lands heads with probability 0.3. It is tossed 12 times. Find the probability of (i) exactly 4 heads, (ii) at least 3 heads. State the mean number of heads. (c) The same coin is tossed until the first head appears. Find the probability that this takes more than 5 tosses.
(a) The probabilities sum to 1: \( 0.1 + 0.3 + k + 0.2 = 1 \), so \( k = 0.4 \).
For the variance, first find \( \mathrm{E}(X^{2}) \):
so \( \mathrm{Var}(X) = 8.1 - 2.7^{2} = 8.1 - 7.29 = 0.81 \).
(b) \( X \sim \mathrm{B}(12, 0.3) \).
(i) \( \mathrm{P}(X = 4) = \dbinom{12}{4}(0.3)^{4}(0.7)^{8} = 495 \times 0.0081 \times 0.05765 = 0.231 \).
(ii) “At least 3” includes 3, so the complement is “2 or fewer”:
with \( \mathrm{P}(0) = (0.7)^{12} = 0.01384 \), \( \mathrm{P}(1) = 12(0.3)(0.7)^{11} = 0.07118 \) and \( \mathrm{P}(2) = 66(0.09)(0.7)^{10} = 0.16780 \). These sum to \( 0.2528 \), so \( \mathrm{P}(X \ge 3) = 0.747 \).
The mean is \( np = 12 \times 0.3 = 3.6 \) heads.
(c) Geometric with \( p = 0.3 \). More than 5 tosses means the first 5 were all tails:
📝Practise
Work through these, then reveal the answer.
1. \(X\) takes values 0, 1, 2 with probabilities 0.2, \(a\), 0.5. Find \(a\), \( \mathrm{E}(X) \) and \( \mathrm{Var}(X) \).
2. 8% of components are faulty. In a random sample of 20, find the probability that exactly 2 are faulty.
3. For \( X \sim \mathrm{B}(15, 0.4) \), find \( \mathrm{P}(X \le 4) \) and the mean and variance.
4. State the conditions under which the binomial distribution is an appropriate model, and explain why drawing 5 cards from a standard pack without replacement is not binomial.
5. A die is rolled until a 6 appears. Find the probability that this takes exactly 4 rolls, and the expected number of rolls.
6. For \( X \sim \mathrm{B}(n, 0.25) \) the variance is 3. Find \(n\) and the mean.
🔗Go deeper — other people’s work
These are external resources, not mine. If one stops working, tell me and everything above it on this page still stands.
- Seeing Theory (Brown University) — the binomial distribution, animated
- Khan Academy — discrete random variables and expected value
- Desmos — plot binomial probabilities against \(r\) and watch the shape change with \(p\)