4.14 · AHL · HL onlyPaper 1Paper 2Paper 3

Linear combinations and unbiased estimates

In a minute

Scaling, shifting and adding changes their and spread in predictable ways. For a , always add. For independent XX and YY, Var(aX±bY)=a2Var(X)+b2Var(Y)\mathrm{Var}(aX \pm bY) = a^{2}\mathrm{Var}(X) + b^{2}\mathrm{Var}(Y), even for a difference. From a , xˉ\bar{x} and sn−12s_{n-1}^{2} are of the mean and .

You'll be able to

  • Find the mean and variance of aX+baX + b from those of XX, and say what a change of scale or a fixed amount does to each.
  • Find the expected value of a linear combination of several random variables, such as a total or a difference.
  • Find the variance of a linear combination of independent random variables, and tell a total of nn separate items from nn times one item.
  • Use xˉ\bar{x} as an unbiased estimate of μ\mu and sn−12s_{n-1}^{2} as an unbiased estimate of σ2\sigma^{2}, from raw data, a frequency table or a given sns_{n}.
  • Explain what unbiased means; seeing why E(Xˉ)=μ\mathrm{E}(\bar{X}) = \mu helps understanding but is not examined.
Before you start3 quick questions on what this builds on
Check yourself
A random variable XX takes the values 00, 11 and 22 with probabilities 0.50.5, 0.30.3 and 0.20.2. Find E(X)\mathrm{E}(X).
Check yourself
X∼B(30,0.2)X \sim \mathrm{B}(30, 0.2). Find Var(X)\mathrm{Var}(X).
Check yourself
Find the of the data 3,5,5,73, 5, 5, 7, dividing by nn as in the formula you learned. Give your answer to 3 s.f.

Revise first: 1.2 Arithmetic sequences and series, 4.1 Sampling, data quality and outliers, 4.3 Central tendency and dispersion, 4.6 Probability diagrams, rules and independence, 4.7 Discrete random variables and expected value and 4.8 Binomial distribution

Scaling and shifting one random variable

In 4.7 you found the expected value of a random variable. Often you need a new variable built from it, such as a count turned into money. If you know the mean and spread of XX, you can write down those of aX+baX + b straight away.

In an exam Var(X)\mathrm{Var}(X) is given, or comes from a known distribution, such as np(1−p)np(1 - p) for B(n,p)\mathrm{B}(n, p). You won't work it out from the definition.

Multiplying by aa stretches every distance from the mean by ∣a∣\lvert a\rvert, so every squared distance by a2a^{2}. Adding bb slides every value along together: the mean moves, the spread does not.

In the formula booklet
E(aX+b)=aE(X)+b\mathrm{E}(aX + b) = a\mathrm{E}(X) + b
In the formula booklet
Var(aX+b)=a2 Var(X)\mathrm{Var}(aX + b) = a^{2}\,\mathrm{Var}(X)

Both rules are in the formula booklet, for any constants aa and bb. The square root of the second gives the standard deviation, which is never negative.

Learn this
σaX+b=∣a∣ σX\sigma_{aX + b} = \lvert a\rvert\,\sigma_{X}
Worked exampleThe daily maximum temperature TT °C in a city in July has E(T)=24\mathrm{E}(T) = 24 and standard deviation 3.53.5 °C. In degrees Fahrenheit the temperature is F=1.8T+32F = 1.8T + 32. Find E(F)\mathrm{E}(F) and Var(F)\mathrm{Var}(F).

Try it first, then reveal one step at a time.

  1. Match F=1.8T+32F = 1.8T + 32 to aT+baT + b: a=1.8a = 1.8 and b=32b = 32.
Worked exampleA test has 2020 multiple-choice questions with 44 options each. A student guesses every answer, so the number correct is X∼B(20,0.25)X \sim \mathrm{B}(20, 0.25). Each correct answer scores 44 marks and each wrong answer loses 11 mark. Find the expected score and its standard deviation, and comment on whether the penalty stops guessing from paying off.

Try it first, then reveal one step at a time.

  1. Write the score SS in terms of XX. There are 20−X20 - X wrong answers, so S=4X−(20−X)=5X−20S = 4X - (20 - X) = 5X - 20.
Check yourself
XX has standard deviation 44. Find the standard deviation of Y=3−2XY = 3 - 2X.
Check yourself
A café's daily number of customers CC has mean 140140 and variance 196196. Its daily profit is P=4.5C−300P = 4.5C - 300 dollars. Find the standard deviation of PP, in dollars.
Check yourself
A taxi trip's distance XX km has standard deviation 2.42.4 km. The fare is 1.8X+3.51.8X + 3.5 dollars. The company raises the fixed starting charge from 3.503.50 to 5.005.00 dollars. What happens to the standard deviation of the fare?

Expected value of a linear combination

