James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
IB Diploma › Maths AI HL › Statistics & probability › Combining random variables

Combining random variables

A bag holds six apples, a lift carries ten people, a recipe adds three ingredients. Each amount varies, and the total varies too. This page gives the rules for the mean and variance of scaled, added and subtracted random variables, and shows how sums and means of normal variables stay normal.

AHL 4.14AHL 4.15HL onlyPaper 1Paper 2GDC allowed≈ 50 min to work through
Before you start: discrete random variables and expectation (Discrete random variables) and the normal distribution (Normal distribution).

1What you need to know

Tick these off as you go. By the end of the page you should be able to do all of them without notes.

  • Use E(aX+b)=aE(X)+b and Var(aX+b)=a2Var(X)AHL 4.14
  • Find the expected value of a linear combination of random variablesAHL 4.14
  • Find the variance of a linear combination of independent random variablesAHL 4.14
  • Tell the difference between X1+X2 and 2XAHL 4.14
  • Find unbiased estimates of μ and σ2 from a sampleAHL 4.14
  • Use the fact that linear combinations of independent normal variables are normal, including X¯~N(μ,σ2n)AHL 4.15

2Notes & worked examples

Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.

The big idea

Means behave exactly as you would expect: the mean of a total is the total of the means. Variances are different. Scaling by a multiplies the variance by a2, and when independent quantities are added or subtracted, their variances add: more things that vary means more variation, whichever way round you combine them.

2.1 Linear transformation of one variable

One random variable In formula booklet
E(aX+b)=aE(X)+bVar(aX+b)=a2Var(X)

Adding b shifts every value, so it changes the mean but not the spread. The standard deviation is multiplied by |a|.

Worked example 1Paper 1
E(X)=5 and Var(X)=4. Find the mean, variance and standard deviation of Y=3X−2.
E(Y)=3(5)−2=13
Var(Y)=32(4)=36
SD(Y)=6
Worked example 2Paper 1
Daily temperatures in °C have mean 20 and standard deviation 3. Find the mean and standard deviation in °F, using F=1.8C+32.
Mean =1.8(20)+32=68 °F
SD =1.8×3=5.4 °F
The +32 does not affect the spread.

2.2 Linear combinations of several variables

Several random variables In formula booklet
E(a1X1±a2X2±⋯)=a1E(X1)±a2E(X2)±⋯Var(a1X1±a2X2±⋯)=a12Var(X1)+a22Var(X2)+⋯

The variance rule needs the variables to be independent. Note the plus signs: Var(X−Y)=Var(X)+Var(Y).

Be careful to tell apart two separate observations and one observation doubled. If X1 and X2 are two independent apples, Var(X1+X2)=2Var(X). If one apple is counted twice, Var(2X)=4Var(X): doubling one value doubles its error too, while two separate errors partly cancel.

Worked example 3 (faded)Paper 1
X and Y are independent with Var(X)=9 and Var(Y)=16. Find the standard deviation of X−Y.
Var(X−Y)=9+16=25, so SD = 5  ← you work this out

2.3 Combinations of normal variables

Any linear combination of independent normal random variables is itself normal. So once you have the mean and variance from 3.2, you can find probabilities with the normal distribution on the GDC.

Worked example 4Paper 2
Apple masses are N(150,122) grams. Six apples are packed in a bag of mass 40 g. Find the probability that a full bag weighs more than 980 g.
T=X1+⋯+X6+40
Six different apples, not 6X.
E(T)=6(150)+40=940; Var(T)=6(144)=864
T~N(940,864), SD=29.4
P(T>980)=0.0868
Worked example 5Paper 2
Men’s heights are N(178,72) cm and women’s are N(165,62) cm. A man and a woman are chosen at random. Find the probability that the woman is taller.
Let D=M−W: E(D)=13, Var(D)=49+36=85
The woman is taller when D<0
P(D<0)=0.0793

In particular, the mean X¯ of a random sample of size n from N(μ,σ2) is normal: X¯~N(μ,σ2n). Bigger samples give means that are more tightly grouped around μ.

Worked example 6Paper 1
For the apples, find the probability that the mean mass of 9 apples is more than 152 g.
X¯~N(150,1449)=N(150,42)
P(X¯>152)=0.309

2.4 Unbiased estimates

We rarely know μ and σ2. From a sample, x¯=∑xin is an unbiased estimate of μ: on average it is right. For the variance, dividing by n tends to underestimate, so we use sn−12=nn−1sn2=∑fi(xi−x¯)2n−1. The GDC gives sn−1 as sx; square it for the variance estimate.

Worked example 7Paper 1
A sample of 8 lengths (cm) is 4.2, 5.1, 3.8, 4.6, 5.0, 4.4, 3.9, 4.8. Find unbiased estimates of the population mean and variance.
x¯=4.475
sn−1=0.48624…, so sn−12=0.236
sx on the GDC, then square it.
Compare sn2=0.207: the unbiased estimate is a little bigger.
On your TI-Nspire Calculator tricks →

On the TI-Nspire, menu → Statistics → Stat Calculations → One-Variable Statistics gives x¯, sx (=sn−1) and σx (=sn). Square sx for an unbiased estimate of the variance. For normal probabilities use normCdf(lower, upper, μ, σ), entering the standard deviation Var, not the variance.

3Explore it

X ~ N(10, 2²). The navy curve is the sum of n independent copies, X₁ + … + Xₙ. The red dashed curve is n times one copy, nX. Both have mean 10n, but the variances are nσ² and n²σ².

4Common mistakes & exam tips

Common mistakes

  • Writing Var(X−Y)=Var(X)−Var(Y). Variances always add for independent variables.
  • Using 6X (variance 36σ2) for the total of six different items, instead of X1+⋯+X6 (variance 6σ2).
  • Forgetting to square a: Var(3X)=9Var(X).
  • Entering the variance instead of the standard deviation into normCdf.
  • Quoting sn (σx) as the unbiased estimate of σ.

Exam tips

  • Define the new variable in words or symbols first, for example T=X1+…+X6+40.
  • For "which is bigger" questions, use a difference: P(W>M)=P(M−W<0).
  • "Unbiased estimate of the variance" needs sn−12, not sn−1.
  • State the independence assumption when you add variances.

5Practice

Fluency questions build the basics. Problem-solving questions make you think about which method to use.

FluencyP1
E(X)=8, Var(X)=2. Find E(5−2X) and Var(5−2X).
−11 and 8
FluencyP2
X~N(30,4) and Y~N(20,5) are independent. Find the distribution of X+2Y.
N(70, 4+4(5))=N(70,24)
FluencyP3
Find Var(X1+X2+X3) and Var(3X) when Var(X)=5.
15 and 45
FluencyP4
A sample of 10 values has sn2=4.5. Find the unbiased estimate of the population variance.
109×4.5=5
Problem solvingP5
Bolts have lengths N(5.0,0.022) cm and fit into holes of depth N(5.05,0.032) cm. Find the probability that a randomly chosen bolt is longer than a randomly chosen hole is deep.
D=H−B~N(0.05,0.0013); P(D<0)=0.0828
Problem solvingP6
How many observations are needed for the mean of a sample from N(μ,100) to have standard deviation at most 2?
10n≤2⇒n≥25

6Exam-style questions

Original questions in the style of the IB Maths AI HL exam, with full markschemes. Your GDC is allowed throughout: use it, but write down what you entered and what it gave you. Give yourself about 1 minute per mark.

Question 1Paper 1[6 marks]

The random variable X has E(X)=12 and Var(X)=9. X1, X2 and X3 are independent observations of X.

  • (a)Find E(4−2X) and Var(4−2X).[2]
  • (b)Find E(X1−X2) and Var(X1−X2).[2]
  • (c)Find Var(X1+X2+X3) and Var(3X), and explain why they are different.[2]
(a)
−20A1
36A1
(b)
0A1
18A1
(c)
27 and 81A1
three independent values partly cancel out; 3X triples a single value, so its variation is tripled tooR1
Question 2Paper 1[5 marks]

A random sample of 12 bags of rice is weighed. The masses, x grams, give ∑x=594 and ∑x2=29610.

  • (a)Find an unbiased estimate of the population mean.[1]
  • (b)Find an unbiased estimate of the population variance.[3]
  • (c)State what is meant by an unbiased estimate.[1]
(a)
49.5 gA1
(b)
sn2=2961012−49.52=17.25(M1)(A1)
sn−12=1211×17.25=18.8A1
(c)
its expected value equals the population parameter (on average it gives the true value)R1
Question 3Paper 2[10 marks]

The masses of adults using a lift are normally distributed with mean 78 kg and standard deviation 12 kg. The lift has a safety limit of 800 kg.

  • (a)Ten adults enter the lift. Find the probability that their total mass exceeds the limit.[3]
  • (b)Nine adults enter the lift with luggage whose mass is normally distributed with mean 60 kg and standard deviation 5 kg. Find the probability that the total mass exceeds the limit.[3]
  • (c)Find the probability that the mean mass of the ten adults in part (a) is more than 85 kg.[2]
  • (d)Two adults are chosen at random. Find the probability that their masses differ by more than 20 kg.[2]
(a)
T~N(780, 1440)(M1)(A1)
0.299A1
(b)
mean 762, variance 9(144)+25=1321(M1)(A1)
0.148A1
(c)
X¯~N(78,14410)(M1)
0.0325A1
(d)
D=X1−X2~N(0,288), P(|D|>20)(M1)
0.239A1

7Check yourself

Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.

8Past-paper practice

Once you are scoring well above, try these real IB Maths AI HL questions on this topic. Your school or teacher will have the papers.

PaperQuestionFocusDifficulty
May 2022 · TZ2 · Paper 1Q12Weights of male and female cuttlefish: normal distributions and errors★★☆
May 2025 · TZ2 · Paper 1Q6Unbiased estimate of a variance, then a confidence interval★☆☆
May 2021 · TZ2 · Paper 1Q10Unbiased estimates from ∑x and ∑x2★★☆
May 2023 · TZ2 · Paper 1Q15Unbiased estimates of the mean from a sample of coffee packets★★☆
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake