Home / AS & A Level Mathematics 9709 / Discrete random variables
Cambridge International AS & A Level Mathematics 9709 · Probability & Statistics 1

Discrete random variables

Drawing up probability distributions, calculating expectation and variance, and using the binomial and geometric distributions: their probabilities, when they are suitable models, and their means and variances.

5.4Paper 5: Probability & Statistics 1Free lesson
What the syllabus says

5.4 (Paper 5)

  • draw up a probability distribution table relating to a given situation involving a discrete random variable X, and calculate E(X) and Var(X)
  • use formulae for probabilities for the binomial and geometric distributions, and recognise practical situations where these distributions are suitable models
  • use formulae for the expectation and variance of the binomial distribution and for the expectation of the geometric distribution.

Notes and examples

  • Including the notations B(n,p) and Geo(p). Geo(p) denotes the distribution in which pr=p(1−p)r−1 for r=1,2,3,… .
  • Proofs of formulae are not required.

Quoted from the Cambridge International AS and A Level Mathematics 9709 syllabus (2026-2027 and 2028-2030 editions, which share this content).

Probability distributions

A discrete random variable X takes separate values, such as 0,1,2,3, each with a probability. Its probability distribution lists every possible value with its probability, usually in a table. The table below is the distribution of the number of heads, X, when two fair coins are tossed. Capital X is the random variable; small x is a particular value it can take.

Two facts check any distribution: every probability is between 0 and 1, and the probabilities add up to 1, because X must take exactly one of its values. That second fact is how you find an unknown constant: if P(X=x)=kx for x=1,2,3,4, then k(1+2+3+4)=1, so k=110.

Drawing up a distribution from a situation. First decide every value X can take. Then find each probability by the methods of the probability topic: counting outcomes, combinations, or a tree diagram. Show the calculation for each value, give exact fractions where you can, and finish by checking the total is 1.

Number of heads when two fair coins are tossed
x012
P(X=x)0.250.50.25

Worked example 1

A bag contains 3 red and 2 blue discs. Two discs are taken at random without replacement. X is the number of red discs taken. Draw up the probability distribution of X.

  1. X can be 0, 1 or 2.

  2. P(X=0)=P(BB)=25×14=110.

  3. P(X=2)=P(RR)=35×24=310.

  4. P(X=1)=P(RB)+P(BR)=35×24+25×34=610.

  5. Check: 110+610+310=1.

Answer: P(X=0)=110, P(X=1)=35, P(X=2)=310

Expectation and variance

The expectation (mean) of X is the long-run average value of X over many repetitions:
E(X)=∑xp
Each value is weighted by how often it happens. The variance measures spread about the mean, and MF19 gives
Var(X)=∑x2p−{E(X)}2.
This is the same idea as for data: the mean of the squares minus the square of the mean. The standard deviation is Var(X).

For the distribution in Worked example 1: E(X)=0×110+1×610+2×310=1210=1.2. Then ∑x2p=0+610+4×310=1.8, so Var(X)=1.8−1.22=0.36.

E(X) need not be a value that X can take: the expected number of red discs is 1.2. A variance can never be negative; if you get a negative one, you have probably squared the probabilities instead of the values.

Check yourself

The random variable X takes the values 1, 2 and 5 with probabilities 0.5, 0.3 and 0.2. Find Var(X).

Answer it in the portal, where your answer is checked as you type →

The binomial distribution

Suppose an experiment is repeated a fixed number n of times, each trial has just two outcomes (success or failure), the probability of success p is the same for every trial, and the trials are independent. Then the number of successes X has the binomial distribution, written X∼B(n,p), and
P(X=r)=(nr)pr(1−p)n−r,r=0,1,…,n.
Why this formula? Any one particular order of r successes and n−r failures, such as SSF...F, has probability pr(1−p)n−r, by multiplying independent probabilities. The successes can be in any r of the n positions, and there are (nr) ways to choose those positions. Each order is exclusive of the others, so add: (nr) copies of the same probability.

Several values. "At most 2" means P(X⩽2)=P(0)+P(1)+P(2). "At least 2" is quickest as 1−P(0)−P(1). "More than 2" excludes 2. Read the inequality carefully: it decides which terms you add.

Mean and variance (given in MF19; proofs are not required):
E(X)=np,Var(X)=np(1−p).
If you know the mean and variance, divide: Var(X)E(X)=1−p, which gives p and then n.

Worked example 2

It is known that 30% of the plants of a certain variety produce white flowers. A gardener plants 8 of these plants. Find the probability that (a) exactly 3 produce white flowers, (b) at least 2 produce white flowers. (c) Find the mean and variance of the number that produce white flowers.

  1. Let X be the number with white flowers. Assuming plants flower independently, X∼B(8,0.3).

  2. (a) P(X=3)=(83)(0.3)3(0.7)5=56×0.027×0.16807=0.254 (3 s.f.).

  3. (b) P(X=0)=0.78=0.057648 and P(X=1)=8×0.3×0.77=0.197650.

  4. P(X⩾2)=1−0.057648−0.197650=0.745 (3 s.f.).

  5. (c) E(X)=8×0.3=2.4 and Var(X)=8×0.3×0.7=1.68.

