Ⅵ Counting, Probability & Statistics · Stage 33 — Probability · 33.7 Expectation & VarianceAll lessons →
Stage 33 · Probability

Expectation and Variance

Two numbers tame a whole distribution: where it lands on average, and how far it swings.

Ages 14–18 · Reasoning, one step at a time
One die. Its six faces are equally likely, so its expectation sits at the balance point E(X) = 3.5 (the green fulcrum) — a value the die never actually shows. The amber band reaches one standard deviation σ ≈ 1.71 on each side, measuring the spread.

A distribution table tells you everything about a random variable X — every value it can take and the probability of each. But "everything" is often too much. If a friend asks whether a game is worth playing, you don't recite a table; you answer with a number or two. Where does X land on average? That is the expectation E(X), the probability-weighted mean — the balance point of the whole distribution. And how wildly does X swing around that average? That is the variance D(X) and its square root σ. Two distributions can share the same center yet feel utterly different to bet on; today we build both numbers honestly, from the distribution itself, and use them to weigh risk.

33.7.1 Expectation: the long-run average

Imagine playing a game over and over. Each round you win some amount, and the amounts vary at random. What's your average winning per round, in the long run? If a value xi comes up a fraction pi of the time, then over many rounds it contributes xi to the total exactly pi of the time. Add up every value, weighted by how often it happens, and you get the long-run average. That weighted sum has a name.

Mathematical expectation

For a discrete random variable X with values x1, x2, …, xn and probabilities p1, p2, …, pn,

E(X) = x1p1 + x2p2 + ⋯ + xnpn = Σ xipi.

This is the probability-weighted mean: each value pulls on the average with a force equal to its probability. Picture the distribution drawn as bars sitting on a seesaw — E(X) is the single point where it balances.

Take a fair die, X = the number rolled. Each face has probability 1/6, so

E(X) = 1· + 2· + 3· + 4· + 5· + 6· = 21/6 = 3.5.

Notice: 3.5 is never a face of the die. The expectation is the balance point, not a prediction of any single roll — the average of many rolls drifts toward 3.5, but no roll ever lands there. Conclusion: E(X) summarizes the whole distribution as one balance point, found by weighting every value by its probability.

A fair die's distribution. Six equal green bars, each of height 1/6; the probabilities are all ≥ 0 and sum to 1. The green fulcrum marks where they balance: E(X) = 3.5.
Try it Move the mass, watch the balance point shift

A four-value distribution on 1, 2, 3, 4. Slide probability from the small values toward the large ones and watch the green fulcrum E(X) follow the weight.

Shift weight toward larger values

33.7.2 Properties of expectation: shift and scale ride along

Suppose X is your winnings, and the casino changes the rules: every payout is doubled, then a flat $1 fee is subtracted. Your new winnings are Y = 2X − 1. Do you have to rebuild the whole distribution to find the new average? No — expectation rides straight through linear changes.

Linearity of expectation

E(aX + b) = a·E(X) + b.

In words: scaling X by a scales the average by a; shifting X by b shifts the average by b. Every value xi becomes a·xi + b but keeps its same probability pi, so Σ(a·xi + b)pi = a·Σxipi + b·Σpi = a·E(X) + b·1.

Worked example

A fair die has E(X) = 3.5. Let Y = 2X − 1 (double the face, subtract one). Then

E(Y) = 2·E(X) − 1 = 2·3.5 − 1 = 6 − 1 = 6.

Check the slow way: Y takes the values 1, 3, 5, 7, 9, 11, each with probability ⅙; their average is (1+3+5+7+9+11)/6 = 36/6 = 6. The shortcut agrees.

Conclusion: once you know E(X), any linear rescaling aX + b of the prize needs no new table — just transform the average directly.

Try it Transform the prize, predict the new average

Start from a fair die, E(X) = 3.5. Dial the scale a and shift b; the readout shows E(aX + b) = a·E(X) + b — and verifies it against the transformed distribution computed term by term.

scale a 2
shift b −1

33.7.3 A fair game? Expectation makes the call

Here is where expectation earns its keep. A carnival booth offers a game: pay a ticket price to play, then draw a prize at random. Should you play? The expectation answers it. Compute E(X) = the average prize, and compare it to what you paid. If E(X) equals the price, the game is fair — break-even in the long run. If E(X) is less, the house wins on average; if more, the game favors you (and won't last long!).

Worked example — the spinner booth

A wheel pays $10 with probability 0.1, $2 with probability 0.3, and $0 with probability 0.6. The average payout is

E(X) = 10·0.1 + 2·0.3 + 0·0.6 = 1 + 0.6 + 0 = $1.60.

If a ticket costs $2, your net expectation per play is 1.602 = −$0.40: you lose 40 cents per play on average. Not fair. A fair ticket would cost exactly $1.60.

Conclusion: a game is fair when the expected prize equals the ticket price; expectation turns "should I play?" into one subtraction.

Try it Set the ticket price — is the game fair?

The payoff table is fixed (prizes $10 / $2 / $0 with probabilities 0.1 / 0.3 / 0.6, so E(X) = $1.60). Slide the ticket price and watch the net expectation E(X) − price flip from favorable (green) through fair to a loss (red).

ticket price ($)

33.7.4 Variance: how much X swings

Two games can share the same expectation and still feel nothing alike. Game A always pays exactly $3. Game B pays $0 or $6, each with probability ½. Both average $3 — but A is a sure thing while B is a coin-flip gamble. Expectation alone can't tell them apart. We need a number for the swing.

Measure each value's distance from the average, (xi − E). We can't just average those gaps — the positive and negative ones cancel to zero (that's exactly what "balance point" means). So we square each gap first (squares are never negative), then take the probability-weighted average of the squares.

Variance and standard deviation

D(X) = Σ pi(xi − E)²,   and   σ = √D(X).

The variance D(X) is the average squared distance from the mean. Because it squares, its units are awkward (dollars²). Taking the square root gives the standard deviation σ, which lives in the same units as X (dollars) — a clean "typical distance from the average."

Worked example — A vs B

Game A (always $3): the only value is 3 with probability 1, gap 0, so D(X) = 1·(3−3)² = 0, σ = 0. No swing at all.

Game B ($0 or $6, each ½): E = 3, gaps are −3 and +3, so

D(X) = ½·(0−3)² + ½·(6−3)² = ½·9 + ½·9 = 9,   σ = √9 = 3.

Same expectation $3, wildly different spread: σA = 0 vs σB = 3.

Conclusion: variance weights the squared gaps by probability; its root σ is the typical swing of X, in X's own units.

Watch out — the two classic slips

E(X) need not be a value X can take. A die's E(X) = 3.5, but the die never shows 3.5. Expectation is a balance point, not a prediction.

Variance uses squared, weighted deviations. Don't average the raw gaps (they cancel to 0), and don't forget the probabilities pi. It is Σ pi(xi − E)², not Σ(xi − E) and not Σ(xi − E)².

33.7.5 Using variance: smaller spread, steadier bet

Variance has the same friendly behavior under shifts and scales as expectation — with one twist. A pure shift b slides every value over together, so the swing doesn't change: D(X + b) = D(X). But scaling by a stretches every gap by a, and since variance squares the gaps, it grows by .

Variance under a linear change

D(aX + b) = a²·D(X),   so   σ(aX + b) = |a|·σ(X).

Adding a constant b shifts the center but never the spread; multiplying by a stretches the spread by |a| (the standard deviation) or (the variance).

Now the payoff for risk. Suppose two investment plans have the same expected return E(X). Which would you choose? The one that swings less — the one with the smaller variance — because it delivers that same average return more reliably, with fewer nasty surprises. Equal expectation, smaller σ: the safer bet.

Worked example — two plans, same mean

Plan A returns 2%, 4%, 6% with probabilities 0.25, 0.5, 0.25. Plan B returns 0%, 4%, 8% with the same probabilities 0.25, 0.5, 0.25.

Both have E = 2·0.25 + 4·0.5 + 6·0.25 = 4% (and B: 0·0.25 + 4·0.5 + 8·0.25 = 4%). But

DA = 0.25·(2−4)² + 0.5·0 + 0.25·(6−4)² = 1 + 0 + 1 = 2  (σA ≈ 1.41%),

DB = 0.25·(0−4)² + 0.5·0 + 0.25·(8−4)² = 4 + 0 + 4 = 8  (σB ≈ 2.83%).

Same 4% average, but B swings twice as much. For a steady investor, Plan A is the safer bet.

Conclusion: when expectations tie, the smaller variance wins — variance is the mathematical name for risk.

Try it Same mean, different spread — which is safer?

Two plans, both with E(X) = 4, drawn side by side. Spread plan B's mass out from the center and watch its amber ±σ band widen while its mean stays pinned. Smaller band = steadier.

Plan B spread

What to carry forward

The two summary numbers of a distribution
IdeaFormulaWhat it tells you
Expectation E(X)Σ xipithe long-run average — the balance point of the distribution
LinearityE(aX + b) = a·E(X) + bshift & scale ride straight through
Variance D(X)Σ pi(xi − E)²the average squared swing around E(X)
Std. deviation σ√D(X)typical swing, in X's own units
Variance scalingD(aX + b) = a²·D(X)shift leaves spread alone; scale by a multiplies D by a²
Risk ruleequal E, smaller Dthe steadier (safer) choice

Exercises

  1. A random variable X takes the values 0, 1, 2 with probabilities 0.2, 0.5, 0.3. Find E(X).
    Show answer
    E(X) = 0·0.2 + 1·0.5 + 2·0.3 = 0 + 0.5 + 0.6 = 1.1. (Note 1.1 is not a value X can take — that's fine, it's the balance point.)
  2. For the X in Exercise 1, find the variance D(X) and the standard deviation σ.
    Show answer
    With E = 1.1: D(X) = 0.2·(0−1.1)² + 0.5·(1−1.1)² + 0.3·(2−1.1)² = 0.2·1.21 + 0.5·0.01 + 0.3·0.81 = 0.242 + 0.005 + 0.243 = 0.49. Then σ = √0.49 = 0.7.
  3. A fair coin is flipped once; X = 1 for heads, 0 for tails. Find E(X) and D(X).
    Show answer
    E(X) = 1·½ + 0·½ = 0.5. D(X) = ½·(1−0.5)² + ½·(0−0.5)² = ½·0.25 + ½·0.25 = 0.25, so σ = 0.5. (This is the Bernoulli case: E = p, D = p(1−p) = 0.5·0.5 = 0.25.)
  4. A lottery ticket costs $3. It pays $100 with probability 0.01, $5 with probability 0.2, and nothing otherwise. Is buying a ticket a fair deal?
    Show answer
    E(prize) = 100·0.01 + 5·0.2 + 0·0.79 = 1 + 1 + 0 = $2. The ticket costs $3, so your net expectation is 2 − 3 = −$1 per ticket. Not fair — you lose $1 on average each time. A fair price would be $2.
  5. If X has E(X) = 10 and D(X) = 4, find E(3X + 5) and D(3X + 5).
    Show answer
    E(3X + 5) = 3·E(X) + 5 = 3·10 + 5 = 35. D(3X + 5) = 3²·D(X) = 9·4 = 36 (the +5 shift doesn't change the spread; only the ×3 does, by a factor of 9). So σ goes from 2 to 6.
  6. Plan P returns 3 or 5 (each with probability ½); Plan Q returns 1 or 7 (each with probability ½). Both average 4. Which plan is the safer bet, and by how much (compare σ)?
    Show answer
    E_P = E_Q = 4. D_P = ½·(3−4)² + ½·(5−4)² = ½ + ½ = 1, σ_P = 1. D_Q = ½·(1−4)² + ½·(7−4)² = ½·9 + ½·9 = 9, σ_Q = 3. Same expected return, but Q swings three times as much. Plan P is the safer bet (σ_P = 1 vs σ_Q = 3).

🎯 Quick check

Six questions to lock it in. Tap the answer you think is right.

§ For teachers and parents

This lesson introduces the two summary measures of a discrete random variable: the expected value E(X) = Σxipi as a probability-weighted mean and balance point, and the variance D(X) = Σpi(xi − E)² with its root σ as a measure of spread. It addresses CCSS HSS-MD.A.2 and HSS-MD.A.3 (calculate the expected value of a random variable and interpret it as the mean) and HSS-MD.B.5 / B.6 / B.7 (weigh outcomes and use expected values to evaluate fairness and make decisions). The recurring pitfalls to watch are believing E(X) must be an attainable value (a die's E = 3.5) and computing variance without squaring the deviations or without weighting them by the probabilities. Next lesson meets the named distributions — Bernoulli, binomial, hypergeometric — and the continuous normal curve.

eastmath.com · Stage 33 · 33.7 Expectation & Variance · Reasoning, one step at a time