James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
IB Diploma › Maths AA SL › Topic 4: Statistics & probability › Discrete random variables

Discrete random variables

Probability distributions of discrete random variables, the expected value, and fair games.

SL 4.7Paper 1Paper 2≈ 40 min to work through
Before you start: probability. See Probability.

1What you need to know

Tick these off as you go. By the end of the page you should be able to do all of them without notes.

  • Know that the probabilities in a distribution add to 1SL 4.7
  • Find unknown probabilities in a distribution table or formulaSL 4.7
  • Find the expected value E(X)SL 4.7
  • Use expected value in context, including fair gamesSL 4.7

2Notes & worked examples

Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.

The big idea

A random variable is a number whose value depends on chance, such as the score on a die or the number of heads in three flips. Listing its values with their probabilities gives its distribution, and the expected value is the long-run average.

2.1 Distributions and expected value

"Discrete" means the values are separate, usually whole numbers, so you can list them. (Heights and times are continuous: they can take any value in a range. See Normal distribution.)

A discrete random variable X takes separate values x with probabilities P(X=x). These probabilities must add to 1.

A probability distribution is often shown in a table, with the values of X in one row and their probabilities in the other. The probabilities must add to 1 because one of the values is certain to happen. This fact is often used to find a missing probability.

Expected value In formula booklet
∑P(X=x)=1E(X)=∑xP(X=x)
Why is this the average?

Roll a fair die 600 times. You would expect about 100 of each score, so the total would be about 100×1+100×2+…+100×6=2100, and the average score about 2100600=3.5. That is the same as 1×16+2×16+…+6×16. So E(X) is a weighted average: each value is weighted by how often it occurs. It does not have to be a value that X can actually take.

Worked example 1Paper 1
P(X=x)=kx for x=1,2,3,4. Find k and E(X).
k(1+2+3+4)=1⇒10k=1, so k=0.1.
E(X)=0.1(12+22+32+42)=0.1(30)=3
Worked example 2Paper 1
X takes values 0, 1, 2, 3 with probabilities 0.1, p, 0.3, q. E(X)=1.8. Find p and q.
Sum: 0.1+p+0.3+q=1⇒p+q=0.6
Mean: 0+p+0.6+3q=1.8⇒p+3q=1.2
Subtract: 2q=0.6, so q=0.3 and p=0.3.

2.2 Fair games

A game is fair if the expected gain (winnings minus cost) is 0.

Casinos and lotteries are designed so that the expected gain for the player is negative: over many games, the player loses money on average, even though some individuals win. To check a game, list each possible gain (prize minus cost to play), multiply by its probability and add.

Worked example 3Paper 1
It costs €2 to play. A fair die is rolled: a six wins €5, a 4 or 5 wins €1, anything else wins nothing. Is the game fair?
Expected winnings =5×16+1×26=76
Expected gain =76−2=−56
Not fair: a player loses about €0.83 per game on average.

Setting up your own distribution. Some questions describe a situation, such as drawing two counters, and ask you to find the distribution of X. List every possible value of X first, then find the probability of each (a tree diagram often helps), and check that the probabilities add to 1. Only then work out E(X).

Worked example 4 (faded)Paper 1
Find E(X) when X is the score on a fair die.
E(X)=1+2+3+4+5+66= 3.5  ← you work this out
On your TI-Nspire Calculator tricks →

Put the values in list x and the probabilities in list p on a Lists & Spreadsheet page, then One-Variable Statistics with p as the Frequency List: x¯ is E(X). Or type sum(x*p).

3Explore it

The distribution of the total score when fair dice are rolled. Choose the number of dice and a target total.

4Common mistakes & exam tips

Common mistakes

  • Forgetting that the probabilities must add to 1.
  • Calculating E(X) as the average of the x values without weighting.
  • Forgetting to subtract the cost to play when finding the expected gain.
  • Expecting E(X) to be a possible value of X: it need not be (e.g. 3.5 on a die).

Exam tips

  • Lay out a table of x and P(X=x) first.
  • Two unknowns usually need two equations: sum to 1 and the given mean.
  • In context, interpret E(X) as a long-run average.

5Practice

Fluency questions build the basics. Problem-solving questions make you think about which method to use.

FluencyP1
X takes three values with probabilities 0.2, 0.5 and p. Find p.
0.3
FluencyP2
X takes values 0, 1, 2 with probabilities 0.5, 0.3, 0.2. Find E(X).
0.3+0.4=0.7
FluencyP3
Find the expected score on a fair six-sided die.
3.5
FluencyP4
What is the expected gain in a fair game?
0
Problem solvingP5
P(X=x)=k(x+1) for x=0,1,2,3. Find k and E(X).
k(1+2+3+4)=1, so k=0.1. E(X)=0.1(0+2+6+12)=2.
Problem solvingP6
Two fair coins are tossed. X is the number of heads. Write down the distribution and find E(X).
P(0)=14, P(1)=12, P(2)=14; E(X)=1.

6Exam-style questions

Original questions in the style of the IB exam, with full markschemes. Give yourself about 1 minute per mark.

Question 1Paper 1[6 marks]

X takes the values 1, 2, 3, 4 with probabilities 0.1, 0.3, k, 0.2.

  • (a)Find k.[2]
  • (b)Find E(X).[2]
  • (c)Find P(X≥3).[2]
(a)
0.1+0.3+k+0.2=1M1
k=0.4A1
(b)
1(0.1)+2(0.3)+3(0.4)+4(0.2)M1
2.7A1
(c)
0.4+0.2M1
0.6A1
Question 2Paper 1[5 marks]

A spinner lands on red with probability 14, blue with probability 12 and green with probability 14. It costs €2 to play. Red wins €6, blue wins €1 and green wins nothing. Determine whether the game is fair.

Expected winnings 6×14+1×12+0×14M1 A1
=2A1
Expected gain =2−2=0M1
so the game is fairR1
Question 3Paper 2[5 marks]

P(X=x)=x230 for x=1,2,3,4.

  • (a)Show that this is a valid probability distribution.[2]
  • (b)Find E(X).[2]
  • (c)Find P(X>2).[1]
(a)
1+4+9+1630M1
=1, and every probability is between 0 and 1R1
(b)
1+8+27+6430M1
103≈3.33A1
(c)
2530=56A1

7Check yourself

Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.

8Past-paper practice

Once you're scoring well above, try real IB questions. Your school or teacher will have these papers.

PaperQuestionFocusDifficulty
Nov 2025 · TZ3 · Paper 1Q1Find k in probability table, then P(X>1.5) and E(X)★☆☆
Nov 2024 · TZ1 · Paper 2Q4Find k for distribution P(X=x)=kx/15, then find E(X)★★☆
Nov 2023 · TZ1 · Paper 2Q6Find a in probability distribution given E(X) = 2.6★★☆
May 2025 · TZ2 · Paper 1Q7Find k in distribution, conditional probability, expected value gives a★★★
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake