Discrete Random Variables (AI HL)
A discrete random variable takes a finite (or countable) set of values, each with its own probability, usually laid out as a table or a formula. This page covers how to find a missing probability, how to calculate the expected value \(E(X)\), and what it means when \(E(X)=0\) in a game - with worked examples and the mistakes that lose the most marks. It's part of the broader Probability & Distributions topic.
12 questions on this sub-topic.
The two formulas
Covered under IB syllabus reference SL4.7: the concept of discrete random variables and their probability distributions, and expected value \(E(X)\) for discrete data - including that \(E(X)=0\) indicates a fair game where \(X\) is a player's gain. Neither formula is in the formula booklet.
Expected value
\(E(X) = \Sigma xP(X=x)\)
Multiply each value of \(X\) by its probability, then add. This is the long-run average of \(X\).
Variance
\(\text{Var}(X) = E(X^2)-[E(X)]^2\)
Find \(E(X^2) = \Sigma x^2P(X=x)\) first, then subtract the square of \(E(X)\).
Need the full syllabus wording and formula-booklet reference table? See Probability & Distributions. For calculator routines, see the parent topic's GDC guidance.
Worked examples
The distribution of \(X\) is given in the table.
| \(x\) | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| \(P(X=x)\) | 0.2 | 0.3 | 0.4 | \(p\) |
(a) Find \(p\).
(b) Find \(E(X)\).
Worked solution
(a) 0.2+0.3+0.4+p = 1, so p = 0.1 A1
(b) E(X) = 1(0.2) + 2(0.3) + 3(0.4) + 4(0.1) = 0.2 + 0.6 + 1.2 + 0.4 M1
= 2.4 A1
A die game pays $5 for a six and costs $1 otherwise.
Find the expected gain per roll.
Worked solution
Roll a six (gain \(+5\)) with probability \(\tfrac16;\) roll anything else (gain \(-1\)) with probability \(\tfrac56.\) A1
\(E(X)=5\cdot\tfrac16+(-1)\cdot\tfrac56=\tfrac{5}{6}-\tfrac{5}{6}=0.\) M1 A1
The expected gain is \($0\) per roll, so in the long run the game is fair. R1
Common mistakes
- Using \(P(X\le k)\) when the question means \(P(X
For a discrete variable, "fewer than 3" is \(X\le2\), not \(X\le3\) - always translate the wording into an inequality before reaching for binomcdf. - Forgetting the probabilities must sum to 1. Whenever a table has an unknown \(p\), the very first line should be an equation setting the sum of all the probabilities equal to \(1\) - it's easy to jump straight to \(E(X)\) and skip this check.
- Missing the sign of a loss in \(E(X)\). In a game, a cost or loss must be entered as a negative value of \(x\) - writing it as positive by mistake flips the sign of the whole expected value and can turn a fair game into a winning (or losing) one on paper.
Ready to practise properly?
11 discrete-random-variable questions, marked instantly like the real exam.
Quick answers
What is the formula for the expected value of a discrete random variable?
\(E(X) = \Sigma xP(X=x)\) - multiply each value of \(X\) by its probability and add the results.
What does E(X) = 0 mean in a game?
If \(X\) is a player's gain and \(E(X) = 0\), the game is fair - in the long run a player expects to neither win nor lose money.