Linear Combinations of Random Variables
A linear combination of random variables is something like , or : random quantities scaled, shifted, added and subtracted. Totals, differences, costs and conversions are all linear combinations, so this topic is the engine behind a large share of Paper 6, from "the total mass of five parcels" to the distribution of a sample mean. This note gives the rules for means and variances, which work for any distribution; the follow-up notes deal with the special cases where the distribution of the combination is also known (normal and Poisson).
Scaling and shifting one variable
Suppose is the temperature in degrees Celsius at noon, with mean and variance . In Fahrenheit the temperature is .
Shifting by moves every value up by , so it moves the mean up by . It does not change how spread out the values are, so it does not change the variance.
Scaling by multiplies every value, and every distance from the mean, by . So it multiplies the mean by and the standard deviation by . Variance is measured in squared units, so it is multiplied by .
For any random variable and constants and :
Consequently the standard deviation of is times the standard deviation of .
For the temperatures: and , so the standard deviation is , which is as expected.
Two consequences are worth spelling out.
- Adding a constant never changes the variance: .
- A negative multiplier still increases or keeps the spread: , and . Variances can never be negative.
The random variable has the following probability distribution.
Find and .
Solution
Then
Combining two variables
Now take two random variables and , for example the scores of two players.
Means always add. On average, the total of two scores is the total of the two averages, whatever the relationship between the players. So and, more generally, .
Variances add when the variables are independent. If the two scores have nothing to do with each other, then sometimes one is high while the other is low and they partly cancel, but just as often both are high or both low. On balance, the total is more variable than either score on its own. For independent variables the variances add exactly.
For any random variables and and constants and :
If, in addition, and are independent:
Proofs are not required.
Differences have added variances
Put and :
The variance of a difference is the sum of the variances. This feels wrong the first time you see it, so think of an example: if the arrival time of your train is uncertain and the departure time of your connection is uncertain, the gap between them is more uncertain than either, not less. Subtracting does not cancel randomness; it adds a second source of it.
and are independent random variables with , , and . Find
(a) and ,
(b) the standard deviation of .
Solution
(a)
(b) The constant does not affect the variance.
Sums of several observations versus a multiple of one
This is the single most important distinction in the topic.
Let be the mass of one apple. Consider:
- : the total mass of four different apples, each with the same distribution as , independently;
- : four times the mass of one apple.
Both have mean . But their variances are very different:
With four different apples, a heavy one is likely to be offset by a lighter one, so the total varies less than four times one apple's mass would. With there is no offsetting: one heavy apple is counted four times.
If are independent observations of :
whereas
- Read the context and ask: are there several separate items, people or occasions, each with its own random value? Then it is a sum .
- Is a single random value being multiplied (a price per kilogram times one mass, a conversion, "twice the time taken")? Then it is a multiple .
- Write the expression in symbols before calculating its variance.
The score in one round of a game has mean and variance . Rounds are independent.
(a) Ali plays rounds. Find the mean and variance of his total score.
(b) Bea plays one round and her score is multiplied by . Find the mean and variance of her final score.
(c) Find the mean and variance of the difference between Ali's total and Bea's final score.
Solution
(a) : , .
(b) : , .
(c) Ali's and Bea's rounds are separate, so and are independent.
Combining different distributions
The rules hold whatever the distributions are, so you can mix binomial, Poisson and other variables, using their known means and variances:
| Distribution | Mean | Variance |
|---|---|---|
| (not required) |
A café sells coffees and cakes. The number of coffees sold in an hour, , has the distribution . The number of cakes sold in the same hour, , has the distribution , independently of . Each coffee earns a profit of dollars and each cake dollars, and the hourly running cost is dollars.
Find the mean and standard deviation of the hourly profit, dollars.
Solution
, ; , .
Working backwards and using
Questions can give you facts about a combination and ask for the original parameters. Two tools help.
- Set up equations from the expectation and variance rules and solve them simultaneously.
- Remember , so . The rules say nothing directly about or ; you get them through the variance.
, and are independent observations of a random variable with mean and variance . It is given that and .
(a) Find and .
(b) Find .
(c) Find .
Solution
(a) , so .
, so .
(b) .
(c) Let . Then and .
- Subtracting variances. . A negative variance is a sure sign of this error.
- Forgetting to square the coefficient. , not .
- Including the constant in the variance. ; the disappears.
- Confusing with . Separate items give ; a multiple of one item gives .
- Adding standard deviations. Standard deviations do not add. Convert to variances, combine, then take the square root at the end.
- Using the variance rule without independence. The rule needs independence; the mean rule does not.
- Write the combination in symbols before calculating, for example "". This is where most errors happen, and a correct expression earns credit even if the arithmetic slips.
- Show the variance calculation term by term: . Examiners can then award the method mark.
- If asked for a standard deviation, find the variance first and square-root it as the very last step.
- A question that says "state an assumption" for a variance calculation is looking for independence, in context: "the number of coffees sold is independent of the number of cakes sold".
- These rules give means and variances only. If a question asks for a probability involving a combination, you need to know its distribution: see linear combinations of normal variables and sums of Poisson variables.
- and .
- always.
- when and are independent.
- : variances of differences add.
- separate observations: variance ; one observation times : variance .
- Combine variances, never standard deviations.
- .
Practice questions
- and . Find , and .
- and are independent with , , and . Find (a) the mean and standard deviation of , (b) and .
- The random variable takes values , and with probabilities , and . and are independent observations of . Find and .
- The number of letters delivered to a house each day has the distribution , independently from day to day. Find the mean and variance of the total number of letters in days, and explain why this is not the same as the variance of .
- and are independent. Find and .
- The noon temperature in degrees Celsius has mean and standard deviation . Find the mean and standard deviation of the temperature in degrees Fahrenheit, .
- has mean and variance . The random variable , where , has mean and variance . Find and .
- A taxi fare, in dollars, is , where the distance km has mean and standard deviation , and the waiting time minutes has mean and standard deviation . and are independent. (a) Find the mean and standard deviation of . (b) A driver takes independent fares in a week. Find the mean and standard deviation of the total of these fares. (c) Find the variance of the mean fare of these fares.
Answers
-
; ; .
-
(a) ; , so the standard deviation is . (b) ; .
-
; ; . ; .
-
Total : , . would be ten times one day's letters, with variance . The total over ten different days is a sum of separate independent counts, so high and low days partly balance out, giving the smaller variance.
-
, ; . ; .
-
; standard deviation .
-
(positive root). . (This is standardising: .)
-
(a) . ; standard deviation dollars. (b) Total of separate fares: mean ; variance ; standard deviation dollars. (c) Mean fare , so its variance is (equivalently ).