MathematicsCore24 min read

Discrete Random Variables

A list of outcomes with probabilities attached, and the two numbers that summarise it

This topic appears in:

01

A variable whose value is decided by chance

A random variable is a quantity whose value depends on the outcome of an experiment — the score on a die, the number of faulty items in a batch, the number of heads in four tosses. It is written with a capital letter, X, while a particular value it might take is written with a small letter, x.

The variable is discrete when the values it can take are separate and countable. Scores on a die are discrete; the exact height of a person is not, because between any two heights there is another.

The probability distribution is the complete list of the values X can take together with the probability of each. Because the list covers every possibility and no two can happen at once, the probabilities must add to exactly 1 — which is the fact almost every question uses to find a missing value.

Σ P(X = x) = 1over all possible x0 ⩽ P(X = x) ⩽ 1for every xthe probabilities of a complete distribution always total 1
X
the random variablecapital letter, the quantity itself
x
a value it can takesmall letter, one particular outcome
P(X = x)
the probability of that valueread as "the probability that X takes the value x"

The total is your free equation

When a distribution is given with an unknown in it — often k or a — you are always meant to use ΣP(X = x) = 1 to find it. This is the opening mark of most questions in the topic, and it is worth writing the sum out in full before solving.

02

Expectation is a balance point

The expected value E(X) is the long-run average of X over very many repetitions. It is calculated by weighting each value by its probability and adding.

Two things about it surprise people, and both are worth confronting directly. First, E(X) need not be a value X can actually take — the expected score on a fair die is 3.5, which no die ever shows. Second, it is not the most likely value; it is the balance point of the distribution, the place a ruler carrying the probabilities as weights would sit level.

E(X) = μ = Σ x·P(X = x)Var(X) = σ² = E(X²) − [E(X)]²= Σ x²·P(X = x) − μ²standard deviation σ = √(Var(X))compute E(X²) by squaring the x values, never the probabilities
E(X)
the mean, μthe balance point of the distribution
E(X²)
Σx²P(X = x)square the values, keep the probabilities as they are
Var(X)
the variance, σ²a measure of spread, never negative

The pivot marks E(X). On Skewed, weighting the low values drags the balance point left. On Two peaks, E(X) lands at 3.5 where almost no probability sits at all — proof that the mean is not the most likely value.

03

Variance: the mean of the squares minus the square of the mean

Variance measures spread. The definition is the average squared distance from the mean, but the version used in practice is the rearranged one above, because it needs only one pass through the table.

The order of operations is what people get wrong. E(X²) means square each value and weight by its probability. [E(X)]² means find the mean first and then square it. These are different numbers, and the variance is the gap between them.

Worked example

The random variable X has P(X = 1) = 0.2, P(X = 2) = 0.5, P(X = 3) = k. Find k, then E(X) and Var(X).

  1. The probabilities sum to 1: 0.2 + 0.5 + k = 1, so k = 0.3.Always the first step when a distribution contains an unknown.
  2. E(X) = 1(0.2) + 2(0.5) + 3(0.3) = 0.2 + 1.0 + 0.9 = 2.1.Each value multiplied by its own probability, then added.
  3. E(X²) = 1(0.2) + 4(0.5) + 9(0.3) = 0.2 + 2.0 + 2.7 = 4.9.The values are squared — 1, 4, 9 — while the probabilities stay exactly as they were.
  4. Var(X) = 4.9 − 2.1² = 4.9 − 4.41 = 0.49.E(X²) minus the square of the mean. Squaring the mean, not the values, is the second half.
  5. σ = √0.49 = 0.7.The standard deviation is in the same units as X, which is why it is often quoted instead of the variance.

k = 0.3, E(X) = 2.1, Var(X) = 0.49

A negative variance means an arithmetic slip

Variance is an average of squared quantities, so it can never be negative. If E(X²) − μ² comes out negative, the usual cause is squaring the probabilities instead of the values, or forgetting to square the mean. Treat a negative answer as a signal to recheck rather than something to report.

04

The binomial distribution

One discrete distribution appears far more than any other, because a great many situations share the same structure: a fixed number of independent trials, each either a success or a failure, with the same probability every time.

When those four conditions hold, X is binomial, written X ~ B(n, p). The probability formula counts the arrangements with ⁿCr and then multiplies by the probability of any one such arrangement.

X ~ B(n, p)P(X = r) = ⁿCr · pʳ · (1 − p)ⁿ⁻ʳE(X) = npVar(X) = np(1 − p)the powers of p and (1 − p) must add to n
n
the number of trialsfixed in advance
p
probability of successthe same for every trial
ⁿCr
the number of arrangementswhich r of the n trials succeeded

Read "at least" and "at most" carefully