Averages behave as you would hope: each mean is scaled by its coefficient, and the means add.

In the formula booklet
E(a1X1±a2X2±⋯±anXn)=a1E(X1)±a2E(X2)±⋯±anE(Xn)\mathrm{E}(a_{1}X_{1} \pm a_{2}X_{2} \pm \dots \pm a_{n}X_{n}) = a_{1}\mathrm{E}(X_{1}) \pm a_{2}\mathrm{E}(X_{2}) \pm \dots \pm a_{n}\mathrm{E}(X_{n})

This is in the formula booklet. It holds for any random variables, independent or not. A constant added to the combination is added to its mean, as with aX+baX + b.

Worked exampleFour swimmers each swim one leg of a relay. Their times have means 31.431.4, 30.830.8, 32.132.1 and 29.929.9 seconds. Find the expected total time TT for the relay.

Try it first, then reveal one step at a time.

  1. The total is T=X1+X2+X3+X4T = X_{1} + X_{2} + X_{3} + X_{4}, with every coefficient 11.
Worked exampleAt a market stall, the daily number of jars of honey sold HH has E(H)=35\mathrm{E}(H) = 35, and the daily number of candles sold CC has E(C)=18\mathrm{E}(C) = 18. Each jar makes 66 dollars profit and each candle 99 dollars, and the stall costs 120120 dollars a day. Find the expected daily profit, and comment on the owner's claim that the stall makes about 250250 dollars every day.

Try it first, then reveal one step at a time.

  1. Define the profit: P=6H+9C−120P = 6H + 9C - 120.
Check yourself
E(X)=10\mathrm{E}(X) = 10 and E(Y)=4\mathrm{E}(Y) = 4. Find E(2X−3Y+5)\mathrm{E}(2X - 3Y + 5).
Check yourself
Mia's time MM minutes for a 55 km run has E(M)=26.5\mathrm{E}(M) = 26.5. Jo's time JJ minutes has E(J)=24.8\mathrm{E}(J) = 24.8. Find E(M−J)\mathrm{E}(M - J).

Variance of a linear combination

Spread is different. Each independent variable brings its own uncertainty, so the variances add, even for a difference: the gap between two uncertain times is more uncertain than either time.

Independent means knowing one variable's value tells you nothing about the others, as for . In a question, it is an assumption to state.

In the formula booklet
Var(a1X1±a2X2±⋯±anXn)=a12 Var(X1)+a22 Var(X2)+⋯+an2 Var(Xn)\mathrm{Var}(a_{1}X_{1} \pm a_{2}X_{2} \pm \dots \pm a_{n}X_{n}) = a_{1}^{2}\,\mathrm{Var}(X_{1}) + a_{2}^{2}\,\mathrm{Var}(X_{2}) + \dots + a_{n}^{2}\,\mathrm{Var}(X_{n})

The booklet gives this for independent variables. Add variances, never standard deviations: find the standard deviation last, as a square root.

Worked exampleRavi walks to a bus stop, then rides the bus to school. His walking time WW has mean 1212 minutes and standard deviation 22 minutes. The bus time BB has mean 2525 minutes and standard deviation 33 minutes. WW and BB are independent. Find the mean and the standard deviation of his total journey time T=W+BT = W + B.

Try it first, then reveal one step at a time.

  1. Mean: E(T)=12+25=37\mathrm{E}(T) = 12 + 25 = 37 minutes.
Worked exampleA machine pours CC ml of coffee into a cup that holds KK ml. CC has mean 182182 ml and standard deviation 44 ml. KK has mean 200200 ml and standard deviation 33 ml, independent of CC. Let D=K−CD = K - C be the space left in the cup. Find E(D)\mathrm{E}(D) and Var(D)\mathrm{Var}(D), and interpret them.

Try it first, then reveal one step at a time.

  1. Mean: E(D)=E(K)−E(C)=200−182=18\mathrm{E}(D) = \mathrm{E}(K) - \mathrm{E}(C) = 200 - 182 = 18.

If KK and CC are also normally distributed, then so is DD, and you can find P(D<0)\mathrm{P}(D < 0) on your GDC. That step is in 4.15.

Check yourself
XX and YY are independent, with Var(X)=5\mathrm{Var}(X) = 5 and Var(Y)=7\mathrm{Var}(Y) = 7. Find Var(3X−2Y)\mathrm{Var}(3X - 2Y).
Check yourself
A bakery sells LL loaves and QQ cakes a day, independently, with Var(L)=36\mathrm{Var}(L) = 36 and Var(Q)=16\mathrm{Var}(Q) = 16. Daily takings are R=2.5L+4QR = 2.5L + 4Q dollars. Find the standard deviation of RR. Give your answer to 3 s.f.
Check yourself
A shop finds the variance of the total mass of a pair of shoes by adding the variance of the left shoe's mass to the variance of the right shoe's mass. Why is this doubtful?

