Salam Academy
Discrete random variables · Subtopic 2 of 3

Expectation and Variance

The expectation E(X)E(X) is the long-run average value of XX: each value weighted by its probability. The variance measures the spread, using the same "mean of the squares minus the square of the mean" idea as for data.

Cambridge 9709 Paper 5Edexcel 9FM0 OptionAQA 7367 Paper 3≈ 30 minRevision 6 · updated 2026-10-27
Section 1 of 14

Learning objectives

  • Calculate E(X)=Σx P(X=x)E(X)=\Sigma x\,P(X=x).
  • Calculate E(X2)E(X^2) and Var(X)=E(X2)−[E(X)]2\text{Var}(X)=E(X^2)-[E(X)]^2.
  • Use E(X)E(X) and ΣP=1\Sigma P=1 to find unknown probabilities.
  • Interpret expected value in games and decisions.
Pause and think

A game costs $2\$2 to play. You win $5\$5 with probability 0.30.3, otherwise nothing. Should you expect to win or lose money if you play many times?

Section 2 of 14

Core idea

Start hereIs this game worth playing?

Pay 2 dollars to roll a die; win 10 dollars on a six. Sometimes you win big, mostly you lose a little. Over many games, do you come out ahead? The expected value answers: the long-run average per game.

The big idea

E(X)=∑xP(X=x)E(X)=\sum xP(X=x) is the long-run average. Var⁡(X)=E(X2)−[E(X)]2\operatorname{Var}(X)=E(X^2)-[E(X)]^2 measures spread.

1. Expectation

E(X) is the balance point of the distribution
123−0.10.10.20.30.40.50xP(X = x)E(X) = 1.9
For P=0.1,0.2,0.4,0.3P=0.1, 0.2, 0.4, 0.3 at x=0,1,2,3x=0,1,2,3: E(X)=0+0.2+0.8+0.9=1.9E(X)=0+0.2+0.8+0.9=1.9. The distribution would balance on a pivot at 1.91.9.
Why ∑xP\sum xP
  1. in N trials, value x occurs about NP(X=x) times\text{in }N\text{ trials, value }x\text{ occurs about }NP(X=x)\text{ times}
    Long-run frequency.
  2. mean≈∑x⋅NP(X=x)N=∑xP(X=x)\text{mean}\approx\frac{\sum x\cdot NP(X=x)}{N}=\sum xP(X=x)
    Total ÷ number of trials.
Worked exampleP=0.1,0.2,0.4,0.3P=0.1,0.2,0.4,0.3 at x=0,1,2,3x=0,1,2,3

Find E(X)E(X) and Var⁡(X)\operatorname{Var}(X).

Goal
Two values.
Strategy
E(X)E(X), E(X2)E(X^2), then the formula.
  1. E(X)=0+0.2+0.8+0.9=1.9E(X)=0+0.2+0.8+0.9=1.9
    ∑xp\sum xp.
  2. E(X2)=0+0.2+1.6+2.7=4.5E(X^2)=0+0.2+1.6+2.7=4.5
    ∑x2p\sum x^2p.
  3. Var⁡=4.5−1.92=0.89\operatorname{Var}=4.5-1.9^2=0.89
    Formula.
Answer1.91.9; 0.890.89 (SD 0.9430.943).
✓ CheckE(X)E(X) lies between 00 and 33, nearer the heavy end ✓.
Worked exampleThe dice game

Is it fair?

Goal
Expected profit.
Strategy
Distribution of profit XX.
  1. X=8  (p=16),X=−2  (p=56)X=8\ \ (p=\tfrac16),\quad X=-2\ \ (p=\tfrac56)
    Win 10 minus stake 2; or lose stake.
  2. E(X)=86−106=−13E(X)=\tfrac86-\tfrac{10}6=-\tfrac13
    ∑xp\sum xp.
AnswerYou lose about 33 cents a game on average: not fair.
✓ CheckFair would need a prize of 12 dollars ✓.
Common misconceptionE(X2)≠[E(X)]2E(X^2)\neq[E(X)]^2 Their difference is exactly the variance (which is never negative).
Pause and think

E(X)E(X) for a fair die?

Summary

  • E(X)=∑xpE(X)=\sum xp.
  • Var⁡=E(X2)−E(X)2\operatorname{Var}=E(X^2)-E(X)^2.
Key words
Expectation
Long-run mean.
HistoryHuygens' "expectation". The idea of a mathematical expectation, the fair value of a gamble, was set out by Christiaan Huygens in 1657. He asked what a player's chance in a game is "worth", and answered with the probability-weighted average of the prizes. The word "expectation" comes from the Latin translation, expectatio.
Fun factThe house always wins. On a European roulette wheel, a $1\$1 bet on red wins $1\$1 with probability 1837\tfrac{18}{37} and loses $1\$1 otherwise. The expected gain is 1837−1937=−137\tfrac{18}{37}-\tfrac{19}{37}=-\tfrac1{37}: about 2.72.7 cents lost for every dollar bet. The single green zero is the casino's entire profit margin.
Keep reading for free

Create a free account to read the rest of this lesson: key formulae, worked examples, explore the graph, common mistakes, exam tip, guided practice and more. Your answers are checked and your progress is saved.