MathematicsCore20 min read

Linear Combinations of Random Variables

What happens to the mean and the variance when variables are scaled and added

This topic appears in:

01

Scaling and shifting a single variable

Suppose every value of X is doubled and then 5 is added. What happens to the mean and to the spread? The mean follows along exactly as you would expect. The spread does not.

Adding a constant slides the whole distribution sideways without changing its shape, so the variance is untouched. Multiplying stretches it, and because variance is built from squared distances, it is multiplied by the square of the scale factor. The is the single most important detail in this topic.

E(aX + b) = a·E(X) + bVar(aX + b) = a²·Var(X)note: the b vanishes from the varianceand the a is squaredshifting does not change spread; scaling changes it by the square
a
the scale factorsquared in the variance, and never negative once squared
b
the shiftaffects the mean only, never the variance
Var
the variancebuilt from squared deviations, hence the a²

Var(3X) is 9Var(X), not 3Var(X)

And Var(X − 4) is just Var(X), unchanged. If you find yourself subtracting a constant from a variance, something has gone wrong. A useful check: variance can never come out negative, and a negative scale factor squares to a positive one — Var(−2X) = 4Var(X).

02

Combining independent variables

Means always add, whether or not the variables are independent. Variances add too, but only when the variables are independent, and the result that surprises everyone is that they add even when the variables are subtracted.

The reason is worth understanding rather than memorising. Subtracting makes the difference more variable, not less: if X is high and Y is low, X − Y is unusually large; if the reverse, it is unusually small. Both sources of variability contribute, so the uncertainties accumulate whichever way the variables are combined.

E(aX + bY) = a·E(X) + b·E(Y)for INDEPENDENT X and Y:Var(aX + bY) = a²·Var(X) + b²·Var(Y)Var(X − Y)= Var(X) + Var(Y)← still a plusfor normal variables, any linear combinationis itself normally distributedvariances always add for independent variables, never subtract
independent
the essential conditionwithout it the variance rule fails
a², b²
squared coefficientsso a minus sign disappears
normal
closed under linear combinationwhich is what makes these questions solvable
Worked example

X ~ N(50, 16) and Y ~ N(30, 9) are independent. Find the distribution of X − Y, and hence P(X − Y > 25).

  1. E(X − Y) = 50 − 30 = 20.Means subtract when the variables are subtracted.
  2. Var(X − Y) = Var(X) + Var(Y) = 16 + 9 = 25.Variances ADD despite the subtraction. Writing 16 − 9 = 7 here is the standard error.
  3. So X − Y ~ N(20, 25), with standard deviation 5.A linear combination of independent normals is normal, which is what allows the next step.
  4. z = (25 − 20)/5 = 1.Standardising the value of interest using the new mean and standard deviation.
  5. P(X − Y > 25) = 1 − Φ(1) = 1 − 0.8413 = 0.1587.Upper tail, so subtract from 1.

X − Y ~ N(20, 25); P = 0.159

03

n copies is not the same as n times one

This is the distinction that separates a correct answer from a confident wrong one. 2X means take one observation and double it. X₁ + X₂ means take two separate observations and add them. Their means are the same; their variances are not.

Doubling one observation doubles the deviation from the mean, so the variance quadruples. Adding two independent observations lets their deviations partly cancel — one may be above average while the other is below — so the variance only doubles.

The wording decides which applies. "Twice the mass of one item" is 2X. "The total mass of two items" is X₁ + X₂.

ExpressionMeanVarianceIn words
2X4σ²one observation, doubled
X₁ + X₂2σ²two separate observations, added
X₁ + … + Xₙnσ²the total of n observations
X̄ = (ΣX)/nμσ²/nthe mean of n observations

Why the sample mean is more reliable

The last row of that table is the foundation of all statistical inference. The mean of n observations has variance σ²/n, so its standard deviation is σ/√n — it shrinks as the sample grows. That is the precise sense in which a larger sample gives a more reliable estimate, and it is why quadrupling the sample size only halves the uncertainty.

The rules on one page

  1. E(aX + b) = aE(X) + b — means behave exactly as expected.
  2. Var(aX + b) = a²Var(X) — the shift drops out, the scale factor squares.
  3. Var(X ± Y) = Var(X) + Var(Y) for independent variables — always a plus.
  4. 2X has variance 4σ²; X₁ + X₂ has variance 2σ².
  5. Any linear combination of independent normal variables is itself normal.
  6. Independence is required for every variance rule here, and questions expect you to say so.
04

Working through a worded combination

The difficulty in these questions is almost never the algebra — it is deciding which variable the words describe before any formula is applied.