Answer: (a) 0.254 (b) 0.745 (c) 2.4, 1.68

Check yourself

X∼B(6,0.25). Find P(X=2), giving your answer correct to 3 significant figures.

Answer it in the portal, where your answer is checked as you type →

The geometric distribution

Now repeat independent trials, each with the same probability of success p, but with no fixed number: keep going until the first success. The number of trials needed, X, including the successful one, has the geometric distribution, written X∼Geo(p), with
P(X=r)=p(1−p)r−1,r=1,2,3,…
The reasoning is a single path on a tree: r−1 failures, each with probability 1−p, followed by one success. Note that X starts at 1, not 0, and has no upper limit.

Two results follow and save a lot of work:

  • P(X>r)=(1−p)r, because "more than r trials are needed" means "the first r trials all fail";
  • P(X⩽r)=1−(1−p)r.

So P(3⩽X⩽6)=P(X>2)−P(X>6)=(1−p)2−(1−p)6.

The expectation is E(X)=1p, given in MF19 (proof not required). If a fair die is thrown until a 6 appears, the mean number of throws is 6, which matches intuition: a 6 comes up once in every six throws on average. The variance of the geometric distribution is not in the syllabus.

Worked example 3

The probability that Mia scores from a penalty is 0.8, independently for each penalty. She takes penalties until she scores. Find the probability that (a) she first scores on her 3rd penalty, (b) she needs more than 3 penalties, (c) she needs at most 4 penalties. (d) State the expected number of penalties.

  1. Let X be the number of penalties taken. X∼Geo(0.8).

  2. (a) P(X=3)=0.8×0.22=0.032.

  3. (b) P(X>3)=0.23=0.008: the first three all miss.

  4. (c) P(X⩽4)=1−0.24=1−0.0016=0.9984.

  5. (d) E(X)=10.8=1.25.

Answer: (a) 0.032 (b) 0.008 (c) 0.9984 (d) 1.25

Check yourself

X∼Geo(0.3). Find P(X>4).

Answer it in the portal, where your answer is checked as you type →

Choosing a model

Questions often ask you to say why a distribution is a suitable model, or to state an assumption. Tie each condition to the context.

Binomial B(n,p) needs:

  • a fixed number of trials n (12 seeds in a packet);
  • two outcomes per trial (a seed germinates or does not);
  • the same probability of success each time (each seed has probability 0.85 of germinating);
  • independent trials (whether one seed germinates does not affect another).

Geometric Geo(p) needs the same last three conditions, but counts the trials up to and including the first success, so there is no fixed n.

Typical reasons a model fails: drawing without replacement from a small population (the probability changes from trial to trial, so not binomial); trials that affect each other (a player's confidence after a miss, so not independent); or a question about the number of successes in a fixed number of trials being modelled as geometric. The distinction between the two models is the commonest test: fixed number of trials, count the successes is binomial; count the trials until the first success is geometric.

Worked example 4

A random variable X∼B(n,p) has mean 6 and variance 4.2.

(a) Find n and p. (b) Find P(X=7).

  1. (a) np=6 and np(1−p)=4.2.

  2. Dividing, 1−p=4.26=0.7, so p=0.3 and n=60.3=20.

  3. (b) P(X=7)=(207)(0.3)7(0.7)13=77520×0.0002187×0.0096889=0.164 (3 s.f.).

Answer: (a) n=20, p=0.3 (b) 0.164

Key points

  • The probabilities in a distribution add up to 1: use this to find unknown constants.

  • E(X)=∑xp and Var(X)=∑x2p−{E(X)}2.

  • X∼B(n,p): P(X=r)=(nr)pr(1−p)n−r, E(X)=np, Var(X)=np(1−p).

  • X∼Geo(p): P(X=r)=p(1−p)r−1 for r⩾1, P(X>r)=(1−p)r, E(X)=1p.

  • Binomial: fixed number of independent trials, count the successes. Geometric: count the trials up to the first success.

  • Translate 'at least', 'at most', 'more than' and 'fewer than' into exact inequalities before adding terms.

Where marks are lost

  • Missing a possible value of X (often 0) when drawing up a distribution, or not checking that the probabilities sum to 1.

  • Squaring the probabilities instead of the values in ∑x2p, or forgetting to subtract {E(X)}2.

  • Leaving out (nr) in a binomial probability, or using the wrong power for 1−p.

  • Treating 'at least 2' as 1−P(X⩽2); it is 1−P(X⩽1).

  • Using (1−p)r for P(X=r) in a geometric distribution: that is P(X>r).

  • Giving a reason for a model that is not in context, such as 'the trials are independent' with no mention of the seeds or the calls.

  • Rounding intermediate probabilities: keep at least 4 significant figures until the final answer.

Related AS & A Level Mathematics 9709 lessons

All AS & A Level Mathematics 9709 lessons →

An original lesson written to the Cambridge International AS & A Level Mathematics 9709 syllabus (2026 to 2027 and 2028 to 2030). The worked examples and questions are our own, not Cambridge questions. Back to every AS & A Level Mathematics 9709 lesson.