Discrete Random Variables (AI HL)

A discrete random variable XX takes separate values, each with a probability, and the probabilities always add up to 11. To use one, list the values and probabilities in a table, find any missing probability by subtracting the others from 11, then combine them to get the expected value. It covers fair games, where the expected gain is 00. It's part of the broader Probability & Distributions topic.

12 questions on this sub-topic.

Syllabus

CodeSyllabus content
SL4.7Concept of discrete random variables and their probability distributions, given as a table or a formula. Expected value E(X)E(X) for discrete data, and its applications - including that E(X)=0E(X)=0 indicates a fair game where XX is a player's gain.

Official IB source: Mathematics: applications and interpretation subject brief (PDF, ibo.org).

Skills practised on this page:

The two formulas

Neither formula is in the formula booklet.

Expected value

E(X)=ΣxP(X=x)E(X) = \Sigma xP(X=x)

Multiply each value of XX by its probability, then add. This is the long-run average of XX.

Variance

Var(X)=E(X2)−[E(X)]2\text{Var}(X) = E(X^2)-[E(X)]^2

Find E(X2)=Σx2P(X=x)E(X^2) = \Sigma x^2P(X=x) first, then subtract the square of E(X)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.

Key terms

What is a probability distribution?

A probability distribution lists every possible value of XX with its probability P(X=x)P(X=x). Each probability lies between 00 and 11, and together they sum to 11.

e.g. If P(X=1)=0.5P(X=1)=0.5, P(X=2)=0.3P(X=2)=0.3 and P(X=3)=pP(X=3)=p, then p=1−0.5−0.3=0.2p=1-0.5-0.3=0.2.

What does expected value mean?

The expected value is the long-run mean of XX over many repeats. It is found by multiplying each value by its probability and adding the results.

e.g. For a fair six-sided die, E(X)=1+2+3+4+5+66=3.5E(X)=\dfrac{1+2+3+4+5+6}{6}=3.5, even though 3.53.5 can never be rolled.

How do you find the variance of a discrete random variable?

Find E(X2)E(X^2) by squaring each value before weighting it by its probability, then use Var(X)=E(X2)−[E(X)]2\text{Var}(X)=E(X^2)-[E(X)]^2.

e.g. If P(X=0)=0.5P(X=0)=0.5 and P(X=1)=0.5P(X=1)=0.5, then E(X)=0.5E(X)=0.5 and E(X2)=0.5E(X^2)=0.5, so Var(X)=0.5−0.52=0.25\text{Var}(X)=0.5-0.5^2=0.25.

How do you find the probability of a range of values?

Add the probabilities of every value in the range. Read the inequality carefully: P(X<3)P(X<3) excludes 33, while P(X≤3)P(X\le3) includes it.

e.g. If P(X=1)=0.2P(X=1)=0.2, P(X=2)=0.3P(X=2)=0.3 and P(X=3)=0.4P(X=3)=0.4, then P(X<3)=0.5P(X<3)=0.5 but P(X≤3)=0.9P(X\le3)=0.9.

Worked examples

1
Easy
No calc
[3 marks]

The distribution of XX is given in the table.

xx1234
P(X=x)P(X=x)0.20.30.4pp

(a)  Find pp.

(b)  Find E(X)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

A1 P-value M1 E(X) formula A1 Correct answer of 2.42.4
2
Medium
GDC
[3 marks]

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+5) with probability 16;\tfrac16; roll anything else (gain −1-1) with probability 56.\tfrac56. A1
E(X)=5⋅16+(−1)⋅56=56−56=0.E(X)=5\cdot\tfrac16+(-1)\cdot\tfrac56=\tfrac{5}{6}-\tfrac{5}{6}=0. M1A1
The expected gain is $0$0 per roll, so in the long run the game is fair.On the GDC. Find the expected gain per roll. The calculator shows about 0.

TI-84 Plus CE: 2nd mode then type (5*1-1*5)/6 enterCasio fx-CG50: MENU Run-Matrix then type (5*1-1*5)/6 EXECasio fx-CG100: HOME Calculate then type (5*1-1*5)/6 EXETI-Nspire CX: home Calculator then type (5*1-1*5)/6 enterFull GDC guide: Enter a calculation on the home screen Topic page

A1 Payoffs and probabilities M1 Applying E(X)=∑xP(x)E(X)=\sum x\,P(x) with 5⋅16+(−1)⋅565\cdot\tfrac16+(-1)\cdot\tfrac56 A1 Expectation set-up and value
3
Hard
GDC
[4 marks]

The distribution of XX is given in the table.

xx0123
P(X=x)P(X=x)0.10.30.40.2

Given E(X)=1.7E(X)=1.7, find Var(X).\text{Var}(X).