Read for two things. First, is this one observation scaled or several observations added? "Three times the weight of one box" is 3X; "the weight of three boxes" is X₁ + X₂ + X₃, and their variances differ by a factor of three. Second, is a constant being added, which leaves the variance untouched entirely?

The wordsThe variableVariance
"twice the length of a rod"2X4σ²
"the total length of two rods"X₁ + X₂2σ²
"a rod plus a 5 cm cap"X + 5σ² unchanged
"the difference in length of two rods"X₁ − X₂2σ² — still added
"the mean length of ten rods"σ²/10

A packing question is the classic trap

A box containing six items, where the box itself also has weight, is X₁ + … + X₆ + B — six separate observations plus one more variable, not 6X + B. The two have the same mean and very different variances, and questions are written specifically to see whether the distinction has been understood.

Practice questions

5 questions · 16 marks · full working on every one

Try each one on paper first, then open the working. The marks are shown where they are actually awarded, because that is where they are actually lost.

Short questions

3 · 6 marks

Two marks each, in the style of the short-question section of the paper. Answer in two or three lines.

SQ1[2 marks]
X has mean 12 and variance 5. Find the mean and variance of 3X − 4.
Model answer

Mean: E(3X − 4) = 3(12) − 4 = 32. Variance: Var(3X − 4) = 3² × 5 = 45 — the −4 has no effect on the variance, and the 3 is squared.

Examiner tip. One mark each. The variance mark is lost by anyone who writes 3 × 5 or subtracts the 4.

SQ2[2 marks]
X and Y are independent with Var(X) = 10 and Var(Y) = 6. Explain why Var(X − Y) is 16 rather than 4.
Model answer

Variances of independent variables add regardless of whether the variables are added or subtracted, so Var(X − Y) = 10 + 6 = 16. Subtracting makes the difference more variable, not less: an unusually large X combined with an unusually small Y produces an extreme difference, so both variabilities contribute.

Examiner tip. One mark for the value, one for a genuine explanation rather than a restatement of the rule.

SQ3[2 marks]
State the condition required for Var(X + Y) = Var(X) + Var(Y), and explain what would change without it.
Model answer

X and Y must be independent. Without independence the variables move together to some degree, and a covariance term would have to be added, so the simple sum would no longer be correct.

Examiner tip. Naming independence gets the first mark; explaining that the rule fails rather than merely "you cannot use it" gets the second.

Solved numericals

1 · 4 marks

Full working, one step per line, with the marks shown where they are awarded.

N1[4 marks]
The masses of apples are N(120, 25) and the masses of oranges are N(150, 36), independently. Find the probability that a randomly chosen orange is more than 40 g heavier than a randomly chosen apple.
Full working
  1. Let D = Y − X. E(D) = 150 − 120 = 30Defining the difference variable explicitly.[1]
  2. Var(D) = 36 + 25 = 61, so σ = 7.81Variances add despite the subtraction.[1]
  3. z = (40 − 30)/7.81 = 1.281Standardising with the new parameters.[1]
  4. P(D > 40) = 1 − Φ(1.281) = 1 − 0.8999 = 0.100Upper tail.[1]

0.100

Exam questions

1 · 6 marks

Multi-part questions with a full mark scheme.

Q1[6 marks]
The mass of a single bag of flour is normally distributed with mean 1.02 kg and standard deviation 0.04 kg.
(a) Find the probability that a single bag weighs less than 1 kg.
(b) Find the distribution of the total mass of 4 bags, and the probability it exceeds 4.15 kg.
(c) Explain why the variance of the total of 4 bags is not the same as the variance of 4 times one bag.
Mark scheme
  1. (a) z = (1 − 1.02)/0.04 = −0.5, so P = 1 − Φ(0.5) = 0.309A negative z handled by symmetry.[1]
  2. (b) T = X₁ + X₂ + X₃ + X₄, so E(T) = 4 × 1.02 = 4.08Means add across the four bags.[1]
  3. Var(T) = 4 × 0.04² = 4 × 0.0016 = 0.0064, so σ = 0.08Four independent observations, so the variance multiplies by 4 and the standard deviation by 2.[1]
  4. T ~ N(4.08, 0.0064); z = (4.15 − 4.08)/0.08 = 0.875Standardising the total.[1]
  5. P(T > 4.15) = 1 − Φ(0.875) = 0.191Upper tail.[1]
  6. (c) 4X doubles a single deviation, giving variance 16σ² = 0.0256. The total of four separate bags allows deviations to cancel, giving only 4σ² = 0.0064.The mark is for the cancellation argument, not just the two numbers.[1]

(a) 0.309; (b) N(4.08, 0.0064), P = 0.191; (c) 16σ² versus 4σ²