A discrete random variable X takes separate values, such as 0, 1, 2 or 3, each with a probability. Two facts drive almost every question: the probabilities must add up to 1, and the expected value is E(X) = Σ x P(X = x), the long-run average if the experiment were repeated many times. With those two equations you can find unknown probabilities, decide whether a game is fair, and check your own working.
This is one of the shorter parts of the AA statistics and probability topic, which the IB guide gives 27 hours at SL and 33 at HL. It is also one of the friendliest places to bank marks on Paper 1, because the arithmetic is usually fractions or one-decimal probabilities, and the same ideas reappear on Paper 2 with a calculator. If probability questions still feel like guesswork, a tutor for IB Maths AA SL can give the topic structure quickly.
The two rules, and one check
For any discrete probability distribution:
- Each probability is between 0 and 1, and Σ P(X = x) = 1.
- E(X) = Σ x P(X = x). Multiply each value by its probability and add.
The check: E(X) must lie between the smallest and largest values of X. If X takes values 1 to 4 and you get E(X) = 5.2, something has gone wrong.
E(X) does not have to be a value X can take. A fair die has E(X) = 3.5, which no single roll can show.
Worked example 1: find k, then E(X)
The random variable X has P(X = x) = kx for x = 1, 2, 3, 4.
(a) Find k.
The probabilities are k, 2k, 3k and 4k. They add to 1, so 10k = 1 and k = 1/10.
(b) Find P(X ≥ 3).
P(X = 3) + P(X = 4) = 3/10 + 4/10 = 7/10.
(c) Find E(X).
E(X) = 1(1/10) + 2(2/10) + 3(3/10) + 4(4/10) = (1 + 4 + 9 + 16)/10 = 3.
Writing the table out in full, even when the formula is given, prevents the common slip of including an x value the question excludes.
Worked example 2: two unknowns from E(X)
The table shows the distribution of X, and E(X) = 1.6.
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| P(X = x) | 0.1 | a | b | 0.2 |
Sum rule: 0.1 + a + b + 0.2 = 1, so a + b = 0.7.
Expected value: 0(0.1) + 1(a) + 2(b) + 3(0.2) = 1.6, so a + 2b = 1.
Subtract the first equation from the second: b = 0.3, so a = 0.4.
a = 0.4 and b = 0.3. Both are between 0 and 1, which is a check worth writing down.
This type is popular because it joins probability to simultaneous equations. Two unknowns need two equations, and the question always gives you exactly enough information for the second one.
Worked example 3: is the game fair?
A player rolls a fair six-sided die. A 6 wins 10 tokens, a 4 or a 5 wins 3 tokens, and anything else wins nothing. It costs c tokens to play.
(a) Find the expected winnings per game, before paying.
Let W be the number of tokens won.
| w | 10 | 3 | 0 |
|---|---|---|---|
| P(W = w) | 1/6 | 2/6 | 3/6 |
E(W) = 10(1/6) + 3(2/6) + 0 = 16/6 = 8/3 tokens.
(b) Find c for the game to be fair.
A game is fair when the expected gain is zero. The gain is W − c, so E(W) − c = 0 and c = 8/3 tokens (about 2.67).
(c) The game actually costs 3 tokens. Find the expected gain over 30 games.
Expected gain per game = 8/3 − 3 = −1/3. Over 30 games: 30 × (−1/3) = −10 tokens. The player expects to lose 10 tokens.
The trap in fair-game questions is the cost. Decide whether the prize includes the returned stake or not, and define your variable as the gain if the question talks about profit. Setting out a table with the net amounts avoids the confusion.
Worked example 4: building the distribution yourself
A bag holds 3 red and 2 blue counters. Two are taken out without replacement. Let X be the number of red counters taken.
Here nobody gives you a table; you build it with a tree or by listing.
- P(X = 0) = P(blue, blue) = (2/5)(1/4) = 1/10
- P(X = 2) = P(red, red) = (3/5)(2/4) = 3/10
- P(X = 1) = 1 − 1/10 − 3/10 = 6/10. As a check: P(red, blue) + P(blue, red) = (3/5)(2/4) + (2/5)(3/4) = 6/20 + 6/20 = 6/10.
| x | 0 | 1 | 2 |
|---|---|---|---|
| P(X = x) | 1/10 | 6/10 | 3/10 |
E(X) = 0 + 6/10 + 6/10 = 6/5 = 1.2.
A sense check: 3/5 of the counters are red and you take 2, so on average 2 × 3/5 = 1.2 red counters. The answers agree. The without-replacement branches are the same skill as in our sibling guide to conditional probability, Venn and tree diagrams.
The HL extension: variance
AA HL students also find the variance of a discrete random variable:
Var(X) = E(X²) − [E(X)]², where E(X²) = Σ x² P(X = x).
For worked example 4: E(X²) = 0 + 1(6/10) + 4(3/10) = 18/10 = 1.8, so Var(X) = 1.8 − 1.2² = 0.36, and the standard deviation is 0.6.
The common error is squaring the probabilities instead of the values. Only x is squared. HL also uses E(aX + b) = aE(X) + b and Var(aX + b) = a²Var(X); our HL guide to Bayes' theorem and continuous random variables works through those rules.
A table or a named distribution?
| Situation | Model | E(X) |
|---|---|---|
| Probabilities given in a table or by a formula such as kx | General discrete distribution | Σ x P(X = x) |
| Fixed number of independent trials, same success probability | Binomial B(n, p) | np |
| A continuous measurement, symmetric about a mean | Normal (not discrete) | μ |
If the situation is binomial, E(X) = np is far quicker than building a table. Our overview of binomial, normal and other IB distributions helps you recognise each one, and the sibling post on normal distribution questions and the inverse normal covers the continuous case.
Mistakes our tutors see
- Probabilities that do not add to 1. Always check the sum before using a table.
- Accepting a negative probability when solving for k or a. Reject it, or recheck your algebra.
- Forgetting the cost in a fair-game question, or subtracting it twice.
- Squaring the probabilities instead of the values when finding E(X²).
- Treating "without replacement" as independent, so the second branch keeps the old denominator.
- Rounding decimals early in a long Paper 2 question.
Exam technique
- Draw the table with x on the top row, even when the question does not ask for it.
- Show the equation for Σ P = 1 as a line of working. It is often worth a method mark on its own.
- Use fractions on Paper 1. Keep thirds and sixths exact until the last line.
- Interpret E(X) in context when asked: "on average, the player loses one third of a token per game".
- For mixed practice across the probability unit, use our guide to building a topic-by-topic question bank.
Self-check
- A spinner gives 1, 2 or 5 with probabilities 0.5, 0.3 and 0.2. Find E(X).
- P(X = x) = c(x² + 1) for x = 0, 1, 2. Find c and E(X).
- A game costs 5 tokens. You toss two fair coins and win 12 tokens for two heads, 4 tokens for exactly one head, and nothing otherwise. Is the game fair?
- Explain why P(X = x) = (x − 1)/6 for x = 0, 1, 2, 3, 4 cannot be a probability distribution.
Answers.
1: 0.5 + 0.6 + 1.0 = 2.1.
2: c(1 + 2 + 5) = 1, so c = 1/8. E(X) = 0 + 1(2/8) + 2(5/8) = 12/8 = 3/2.
3: E(winnings) = 12(1/4) + 4(1/2) = 3 + 2 = 5 tokens, equal to the cost, so the expected gain is 0 and the game is fair.
4: P(X = 0) = −1/6, which is negative, and the probabilities add to 5/6, not 1. Both rules fail.
How Maths Bodhi helps
Tutors build the habit of writing the table and the two equations before any calculation, then add exam-style twists such as costs and without-replacement draws. For extra help across the probability unit, see our probability tutoring. Students who want the senior tutor can read about Ajay Vatsyayan's Analysis and Approaches SL classes.
Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.
Written and checked by the Maths Bodhi team. Facts checked against official IB sources, November 2026.
Frequently asked questions
- What is a discrete random variable in IB maths?
- A variable that takes separate, countable values, each with a probability, where all the probabilities are between 0 and 1 and add up to 1.
- How do you calculate expected value in IB maths?
- Multiply each value of X by its probability and add the results: E(X) = Σ x P(X = x). For a binomial distribution you can use E(X) = np instead.
- What makes a game fair in IB maths?
- A game is fair when the expected gain for the player is zero, so the expected winnings equal the cost of playing.
- How do I find two unknown probabilities in a table?
- Use two equations: the probabilities add to 1, and the given expected value equals Σ x P(X = x). Solve them simultaneously and check that both answers lie between 0 and 1.
- Is the variance of a discrete random variable in AA SL?
- Expected value is the main focus at SL. The variance of a discrete random variable, Var(X) = E(X²) − [E(X)]², is part of the AA HL content, so HL students should practise it.
