Linear Combinations of Random Variables
Real quantities are often built from other random quantities: a total bill is a sum of item prices, a temperature in °F is a rescaled temperature in °C, and a profit is income minus cost. This page gives you the rules for the mean and variance of these combinations, so you can find them without ever listing a new probability distribution. The same rules explain why a sample mean is a good estimate of a population mean, which is the foundation for the central limit theorem and confidence intervals.
Key ideas
Section titled “Key ideas”Notation
Section titled “Notation”For a random variable , is its expected value (mean, ) and is its variance (). The standard deviation is . You’ll usually be given and , or find them with your GDC from a table of values; the IB guide says you won’t need the variance formula itself in exams.
A linear transformation of one variable
Section titled “A linear transformation of one variable”If and are constants,
Why the difference? Adding slides every value along by the same amount, so the centre moves but the spread doesn’t change. Multiplying by stretches the distances between values by a factor of , and variance is measured in squared units, so it is multiplied by . The standard deviation is multiplied by .
Notice that : flipping a distribution doesn’t change its spread.
Expected value of a linear combination
Section titled “Expected value of a linear combination”For any random variables and constants ,
Means simply combine the same way the variables do. This works whether or not the variables are independent.
Variance of a linear combination of independent variables
Section titled “Variance of a linear combination of independent variables”If are independent,
Two things to notice:
- Each coefficient is squared, just like in .
- The variances are always added, even when the variables are subtracted. In particular, . Subtracting a random quantity adds uncertainty; it can’t take uncertainty away.
You add variances, never standard deviations. Find the variance of the combination first, then take the square root at the end.
2X is not the same as X₁ + X₂
Section titled “2X is not the same as X₁ + X₂”Suppose is the mass of one apple. Compare:
- : the mass of one apple, doubled (one random value, scaled).
- : the total mass of two different apples (two independent values, added).
They have the same mean, , but different variances:
| Mean | Variance | |
|---|---|---|
The sum of two independent apples varies less, because a heavy apple and a light apple often partly cancel out. Doubling one apple doubles its deviation from the mean, with nothing to cancel it. Read the question carefully: “the total of items” means , while ” times one item” means .
Unbiased estimates of the mean and variance
Section titled “Unbiased estimates of the mean and variance”When you don’t know a population’s and , you estimate them from a sample of size . An estimate is unbiased if, on average over many samples, it equals the true value.
- The sample mean is an unbiased estimate of :
- The unbiased estimate of divides by , not . For a frequency table with values,
Here is the variance of the sample itself (dividing by ). The sample’s values sit a little closer to their own mean than to the true , so tends to underestimate ; multiplying by corrects this. (See standard deviation for the same idea.)
On a GDC’s one-variable statistics screen, (or ) is and (or ) is . Proving that and is not examined, but practice question 9 shows the first one.
Worked examples
Section titled “Worked examples”Example 1: Changing units
Section titled “Example 1: Changing units”The midday temperature in a city in May, in °C, has and . The temperature in °F is . Find , , and the standard deviation of .
Solution.
The standard deviation is °F. Check: the standard deviation of is , and . The moves the mean but has no effect on the spread.
Example 2: Revenue from two products
Section titled “Example 2: Revenue from two products”At a café, the number of coffees sold in an hour, , has and . The number of muffins sold, , has and . Assume and are independent. Coffees cost $4 and muffins cost $3.
- (a) Find the mean and standard deviation of the hourly revenue , in dollars.
- (b) Find the mean and variance of , the number of coffees sold minus the number of muffins.
Solution.
(a) The mean:
The variance (independent, so the variances add with squared coefficients):
So the mean revenue is $156 and the standard deviation is , which is $18.4 to 3 s.f.
(b) , and
The variances add even though the variables are subtracted.
Example 3: Six apples or six times one apple?
Section titled “Example 3: Six apples or six times one apple?”The mass of an apple from an orchard, grams, has and .
- (a) Six apples are chosen at random. Find the mean and standard deviation of their total mass .
- (b) Find the mean and standard deviation of .
Solution.
(a) , where the are independent and each has the same distribution as .
The standard deviation is g (3 s.f.).
(b) is one apple’s mass multiplied by :
The standard deviation is g.
The means agree, but the total of six real apples is much less spread out ( g compared with g), because heavier and lighter apples balance each other.
Example 4: Unbiased estimates from a frequency table
Section titled “Example 4: Unbiased estimates from a frequency table”A random sample of hockey games recorded the number of goals scored by the home team.
| Goals, | |||||
|---|---|---|---|---|---|
| Frequency, |
Find unbiased estimates of the population mean and variance.
Solution. Here .
Now the sum of squared deviations:
The unbiased estimate of is goals and of is .
Check with the GDC: entering the table into one-variable statistics gives , so , and , which matches. (, and gives the same value.)
Common mistakes
Section titled “Common mistakes”Adding standard deviations. If has standard deviation and has standard deviation , the standard deviation of (independent) is , not . Always combine variances, then take the square root.
Subtracting variances. . If you subtract, you can even end up with a negative “variance”, which is impossible.
Forgetting to square the coefficient. , not . And : the constant disappears.
Mixing up nX and the sum of n values. “The total mass of bags” is , with variance . “Four times the mass of one bag” is , with variance . Ask yourself: is it one random value or several?
Using the variance rule without independence. The rule for adding variances only works for independent variables. Means always combine, but if the variables are linked (for example, the number of hot dogs and the number of buns sold), you can’t just add the variances.
Using the wrong standard deviation from the GDC. To estimate the population variance from a sample, use (), not (). Square it to get .
Practice
Section titled “Practice”1. (Warm-up) A random variable has and . Find:
- (a)
- (b)
- (c)
Solution
(a)
(b)
(c)
2. (Warm-up) and are independent with , , , and . Find:
- (a) and
- (b) and
Solution
(a) and .
(b) and
3. (Warm-up) A random sample of values has . Find an unbiased estimate of the population variance.
Solution
4. (Core) Mia walks to the bus stop and then takes the bus to school. Her walking time has mean minutes and standard deviation minutes. Her bus time has mean minutes and standard deviation minutes. and are independent.
- (a) Find the mean and standard deviation of her total travel time.
- (b) Explain why the standard deviation is not minutes.
Solution
(a) minutes. , so the standard deviation is minutes (3 s.f.).
(b) Variances add for independent variables, not standard deviations. A slow walk and a fast bus ride (or the other way round) often partly cancel, so the total is less spread out than minutes would suggest.
5. (Core) The mass of a bag of sugar, grams, has mean g and standard deviation g.
- (a) Three bags are chosen at random. Find the mean and standard deviation of their total mass.
- (b) Find the mean and standard deviation of .
- (c) Two bags are chosen at random. Find the mean and standard deviation of the difference between their masses, .
Solution
(a) Total : mean g, variance , standard deviation g (3 s.f.).
(b) Mean g, variance , standard deviation g.
(c) g. , so the standard deviation is g (3 s.f.). The mean difference is , but the difference still varies, and the variances add.
6. (Core) In a game, the score has this probability distribution.
- (a) Use your GDC to show that and .
- (b) A player wins $5 for each point scored but pays $8 to play, so their profit is dollars. Find and .
- (c) The player plays independent games. Find the mean and standard deviation of their total profit.
Solution
(a) Enter the values as a list and the probabilities as frequencies in one-variable statistics: and , so . (By hand: , and .)
(b) , so the mean profit is $2.50 per game. .
(c) The total is (ten independent games, not ). The mean is , so $25. The variance is , so the standard deviation is , which is $18.0 (3 s.f.).
7. (Core) A random sample of pumpkins from a farm has these masses, in kilograms: . Find unbiased estimates of the population mean and variance.
Solution
The sum is , so
From the GDC, , so
Check: , and , which matches.
8. (Challenge) Test scores have mean and standard deviation . A teacher rescales them with , where , so that the new scores have mean and standard deviation . Find and , and find the new score of a student who scored .
Solution
The standard deviation is multiplied by (since ), so and .
The mean: , so .
The new score for is . Check: was one standard deviation above the old mean, and is one standard deviation above the new mean.
9. (Challenge) are independent, and each has mean and variance . The sample mean is .
- (a) Show that and .
- (b) A population has . How large must a sample be for the standard deviation of to be at most ?
Solution
(a) Write . Then
so is an unbiased estimate of . Using independence,
(b) The standard deviation of is .
The sample must have at least values. Larger samples give more precise means; see the central limit theorem.