HomeLearning HubA Level MathsS1 4: Discrete random variables
S1 4

Discrete random variables

Probability & Statistics 1 · Paper 5

🎯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

\[ \sum \mathrm{P}(X = x) = 1 \]

which is how an unknown in the table is found. Always use it before anything else — several questions are unanswerable until you do.

\( \mathrm{E}(X) = \sum x\,\mathrm{P}(X = x) \)
\( \mathrm{Var}(X) = \sum x^{2}\mathrm{P}(X = x) - \left[\mathrm{E}(X)\right]^{2} \)

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:

  1. A fixed number \(n\) of trials.
  2. Each trial has only two outcomes, success or failure.
  3. The trials are independent.
  4. The probability of success \(p\) is constant throughout.
\[ \mathrm{P}(X = r) = \binom{n}{r}p^{r}(1-p)^{\,n-r} \]

with

\( \mathrm{E}(X) = np \)
\( \mathrm{Var}(X) = np(1-p) \)
Sampling without replacement is not binomial. Drawing counters without replacing them breaks conditions 3 and 4 — the probability changes each time. The exception in practice is a very large population, where the change is negligible and the binomial is used as an approximation. If a question says “a large batch” or “a random sample from a population of 10 000”, that is the signal.

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:

\( \mathrm{P}(X > 3) = 1 - \mathrm{P}(X \le 3) \)
\( \mathrm{P}(X \ge 3) = 1 - \mathrm{P}(X \le 2) \)
\( \mathrm{P}(2 \le X \le 5) = \mathrm{P}(X \le 5) - \mathrm{P}(X \le 1) \)

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.

\( \mathrm{P}(X = r) = (1-p)^{\,r-1}p \)
\( \mathrm{P}(X > r) = (1-p)^{r} \)
\( \mathrm{E}(X) = \dfrac{1}{p} \)

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

(a) The random variable \(X\) has the distribution below. Find \(k\), then \( \mathrm{E}(X) \) and \( \mathrm{Var}(X) \).

\( 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 \).

\[ \mathrm{E}(X) = 1(0.1) + 2(0.3) + 3(0.4) + 4(0.2) = 0.1 + 0.6 + 1.2 + 0.8 = 2.7 \]

For the variance, first find \( \mathrm{E}(X^{2}) \):

\[ \mathrm{E}(X^{2}) = 1(0.1) + 4(0.3) + 9(0.4) + 16(0.2) = 0.1 + 1.2 + 3.6 + 3.2 = 8.1 \]

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”:

\[ \mathrm{P}(X \ge 3) = 1 - \mathrm{P}(X \le 2) = 1 - \left[\mathrm{P}(0) + \mathrm{P}(1) + \mathrm{P}(2)\right] \]

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:

\[ \mathrm{P}(X > 5) = (0.7)^{5} = 0.168 \]
Check it. In (b), the mean of 3.6 makes \( \mathrm{P}(X \ge 3) = 0.747 \) plausible — most outcomes should sit at or above 3 when the average is 3.6. In (a), the variance 0.81 gives a standard deviation of 0.9, which is sensible for a variable confined to 1–4. A variance larger than about 1.5 here would signal an arithmetic error, since the whole range is only 3 wide.
“At least 3” is not \( 1 - \mathrm{P}(X \le 3) \). That expression is \( \mathrm{P}(X > 3) \), which excludes 3 and would give 0.5075 here rather than 0.747 — a large error from a one-word misreading. Write down the values you want, \( 3, 4, \dots, 12 \), and the complement \( 0, 1, 2 \) becomes obvious.

📝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) \).
Sum to 1: \( 0.2 + a + 0.5 = 1 \), so \( a = 0.3 \). \( \mathrm{E}(X) = 0(0.2) + 1(0.3) + 2(0.5) = 1.3 \). \( \mathrm{E}(X^{2}) = 0 + 1(0.3) + 4(0.5) = 2.3 \). So \( \mathrm{Var}(X) = 2.3 - 1.69 = 0.61 \).
2. 8% of components are faulty. In a random sample of 20, find the probability that exactly 2 are faulty.
\( X \sim \mathrm{B}(20, 0.08) \). \( \mathrm{P}(X = 2) = \dbinom{20}{2}(0.08)^{2}(0.92)^{18} = 190 \times 0.0064 \times 0.2229 = 0.271 \).
3. For \( X \sim \mathrm{B}(15, 0.4) \), find \( \mathrm{P}(X \le 4) \) and the mean and variance.
Summing \( \mathrm{P}(0) \) to \( \mathrm{P}(4) \) gives \( \mathrm{P}(X \le 4) = 0.2173 \). The mean is \( np = 6 \) and the variance is \( np(1-p) = 15(0.4)(0.6) = 3.6 \). A mean of 6 makes it reasonable that only about a fifth of the distribution lies at 4 or below.
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.
The conditions are: a fixed number of trials; two outcomes per trial; independent trials; and a constant probability of success. Drawing cards without replacement fails the last two — after drawing an ace, the probability the next card is an ace changes from \( \tfrac{4}{52} \) to \( \tfrac{3}{51} \), so the trials are neither independent nor identically distributed.
5. A die is rolled until a 6 appears. Find the probability that this takes exactly 4 rolls, and the expected number of rolls.
Geometric with \( p = \tfrac16 \). \( \mathrm{P}(X = 4) = \left(\tfrac56\right)^{3}\left(\tfrac16\right) = \dfrac{125}{1296} = 0.0965 \) — three failures then a success. The expected number of rolls is \( \dfrac{1}{p} = 6 \).
6. For \( X \sim \mathrm{B}(n, 0.25) \) the variance is 3. Find \(n\) and the mean.
\( \mathrm{Var}(X) = np(1-p) = n(0.25)(0.75) = 0.1875n \). Setting this equal to 3 gives \( n = 16 \). The mean is then \( np = 16(0.25) = 4 \). Check: the variance should be smaller than the mean for a binomial, since \( \mathrm{Var} = \mathrm{E}(X)(1-p) \), and \( 3 < 4 \) ✓.

🔗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\)