Worked solution

E(X2)=0+0.3+1.6+1.8E(X^2)=0+0.3+1.6+1.8 M1
E(X2)=3.7.E(X^2) = 3.7. A1
Var(X)=3.7−1.72.\text{Var}(X)=3.7-1.7^2. M1
Var(X)=0.81.\text{Var}(X) = 0.81. A1On the GDC. Find the variance of X. The calculator shows about 0.81.

TI-84 Plus CE: 2nd mode then type 0.1*0^2+0.3*1^2+0.4*2^2+0.2*3^2-1.7^2 enterCasio fx-CG50: MENU Run-Matrix then type 0.1*0^2+0.3*1^2+0.4*2^2+0.2*3^2-1.7^2 EXECasio fx-CG100: HOME Calculate then type 0.1*0^2+0.3*1^2+0.4*2^2+0.2*3^2-1.7^2 EXETI-Nspire CX: home Calculator then type 0.1*0^2+0.3*1^2+0.4*2^2+0.2*3^2-1.7^2 enterFull GDC guide: Enter a calculation on the home screen Topic page

M1 E(X2)E(X^2) A1 Correct answer of 3.7 M1 E(X2)−μ2E(X^2)-\mu^2 A1 Correct answer of 0.81

Common mistakes

  • Using P(X≤k)P(X\le k) when the question means P(X<k)P(X<k). For a discrete variable, "fewer than 3" is X≤2X\le2, not X≤3X\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 pp, the very first line should be an equation setting the sum of all the probabilities equal to 11 - it's easy to jump straight to E(X)E(X) and skip this check.
  • Missing the sign of a loss in E(X)E(X). In a game, a cost or loss must be entered as a negative value of xx - 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.

Using your GDC

Every step below is a real button sequence, not a vague "use your calculator" hint - covering the TI-84 Plus, TI-Nspire, and Casio fx-9860/fx-CG50. Pick your model to filter down to just the steps that apply to you.

Show steps for:
Inverse normal (find the value for a given probability)

The reverse of a normal probability: given a percentage, find the cut-off value (e.g. the mark for the top 10%).

  1. Work out the area to the LEFT of the value you want.
  2. 2nd → VARS (DISTR) → invNorm(area, μ, σ). Newer OS lets you pick the tail.TI-84
  3. menu → Probability → Distributions → Inverse Normal; enter the area, μ and σ.Nspire
  4. Main menu → Statistics → DIST → NORM → InvN; set the tail and enter area, σ, μ.Casio

Tip: invNorm needs the area to the LEFT. For "top 10%", use area = 0.90; for "bottom 25%", use area = 0.25.

Find an unknown mean or standard deviation (normal)

Given a probability and one parameter, work back to the missing μ\mu or σ\sigma - a standard exam twist.

  1. Turn the probability into a zz-value using the inverse normal with μ=0\mu = 0, σ=1\sigma = 1.
  2. invNorm(area-to-left, 0, 1) gives zz; then solve z=(x−μ)/σz = (x-\mu)/\sigma for the unknown.TI-84
  3. Use Inverse Normal with μ=0\mu=0, σ=1\sigma=1 to get zz, then solve the standardising equation for μ\mu or σ\sigma.Nspire
  4. DIST → NORM → InvN with μ=0\mu=0, σ=1\sigma=1 gives zz; substitute into z=(x−μ)/σz=(x-\mu)/\sigma.Casio
  5. If two probabilities are given, form two equations and solve them simultaneously for μ\mu and σ\sigma.

Tip: Always sketch the curve first so you can tell which side of the mean each value should fall on.

See the full GDC guide for more calculator models and topics.

Quick questions

What is the formula for the expected value of a discrete random variable?

E(X)=ΣxP(X=x)E(X) = \Sigma xP(X=x) - multiply each value of XX by its probability and add the results.

What does E(X) = 0 mean in a game?

If XX is a player's gain and E(X)=0E(X) = 0, the game is fair - in the long run a player expects to neither win nor lose money.

How do I find the expected gain in a game with a cost to play?

Record each outcome as a net gain, so a prize of $5 with an entry fee of $2 gives a net gain of $3, and a lost game gives a net gain of -$2. Then find E(X)E(X) from those net values.

Can an expected value be a number the variable cannot take?

Yes. The expected value is a long-run average, so it need not be a possible value of XX. A fair die has E(X)=3.5E(X)=3.5, which is never rolled.

What should I check if my probabilities do not add up to 1?

Recheck the arithmetic and any probability found by subtraction. Every P(X=x)P(X=x) must lie between 00 and 11, so a negative value for a missing probability means an earlier probability is wrong.

Ready to practise properly?

12 discrete-random-variable questions, marked instantly like the real exam.