P(X ⩾ 2) is easiest as 1 − P(X = 0) − P(X = 1), since the complement is far shorter than summing every remaining term. Watch the boundary: "more than 2" excludes 2 and starts at 3, while "at least 2" includes it. Getting this boundary wrong is the single most common way to lose an otherwise correct binomial answer.

The four conditions, all of which must hold

  1. A fixed number of trials, n, decided before starting.
  2. Each trial has exactly two outcomes, success or failure.
  3. The trials are independent — one result does not affect another.
  4. The probability of success p is constant across all trials.
  5. Sampling without replacement breaks independence and constancy, so it is not binomial unless the population is very large.

Practice questions

5 questions · 18 marks · full working on every one

Try each one on paper first, then open the working. The marks are shown where they are actually awarded, because that is where they are actually lost.

Short questions

2 · 4 marks

Two marks each, in the style of the short-question section of the paper. Answer in two or three lines.

SQ1[2 marks]
State two conditions that must hold for a situation to be modelled by a binomial distribution.
Model answer

Any two of: a fixed number of trials; each trial has only two outcomes; the trials are independent; the probability of success is constant for every trial.

Examiner tip. One mark each. State them as conditions, not as a description of the situation in the question.

SQ2[2 marks]
Explain why the expected score when rolling a fair die is 3.5, even though a die can never show 3.5.
Model answer

E(X) is the long-run average of many rolls, not a value of a single roll. Averaging the six equally likely scores gives (1+2+3+4+5+6)/6 = 3.5. An average need not be one of the values being averaged.

Examiner tip. The mark is for the long-run average idea. Saying "it is the middle" is not enough, since that is only true for symmetric distributions.

Solved numericals

2 · 8 marks

Full working, one step per line, with the marks shown where they are awarded.

N1[4 marks]
The discrete random variable X has the distribution P(X = 0) = 0.1, P(X = 1) = 0.4, P(X = 2) = 0.3, P(X = 3) = c. Find c, E(X) and Var(X).
Full working
  1. 0.1 + 0.4 + 0.3 + c = 1, so c = 0.2Using the fact that the probabilities total 1.[1]
  2. E(X) = 0(0.1) + 1(0.4) + 2(0.3) + 3(0.2) = 1.6Each value weighted by its probability.[1]
  3. E(X²) = 0 + 1(0.4) + 4(0.3) + 9(0.2) = 3.4Values squared, probabilities unchanged.[1]
  4. Var(X) = 3.4 − 1.6² = 3.4 − 2.56 = 0.84E(X²) minus the square of the mean.[1]

c = 0.2, E(X) = 1.6, Var(X) = 0.84

N2[4 marks]
A fair six-sided die is rolled 8 times. Find the probability of getting exactly 3 sixes, and the expected number of sixes.
Full working
  1. X ~ B(8, 1/6), since the rolls are independent with constant pIdentifying the distribution and its parameters.[1]
  2. P(X = 3) = ⁸C₃ (1/6)³ (5/6)⁵The powers must add to 8: three successes and five failures.[1]
  3. = 56 × 0.004630 × 0.401878 = 0.104To 3 significant figures.[1]
  4. E(X) = np = 8 × 1/6 = 1.33The expected number need not be a whole number.[1]

P(X = 3) = 0.104, E(X) = 1.33

Exam questions

1 · 6 marks

Multi-part questions with a full mark scheme.

Q1[6 marks]
12% of components produced by a machine are faulty. A sample of 20 is taken.
(a) Find the probability that exactly 2 are faulty.
(b) Find the probability that at least 2 are faulty.
(c) Find the mean and variance of the number of faulty components.
(d) State an assumption required for the binomial model to be valid here.
Mark scheme
  1. (a) X ~ B(20, 0.12); P(X = 2) = ²⁰C₂(0.12)²(0.88)¹⁸ = 190 × 0.0144 × 0.1002 = 0.274Correct parameters and formula.[1]
  2. Value 0.274 to 3 s.f.Full evaluation.[1]
  3. (b) P(X ⩾ 2) = 1 − P(X = 0) − P(X = 1)The complement is much shorter than summing 19 terms.[1]
  4. P(X = 0) = 0.88²⁰ = 0.0776; P(X = 1) = 20(0.12)(0.88)¹⁹ = 0.2115Both terms needed before subtracting.[1]
  5. P(X ⩾ 2) = 1 − 0.0776 − 0.2115 = 0.711"At least 2" includes 2, so only 0 and 1 are removed.[1]
  6. (c) E(X) = 20 × 0.12 = 2.4; Var(X) = 20 × 0.12 × 0.88 = 2.112. (d) Faults occur independently, and the probability stays constant at 0.12 for every component.The assumption mark needs a statement about independence or constant probability, in context.[1]

(a) 0.274; (b) 0.711; (c) mean 2.4, variance 2.112; (d) independence with constant p