A total of n items or n times one item

A box of 1212 eggs holds 1212 different eggs, so its total mass is X1+X2+⋯+X12X_{1} + X_{2} + \dots + X_{12}. That is not 12X12X, one egg's mass multiplied by 1212. Both have the same mean but different variances.

Learn this
E(X1+⋯+Xn)=nμ,Var(X1+⋯+Xn)=nσ2for independent Xi, each with mean μ and variance σ2\mathrm{E}(X_{1} + \dots + X_{n}) = n\mu, \quad \mathrm{Var}(X_{1} + \dots + X_{n}) = n\sigma^{2} \quad \text{for independent } X_{i}, \text{ each with mean } \mu \text{ and variance } \sigma^{2}

Compare Var(nX)=n2σ2\mathrm{Var}(nX) = n^{2}\sigma^{2}. Separate items vary independently, so heavy and light ones partly balance out; one item scaled by nn has nothing to balance it.

Worked exampleThe masses of a supermarket's eggs have mean 6262 g and standard deviation 44 g. A box holds 1212 eggs, chosen independently. Find the standard deviation of the total mass of eggs in a box.

Try it first, then reveal one step at a time.

  1. Let M=X1+X2+⋯+X12M = X_{1} + X_{2} + \dots + X_{12}, with each XiX_{i} an egg's mass.
Worked exampleA courier's route has 55 stops. The time spent at each stop has mean 44 minutes and standard deviation 1.51.5 minutes. The total driving time DD has mean 3838 minutes and standard deviation 66 minutes. All times are independent. Find the mean and standard deviation of the total route time RR.

Try it first, then reveal one step at a time.

  1. Define R=T1+T2+T3+T4+T5+DR = T_{1} + T_{2} + T_{3} + T_{4} + T_{5} + D, where TiT_{i} is the time at stop ii.

The of a random , with independent XiX_{i}, is a linear combination too: Xˉ=1n(X1+⋯+Xn)\bar{X} = \frac{1}{n}(X_{1} + \dots + X_{n}). The rules give E(Xˉ)=1n×nμ=μ\mathrm{E}(\bar{X}) = \frac{1}{n} \times n\mu = \mu and Var(Xˉ)=1n2×nσ2=σ2n\mathrm{Var}(\bar{X}) = \frac{1}{n^{2}} \times n\sigma^{2} = \frac{\sigma^{2}}{n}. You will meet Xˉ\bar{X} again in 4.15.

Check yourself
The mass of a parcel has variance 2.52.5 kg². Find the variance of the total mass of 44 independent parcels.
Check yourself
Song lengths on a playlist have standard deviation 0.60.6 minutes. Find the standard deviation of the total length of 99 songs chosen independently.

Unbiased estimates of the mean and variance

In practice you rarely know a 's mean μ\mu or variance σ2\sigma^{2}. You take a and estimate them. A different sample would give a different estimate.

The sample mean xˉ=∑xin\bar{x} = \frac{\sum x_{i}}{n} is an unbiased estimate of μ\mu. The last section showed why: E(Xˉ)=μ\mathrm{E}(\bar{X}) = \mu. That demonstration helps understanding but is not examined.

In 4.3 you divided by nn; call that sn2s_{n}^{2}. Distances are measured from xˉ\bar{x}, the centre of the same sample, so they come out a little small. On average, sn2s_{n}^{2} underestimates σ2\sigma^{2}.

Dividing by n−1n - 1 instead makes the estimate slightly larger, which exactly removes the bias. Showing that E(sn−12)=σ2\mathrm{E}(s_{n-1}^{2}) = \sigma^{2} is not examined.

In the formula booklet
sn−12=nn−1 sn2s_{n-1}^{2} = \frac{n}{n-1}\,s_{n}^{2}
Learn this
sn−12=∑i=1kfi(xi−xˉ)2n−1,where n=∑i=1kfis_{n-1}^{2} = \frac{\sum_{i=1}^{k} f_{i}(x_{i} - \bar{x})^{2}}{n - 1}, \quad \text{where } n = \sum_{i=1}^{k} f_{i}

The first form is in the booklet: use it when you are given sns_{n}. In the second, the kk distinct values xix_{i} have frequencies fif_{i}; for raw data every fi=1f_{i} = 1.

Your GDC gives both. On the TI-84, Sx is sn−1s_{n-1} and σ\sigmax is sns_{n}. The TI-Nspire shows sx := sn-1x and σx := σnx, and the Casio shows sx and σx. Square Sx for the unbiased estimate of the variance.

Worked exampleA random sample of 4040 households in a town gives the number of cars per household: 00 cars (66 households), 11 car (1515), 22 cars (1212), 33 cars (55) and 44 cars (22). Use your GDC to find unbiased estimates of the mean and the variance of the number of cars per household in the town. Give the variance to 3 s.f.

Try it first, then reveal one step at a time.

  1. Enter the values 0,1,2,3,40, 1, 2, 3, 4 and the frequencies 6,15,12,5,26, 15, 12, 5, 2, and run one-variable statistics with the frequency list.
Worked exampleA biologist measures the wingspans of a random sample of 2525 moths. She reports a standard deviation of 0.450.45 cm, found by dividing by nn. Find an unbiased estimate of the variance of the wingspans of all moths of this species, and comment on the size of the correction.

Try it first, then reveal one step at a time.

  1. The reported value is sn=0.45s_{n} = 0.45, so sn2=0.2025s_{n}^{2} = 0.2025.
Check yourself
A random sample of 1010 values has sn2=7.2s_{n}^{2} = 7.2. Find the unbiased estimate of the population variance.
Check yourself
A random sample of waiting times, in minutes, is 12,15,11,18,1412, 15, 11, 18, 14. Find the unbiased estimate of the population variance, sn−12s_{n-1}^{2}.
Check yourself
sn−12s_{n-1}^{2} is an unbiased estimate of σ2\sigma^{2}. What does this mean?

Common mistakes

  • Adding standard deviations. Independent variables with standard deviations 22 and 33 have a sum with standard deviation 4+9≈3.61\sqrt{4 + 9} \approx 3.61, not 55.
  • Subtracting variances for a difference. For independent XX and YY, Var(X−Y)=Var(X)+Var(Y)\mathrm{Var}(X - Y) = \mathrm{Var}(X) + \mathrm{Var}(Y).
  • Writing nXnX for the total of nn separate independent items. Their total has variance nσ2n\sigma^{2}; nXnX wrongly gives n2σ2n^{2}\sigma^{2}.
  • Forgetting to square the coefficient, or letting the constant change the variance. Var(5X−20)=25 Var(X)\mathrm{Var}(5X - 20) = 25\,\mathrm{Var}(X): the −20-20 drops out.
  • Giving sns_{n} (the GDC's σ\sigmax), or a standard deviation, when an unbiased estimate of the variance is asked for. Square Sx.

Exam tips

  • Find: define the combination first, such as T=T1+⋯+T5+DT = T_{1} + \dots + T_{5} + D, then write the variance line, such as 5×1.52+625 \times 1.5^{2} + 6^{2}. That line earns the method mark even if the arithmetic slips.
  • State an assumption: for the variance of a sum or difference, the assumption is independence, said in context, such as one stop's time not affecting another's.
  • Write down an unbiased estimate of the population variance: give sn−12s_{n-1}^{2}, the square of the GDC's Sx, to 3 s.f. Don't give the standard deviation when the variance is asked for.

Key takeaways

In bookletE(aX+b)=aE(X)+b\mathrm{E}(aX + b) = a\mathrm{E}(X) + b
In bookletVar(aX+b)=a2 Var(X)\mathrm{Var}(aX + b) = a^{2}\,\mathrm{Var}(X)
Learn thisThe standard deviation of aX+baX + b is ∣a∣σ\lvert a\rvert\sigma. Adding a constant moves the mean but not the spread.
In bookletExpected values add for any random variables, independent or not: E(a1X1±⋯±anXn)=a1E(X1)±⋯±anE(Xn)\mathrm{E}(a_{1}X_{1} \pm \dots \pm a_{n}X_{n}) = a_{1}\mathrm{E}(X_{1}) \pm \dots \pm a_{n}\mathrm{E}(X_{n}).
In bookletOnly for independent X1,…,XnX_{1}, \dots, X_{n}: Var(a1X1±⋯±anXn)=a12Var(X1)+⋯+an2Var(Xn)\mathrm{Var}(a_{1}X_{1} \pm \dots \pm a_{n}X_{n}) = a_{1}^{2}\mathrm{Var}(X_{1}) + \dots + a_{n}^{2}\mathrm{Var}(X_{n}). Every term is added, even for a difference. Add variances, never standard deviations.
Learn thisThe total of nn independent items, each with mean μ\mu and variance σ2\sigma^{2}, has mean nμn\mu and variance nσ2n\sigma^{2}. One item scaled by nn, nXnX, has variance n2σ2n^{2}\sigma^{2}.
In bookletFrom a random sample, xˉ\bar{x} is an unbiased estimate of μ\mu and sn−12=nn−1sn2s_{n-1}^{2} = \frac{n}{n-1}s_{n}^{2} is an unbiased estimate of σ2\sigma^{2}. On the GDC, sn−1s_{n-1} is Sx (sx on the Casio and Nspire).

Practise this

13 past-paper questions on Linear combinations of random variables in the AI HL bank, each with a mark scheme and a worked explanation.

Practise Linear combinations of random variables →