Skip to content
IB Diploma ProgrammeSL & HL

Linear combinations of variables

Mathematics: Applications and Interpretation SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Linear combinations of variables notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Linear combinations of variables notes as text: skim, search, and jump between subtopics.

~13 min read

1. Linear transformation of a single random variable

A linear transformation of a random variable X is aX + b, where a and b are constants. Multiplying by a stretches every value. Adding b moves every value by the same amount.

The expected value moves and stretches with the variable: E(aX +b) = aE(X) + b. The variance is a measure of spread, so adding b changes nothing and multiplying by a multiplies the variance by a².

Var(X) is the variance of X. The standard deviation is its square root, so it is multiplied by |a|. It is never negative.

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

Var(aX + b) = a² Var(X)

SD(aX + b) = |a| SD(X)

Worked example 14 marks

The random variable X has E(X) = 12 and Var(X) = 5. The random variable Y is given by Y = 4 - 3X.

(a) Calculate E(Y).

(b) Calculate Var(Y).

  1. 1

    (a) M1: E(Y) = 4 - 3 E(X) = 4 - 3 × 12 [1]

  2. 2

    A1: E(Y) = -32 [1]

  3. 3

    (b) M1: Var(Y) = (-3)² × Var(X) = 9 × 5, because the constant 4 does not change the spread [1]

  4. 4

    A1: Var(Y) = 45 [1]

2. Expected value of linear combinations

A linear combination of random variables X₁, X₂, …, Xn is a₁X₁ + a₂X₂ + ⋯ + anXn, where the a_i are constants.

The expected value of a linear combination is the same combination of the expected values. Each variable keeps its own coefficient, including its sign.

This rule needs no condition on the variables. They do not have to be independent.

E(a₁X₁ + a₂X₂ + ⋯ + anXn) = a₁E(X₁) + a₂E(X₂) + ⋯ + anE(Xn)

Worked example 13 marks

A café sells X cups of coffee and Y cups of tea each day, with E(X) = 85 and E(Y) = 40. The daily profit, in euros, is P = 1.2X + 0.9Y.

(a) Calculate E(P).

(b) State whether X and Y must be independent for your answer to be valid.

  1. 1

    (a) M1: E(P) = 1.2 E(X) + 0.9 E(Y) = 1.2 × 85 + 0.9 × 40 [1]

  2. 2

    A1: 102 + 36 = 138 euros [1]

  3. 3

    (b) R1: no, the expected value of a linear combination holds whether or not the variables are independent [1]

3. Variance of linear combinations of independent variables

For independent random variables, the variance of a linear combination adds the variances. Each coefficient is squared.

A minus sign in the combination disappears when it is squared. So Var(X - Y) = Var(X) + Var(Y). Subtracting a variable makes the result more spread out, never less.

This rule does need independence. Take the square root of the variance to get a standard deviation. Never add standard deviations.

Var(a₁X₁ + ⋯ + anXn) = a₁²Var(X₁) + ⋯ + an²Var(Xn)

Var(X - Y) = Var(X) + Var(Y)

Worked example 13 marks

The independent random variables X and Y have Var(X) = 4 and Var(Y) = 9. The random variable W is given by W = 2X - 3Y.

(a) Calculate Var(W).

(b) Hence find the standard deviation of W, correct to three significant figures.

  1. 1

    (a) M1: Var(W) = 2² Var(X) + (-3)² Var(Y) = 4 × 4 + 9 × 9 [1]

  2. 2

    A1: Var(W) = 16 + 81 = 97 [1]

  3. 3

    (b) A1: SD(W) = √97 = 9.85 [1]

4. Sums and means of independent observations

Let X₁, X₂, …, Xn be n independent observations of the same variable X, with mean μ and variance σ². Each has coefficient 1, so the sum has mean nμ and variance nσ².

The mean of the observations barX = 1/n(X₁ + ⋯ + Xn) has every coefficient 1/n. So its mean is μ and its variance is σ² / n.

Do not mix up the sum X₁ + X₂ with 2X. 2X is one observation doubled. X₁ + X₂ is two independent observations, whose variations partly cancel. So Var(2X) = 4σ² but Var(X₁ + X₂) = 2σ².

E(X₁ + ⋯ + Xn) = nμ, Var(X₁ + ⋯ + Xn) = nσ²

E(barX) = μ, Var(barX) = σ²/n

Var(nX) = n²σ²

Worked example 14 marks

