IB Maths AI HLRandom VariablesPaper 1 & 2~7 min read
Linear Combinations of Random Variables
When you scale a random variable (multiply by a constant) or combine two of them (add or subtract), the mean and variance follow simple rules. The mean behaves intuitively. The variance is the trap: constants get squared, addition/subtraction of a constant leaves it unchanged, and when you combine independent variables you always add the variances — even when subtracting. Get those three facts right and this topic is free marks.
📘 What you need to know
Single variable: E(aX ± b) = aE(X) ± b and Var(aX ± b) = a2Var(X).
The mean is affected by both multiplication and addition; the variance only by multiplication (the constant b shifts data but doesn’t spread it).
Two variables: E(aX ± bY) = aE(X) ± bE(Y) — true for anyX, Y.
Var(aX ± bY) = a2Var(X) + b2Var(Y) — note the + even when subtracting, and only if X, Y are independent.
2X ≠ X1 + X2: same mean, but Var(2X) = 4Var(X) while Var(X1 + X2) = 2Var(X).
All of these formulae are in the booklet — your job is choosing the right one.
Transforming a single variable
If you multiply X by a constant and add another, both the mean and variance respond — but differently. Multiplying stretches the data (changes spread), while adding a constant just slides everything along (no change in spread).
Single variable transformation
E(aX ± b) = aE(X) ± b Var(aX ± b) = a2Var(X)
in the formula booklet ✓
The mean E(X)
× and ±
Affected by both: multiply by a, then add/subtract b.
The variance Var(X)
× only
Multiply by a2. Adding b does nothing — it shifts, not spreads.
🤔 Why does +b vanish from the variance?
Variance measures spread. Adding the same constant to every value slides the whole distribution sideways but keeps every point the same distance apart — so the spread is identical. Multiplying by a stretches every gap by a, and since variance is built from squared distances, it scales by a2.
🧠 Memory aid — “divide is just multiply”
If you see Xa, rewrite it as 1aX first. So Var(Xa) = 1a2Var(X) — the constant still gets squared.
WE 1
Transform a single variable
X is a random variable with E(X) = 5 and Var(X) = 4. Find E(3X + 5), Var(3X + 5) and Var(2 − X).
E(3X + 5) = 3E(X) + 5= 3(5) + 5 = 20Var(3X + 5) = 3²Var(X)= 9(4) = 36Var(2 − X) = (−1)²Var(X)= 1(4) = 420, 36, 4in 2 − X the coefficient of X is −1, and (−1)² = 1, so the +2 has no effect.
Combining two variables
For two random variables X and Y with constants a and b, the mean rule always holds. The variance rule needs the variables to be independent — and the right-hand side is always a sum.
Combining two variables
E(aX ± bY) = aE(X) ± bE(Y)
Var(aX ± bY) = a2Var(X) + b2Var(Y)
in the formula booklet ✓ (variance needs independence)
The “always add” rule: Var(aX − bY) = a2Var(X) + b2Var(Y) — exactly the same as for +. Because b2 is positive even when b is negative, the variances of aX + bY and aX − bY are identical.
Mean vs Variance under combination
The minus survives in the mean but disappears in the variance.
WE 2
Mean and variance of a combination
X and Y are independent with E(X) = 5, Var(X) = 3, E(Y) = −2, Var(Y) = 4. Find E(2X + 5Y), Var(2X + 5Y) and Var(4X − Y).
E(2X + 5Y) = 2E(X) + 5E(Y)= 2(5) + 5(−2) = 10 − 10 = 0Var(2X + 5Y) = 2²Var(X) + 5²Var(Y)= 4(3) + 25(4) = 12 + 100 = 112Var(4X − Y) = 4²Var(X) + (−1)²Var(Y)= 16(3) + 1(4) = 48 + 4 = 520, 112, 52in the last one the minus becomes a plus once the constant is squared.
Many variables & the 2X trap
The two-variable rules extend to any number of variables. For constants a1, …, an and variables X1, …, Xn:
Linear combination of n variables
E(∑aiXi) = ∑aiE(Xi) Var(∑aiXi) = ∑ai2Var(Xi)
in the formula booklet ✓ (variance needs independence)
🤔 Why is 2X different from X1 + X2?
2X means take one observation and double it. X1 + X2 means take two separate observations and add them. If X can be 0 or 1, then 2X gives only 0 or 2, but X1 + X2 can give 0, 1 or 2 — that extra middle value is why the spreads differ.
Scaled: 2X
4 Var(X)
One observation, doubled. Var(2X) = 2²Var(X) = 4Var(X). Same mean: 2E(X).
Summed: X₁ + X₂
2 Var(X)
Two independent observations. Var = Var(X) + Var(X) = 2Var(X). Same mean: 2E(X).
🧠 Decision check — which case am I in?
Ask: am I adding different observations of the same variable (X1 + X2 + … + Xn), or scaling a single observation by a constant (nX)? A carton of 6 eggs is C + E1 + … + E6 (six different eggs), notC + 6E — because the eggs have different masses.
WE 3
2X versus X₁ + X₂
For a random variable X with E(X) = 5 and Var(X) = 3, compare 2X with X1 + X2 (independent observations).
Means (the same)E(2X) = 2(5) = 10E(X₁ + X₂) = 5 + 5 = 10Variances (different!)Var(2X) = 2²(3) = 12Var(X₁ + X₂) = 3 + 3 = 6means equal, variances 12 vs 6doubling one value spreads more than adding two independent values.
WE 4
Modelling a carton of eggs
A carton’s mass is M = C + E1 + E2 + … + E6, where the carton mass C has E = 20, Var = 4, and each egg E (independent) has E = 58, Var = 9. Find E(M) and Var(M).
Independent A and B have E(A) = 12, Var(A) = 5, E(B) = 7, Var(B) = 3. Find E(A − B) and Var(A − B).
E(A − B) = E(A) − E(B)= 12 − 7 = 5Var(A − B) = Var(A) + Var(B)= 5 + 3 = 8E = 5, Var = 8the mean subtracts, but the variance ADDS — the classic difference trap.
💡 Top tips
Square the constant for every variance: Var(aX) = a2Var(X).
Drop the +b from any variance — adding a constant never changes spread.
Variance always adds when combining independent variables, even for aX − bY.
Check independence before using the variance rule — the mean rule doesn’t need it, the variance rule does.
Rewrite division: Xa = 1aX, then square the 1a.
Read “n of them” carefully: nX (one value scaled) vs X1 + … + Xn (n separate values).
⚠ Common mistakes
Not squaring the constant in the variance — writing aVar(X) instead of a2Var(X).
Subtracting variances for aX − bY. You always add them.
Keeping +b in the variance of aX + b.
Confusing nX with X1 + … + Xn — they share a mean but not a variance.
Using the variance rule without independence — it only holds for independent variables.
Writing 6²Var(E) for six different eggs — that’s the scaling case, not the sum.
Next up — Unbiased Estimates. You’ll use these exact linear-combination rules to prove why the sample mean x̄ hits the population mean on average, and why the sample variance needs that nn − 1 correction to become unbiased.
Need help with Random Variables?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.