The mass of a bag of flour has mean 2.5 kg and standard deviation 0.1 kg. Four bags are chosen independently and weighed together.

(a) Find the mean and the standard deviation of the total mass.

(b) A shop weighs one bag and multiplies its mass by 4 to estimate the total. Find the standard deviation of this estimate.

  1. 1

    (a) A1: E(total) = 4 × 2.5 = 10 kg [1]

  2. 2

    M1: Var(total) = 4 × 0.1² = 0.04, adding the variances of four independent bags [1]

  3. 3

    A1: SD(total) = √(0.04) = 0.2 kg [1]

  4. 4

    (b) A1: SD(4X) = 4 × 0.1 = 0.4 kg, twice as spread out as the sum of four bags [1]

5. The sample mean as an unbiased estimate of μ

A sample of n values gives an estimate of a population parameter. An estimator is unbiased when its expected value equals the parameter. It is right on average, though one sample may be above or below.

The sample mean barx is an unbiased estimate of the population mean μ. This follows from the expected value rule, since E(barX) = μ.

Use the sample mean as the estimate. Do not divide by anything other than n.

barx = (sum_i=1ⁿ x_i)/n

E(barX) = μ

Worked example 13 marks

A sample of six observations from a population is 12, 15, 11, 14, 13, 17.

(a) Calculate an unbiased estimate of the population mean, correct to three significant figures.

(b) State what is meant by an unbiased estimate.

  1. 1

    (a) M1: sum x_i = 12 + 15 + 11 + 14 + 13 + 17 = 82 and n = 6 [1]

  2. 2

    A1: barx = 82/6 = 13.7 [1]

  3. 3

    (b) R1: an estimate whose expected value equals the population parameter, here E(barX) = μ [1]

6. The unbiased estimate of the population variance

The unbiased estimate of the population variance σ² is sn₋₁². It sums the squared distances from barx and divides by n - 1, not by n.

Dividing by n gives sn², which is too small on average. The two are linked by sn₋₁² = n/(n-1) sn². So multiply by n/(n-1) to correct a value that was found with n.

For data in a frequency table, n = sum f_i, the total frequency. The square root of sn₋₁² is the estimate of the standard deviation.

sn₋₁² = (sum_i=1^(k) f_i (x_i - barx)²)/(n - 1), n = sum_i=1^(k) f_i

sn₋₁² = n/(n-1) sn²

Worked example 14 marks

The table gives a sample of 10 observations of x.

Calculate an unbiased estimate of the population variance, correct to three significant figures.

x1234
frequency f2341
  1. 1

    M1: n = 10 and barx = (2 + 6 + 12 + 4)/10 = 2.4 [1]

  2. 2

    M1: sum f(x - barx)² = 2(1.96) + 3(0.16) + 4(0.36) + 1(2.56) = 8.4 [1]

  3. 3

    M1: divide by n - 1 = 9, not by 10: sn₋₁² = 8.4/9 [1]

  4. 4

    A1: sn₋₁² = 0.933. Check: 10/9 × 0.84 = 0.933 [1]

Recap

  • E(aX + b) = aE(X) + b and Var(aX + b) = a²Var(X). The standard deviation is multiplied by |a|.
  • E(a₁X₁ + ⋯ + anXn) = a₁E(X₁) + ⋯ + anE(Xn), with or without independence.
  • For independent variables, Var(a₁X₁ + ⋯ + anXn) = a₁²Var(X₁) + ⋯ + an²Var(Xn). Variances add, even for a difference.
  • n independent observations of X: the sum has mean nμ and variance nσ². The mean barX has mean μ and variance σ²/n.
  • barx = sum x_i / n is an unbiased estimate of μ: its expected value is μ.
  • sn₋₁² = sum f_i(x_i - barx)²/(n-1) = n/(n-1)sn² is an unbiased estimate of σ².

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. The random variable X has Var(X) = 7. State the value of Var(X + 10).1 mark
    Answer
    1. Var(X + 10) = 7.

    Trap: Adding the constant 10 to the variance. A constant shifts the values and leaves the spread unchanged.

  2. The random variable X has E(X) = 4 and Var(X) = 3. The random variable Y is given by Y = 2X - 5. What is Var(Y)? A. 1 · B. 6 · C. 7 · D. 121 mark
    Answer
    1. The answer is D. Var(Y) = 2² × 3 = 12.
    2. A is 2 × 3 - 5, which uses the rule for the expected value. B is 2 × 3, which forgets to square. C is 2² × 3 - 5, which subtracts the constant.

    Trap: Treating the variance like the expected value, or squaring a and then also applying b.

  3. The random variable X has mean -3 and standard deviation 1.5. The random variable Y is given by Y = 5 - 2X. Calculate the mean and the standard deviation of Y.3 marks
    Answer
    1. E(Y) = 5 - 2(-3) = 11 [1].
    2. Var(Y) = (-2)² × 1.5² = 9 [1].
    3. SD(Y) = √9 = 3 [1].

    Trap: Giving the standard deviation as -2 × 1.5 = -3. A standard deviation is never negative.

  4. The independent random variables X and Y have Var(X) = 6 and Var(Y) = 2. Calculate (a) Var(X - Y) and (b) Var(3X + Y).4 marks
    Answer
    1. (a)
    2. Var(X - Y) = 1² × 6 + (-1)² × 2 [1].
    3. = 8 [1].
    4. (b)
    5. Var(3X + Y) = 3² × 6 + 1² × 2 [1].
    6. = 54 + 2 = 56 [1].

    Trap: Subtracting the variances in part (a) to get 6 - 2 = 4. Variances add whatever the sign.

  5. A sample of n = 8 values has mean 15 and standard deviation sn = 2.4, found by dividing the sum of squares by n. Calculate an unbiased estimate of the population variance, correct to three significant figures.3 marks
    Answer
    1. sn² = 2.4² = 5.76 [1].
    2. sn₋₁² = n/(n-1) sn² = 8/7 × 5.76 [1].
    3. = 6.58 [1].

    Trap: Giving 2.4² = 5.76 as the answer. It divides by n and so underestimates the population variance.

  6. A sample of five observations is 8, 10, 11, 7, 9. Calculate an unbiased estimate of (a) the population mean and (b) the population variance.4 marks
    Answer
    1. (a)
    2. barx = (8 + 10 + 11 + 7 + 9)/5 = 45/5 = 9 [1].
    3. (b)
    4. sum (x - barx)² = 1 + 1 + 4 + 4 + 0 = 10 [1].
    5. sn₋₁² = 10/(5 - 1) [1].
    6. = 2.5 [1].

    Trap: Dividing by n = 5 to get 2. That is sn², not the unbiased estimate.

  7. The random variable X has mean 20 and variance 9. The random variable S is the sum of four independent observations of X. (a) Calculate Var(4X). (b) Calculate E(S) and Var(S). (c) Explain why Var(S) is smaller than Var(4X) although the means are equal.4 marks
    Answer
    1. (a)
    2. Var(4X) = 4² × 9 = 144 [1].
    3. (b)
    4. E(S) = 4 × 20 = 80 and Var(S) = 4 × 9 = 36 [2].
    5. (c)
    6. 4X is one observation multiplied by 4, so its single deviation is multiplied by 4. The four independent observations in S vary separately and their deviations partly cancel [1].

    Trap: Treating X₁ + X₂ + X₃ + X₄ as 4X, which gives 4 × 4 × 9 = 144 for the variance of the sum.

  8. A population has mean 50 and standard deviation 10. The random variable barX is the mean of 25 independent observations from the population. (a) Write down E(barX). (b) Show that the standard deviation of barX is 2.4 marks
    Answer
    1. (a)
    2. E(barX) = 50 [1].
    3. (b)
    4. barX = 1/25(X₁ + ⋯ + X₂₅), so Var(barX) = 25 × (1/25)² × 10² [1].
    5. = 100/25 = 4 [1].
    6. SD(barX) = √4 = 2 [1].

    Trap: Leaving the coefficient 1/25 unsquared, which gives a variance of 25 × 1/25 × 100 = 100.

  9. Machine A fills bottles with volume X ml, where E(X) = 502 and SD(X) = 3. Machine B fills bottles with volume Y ml, where E(Y) = 498 and SD(Y) = 4. An inspector takes three bottles from each machine, all independent, and calculates D = (A₁ + A₂ + A₃) - (B₁ + B₂ + B₃), where the A_i are from machine A and the B_i from machine B. (a) Find E(D). (b) Find the standard deviation of D, correct to three significant figures. (c) A second inspector takes one bottle from each machine and calculates 3(X - Y). Show that Var(3(X - Y)) is three times Var(D).7 marks
    Answer
    1. (a)
    2. E(D) = 3 × 502 - 3 × 498 [1].
    3. = 1506 - 1494 = 12 ml [1].
    4. (b)
    5. Var(D) = 3 × 3² + 3 × 4², adding the variances of all six bottles [1].
    6. = 27 + 48 = 75 [1].
    7. SD(D) = √75 = 8.66 ml [1].
    8. (c)
    9. Var(3(X - Y)) = 3² (3² + 4²) = 9 × 25 [1].
    10. = 225 = 3 × 75 = 3 Var(D) [1].

    Trap: Subtracting the variances for the bottles from machine B, or treating A₁ + A₂ + A₃ as 3X with variance 9 × 9 = 81. Each independent bottle adds its own variance once.

  10. Six jars of honey have masses, in grams, of 452, 448, 455, 450, 451, 450. (a) Calculate unbiased estimates of the mean and of the variance of the mass of a jar. A gift box holds four independent jars and packaging of fixed mass 35 g. Use your answers to (a) as the mean and variance for one jar. (b) Find the mean mass of a gift box. (c) Find the variance and the standard deviation of the mass of a gift box, correct to three significant figures.9 marks
    Answer
    1. (a)
    2. barx = 2706/6 = 451 g [1].
    3. sum (x - barx)² = 1 + 9 + 16 + 1 + 0 + 1 = 28 [1].
    4. sn₋₁² = 28/(6 - 1) [1].
    5. = 5.6 g² [1].
    6. (b)
    7. E(box) = 4 × 451 + 35 [1].
    8. = 1839 g [1].
    9. (c)
    10. Var(box) = 4 × 5.6 = 22.4 g², because the fixed packaging adds no variance [2].
    11. SD(box) = √(22.4) = 4.73 g [1].

    Trap: Multiplying the jar variance by 4² = 16 to get 89.6. Four independent jars add variances, so the factor is 4. A fixed packaging mass shifts the mean only.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
Var(aX + b) = a Var(X) + bVar(aX + b) = a² Var(X). Adding b does not change the spread.
Var(X - Y) = Var(X) - Var(Y)For independent variables, Var(X - Y) = Var(X) + Var(Y). Variances add.
Var(X₁ + X₂) = Var(2X) = 4 Var(X)Var(2X) = 4 Var(X) but, for independent observations, Var(X₁ + X₂) = 2 Var(X).
The unbiased estimate of the variance divides the sum of squares by n.The unbiased estimate sn₋₁² divides by n - 1. It does not divide by n.

Frequently asked questions

How do the mean and variance change when a random variable is multiplied by a constant and shifted by another?
For aX + b, the expected value is E(aX + b) = a E(X) + b. The variance is Var(aX + b) = a² Var(X), because adding b moves every value without changing the spread. The standard deviation is multiplied by |a| and is never negative. For example, with E(X) = 12 and Var(X) = 5, the variable 4 - 3X has Var = 45.
Does the expected value of a linear combination need the variables to be independent?
No. The expected value of a linear combination is the same combination of the expected values, E(a₁X₁ + ⋯ + anXn) = a₁E(X₁) + ⋯ + anE(Xn). Each variable keeps its own coefficient, including its sign. Independence is needed only for the variance, which is covered by the variance rule.
How do you find the variance of a linear combination of independent random variables?
For independent variables, each coefficient is squared and the variances are added: Var(a₁X₁ + ⋯ + anXn) = a₁²Var(X₁) + ⋯ + an²Var(Xn). A minus sign disappears when it is squared, so Var(X - Y) = Var(X) + Var(Y). Take the square root to get the standard deviation, and never add standard deviations.
What is the mean and variance of the sum of n independent observations, and of their sample mean?
For n independent observations with mean μ and variance σ², the sum has mean nμ and variance nσ². The sample mean barX has mean μ and variance σ² / n, because each observation has coefficient 1/n. Do not confuse the sum X₁ + X₂ with 2X, since Var(2X) = 4σ² but Var(X₁ + X₂) = 2σ².
Why is the sample mean an unbiased estimate of the population mean?
An estimator is unbiased when its expected value equals the parameter. The sample mean barx is an unbiased estimate of μ because E(barX) = μ. Calculate it as barx = sum x_i / n. It is right on average, though one sample may be above or below the population mean.
Why is my estimate of the population variance too small?
You have probably divided the sum of squares by n. The unbiased estimate sn₋₁² sums the squared distances from barx and divides by n - 1. For the sample 8, 10, 11, 7, 9, the sum of squares is 10, so sn₋₁² = 10/4 = 2.5, while dividing by n = 5 gives 2, which is sn².

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters