# Linear transformations and combinations of random variables

> IB Mathematics AI HL · IB Math AI HL
> Source: https://www.owlsprep.com/study/ib-math-ai-hl-u5-linear-transformations-and-combinations-of/

This module covers rules for scaling and shifting single random variables, calculating mean and variance for sums/differences of independent random variables, and applying these properties to combined normal distributions for exam problems.

**Prerequisites:** [Basic properties of expected value and variance](https://www.owlsprep.com/study/ib-math-ai-hl-u5-expected-value-variance-definitions/); [Normal distribution fundamentals](https://www.owlsprep.com/study/ib-math-ai-hl-u5-normal-distribution-intro/)

## Learning objectives

- Derive expected value and variance for a linearly transformed single random variable
- Calculate the mean and variance of linear combinations of independent random variables
- Apply rules for sum and difference of independent normal random variables
- Solve real-world problems involving combined random variable distributions

## Linear Transformations of a Single Random Variable

A linear transformation modifies every outcome of a random variable by a fixed scaling factor and a fixed shift. This is commonly used to convert units, for example converting a random variable measured in kilograms to grams, or adjusting raw test scores to a scaled grading curve.

**Linear transformation properties** — E(aX + b) = aE(X) + b, Var(aX + b) = a²Var(X). The constant shift b does not affect variance, as it moves all outcomes by the same amount without changing their spread.

*Notation:* For constants a, b and random variable X

**Worked example:** The random variable X has E(X) = 12, Var(X) = 4. Find E(3X + 7) and Var(3X + 7).

1. Apply the expected value linearity rule
2. $$E(3X +7) = 3E(X) +7 = 3(12) +7 = 43$$
3. Apply the variance transformation rule, squaring the scaling factor and ignoring the constant shift
4. $$Var(3X +7) = 3^2 Var(X) = 9(4) = 36$$

**Check your understanding**

Test your understanding of basic transformation rules

1. A random variable Y has mean 20, variance 9. What is Var(2Y - 5)?

   - 18
   - 36
   - 31
   - 13

   *Why:* Var(2Y -5) = 2²Var(Y) = 4*9 = 36, the -5 shift has no impact on variance.

## Expected Value of Linear Combinations of Random Variables

Linearity of expectation holds for all random variables, regardless of whether they are independent or dependent. This is one of the most flexible properties in probability, and can be extended to any number of random variables in a linear combination.

$$E(aX + bY) = aE(X) + bE(Y)$$

$$E(X_1 + X_2 + ... + X_n) = E(X_1) + E(X_2) + ... + E(X_n)$$

**Worked example:** The mass of a single apple A has mean 110g, the mass of a single banana B has mean 130g. Find the expected total mass of 3 apples and 2 bananas.

1. Write the total mass as a linear combination: Total = 3A + 2B
2. $$E(Total) = 3E(A) + 2E(B) = 3(110) + 2(130) = 330 + 260 = 590g$$

> **Linearity of expectation exception**
>
> You do not need to confirm independence to apply linearity of expectation, this rule works for every pair of random variables.

## Variance of Linear Combinations of Independent Random Variables

Unlike expected value, variance of a linear combination only simplifies to a sum of weighted variances if the random variables are independent. Dependent variables require an additional covariance term that is omitted for IB AI HL problems unless explicitly stated.

**Derivation:** Derive Var(X - Y) for independent X, Y

*Starting from:* Var(Z) = E(Z²) - [E(Z)]², X and Y independent

1. Let Z = X - Y, expand the variance definition
2. $$Var(X-Y) = E((X-Y)^2) - [E(X-Y)]^2$$
3. Expand terms and cancel cross terms using independence property E[XY] = E[X]E[Y]
4. $$Var(X-Y) = Var(X) + Var(Y)$$

*Conclusion:* Variance of a difference of independent variables is equal to the sum of their individual variances

**Worked example:** Independent random variables X and Y have Var(X) = 16, Var(Y) = 9. Find Var(2X - 3Y).

1. Square each scaling factor and multiply by the respective variance
2. $$Var(2X - 3Y) = 2^2 Var(X) + (-3)^2 Var(Y)$$
3. $$= 4(16) + 9(9) = 64 + 81 = 145$$

**Exam command terms**

IB exam questions use specific command terms for this topic

- **Show that the variance is...** — You must explicitly state that variables are independent to omit covariance terms to earn full marks

- **Calculate the standard deviation of the sum** — You must sum variances first before taking the square root, do not add individual standard deviations

## Sums and Differences of Independent Normal Random Variables

A critical property tested frequently in IB AI HL exams is that the linear combination of independent normal random variables also follows a normal distribution. This allows you to use standard normal CDF functions to calculate probabilities for combined variables.

**Sum of independent normal variables** — aX + bY ~ N(aμ₁ + bμ₂, a²σ₁² + b²σ₂²)

*Notation:* If X ~ N(μ₁, σ₁²), Y ~ N(μ₂, σ₂²), independent

**Worked example:** X ~ N(50, 16), Y ~ N(30, 9), independent. Find P(X > Y + 15).

1. Rearrange the inequality: X - Y > 15, define new variable Z = X - Y
2. $$E(Z) = 50 - 30 = 20, Var(Z) = 16 + 9 = 25, Z ~ N(20, 25)$$
3. Calculate P(Z > 15) using normal CDF on your GDC
4. $$P(Z > 15) = 0.8413$$

> **Easy memory hook**
>
> VAS = Variance Always Sums, even when you subtract independent random variables, you never subtract variances.

## Common pitfalls

- **Wrong:** Forgetting to square the scaling factor when calculating Var(aX + b)
  - Why it fails: Students incorrectly carry over the linear scaling rule from expected value to variance
  - Correct: Always use Var(aX + b) = a²Var(X), the constant b has no impact on variance
- **Wrong:** Subtracting variances when calculating Var(X - Y)
  - Why it fails: Confusing variance rules with the linearity of expected value for differences
  - Correct: Var(X - Y) = Var(X) + Var(Y) for independent X and Y
- **Wrong:** Applying combination variance rules to dependent random variables
  - Why it fails: Failing to check for independence before discarding covariance terms
  - Correct: Only use Var(aX + bY) = a²Var(X) + b²Var(Y) if X and Y are explicitly stated to be independent
- **Wrong:** Adding standard deviations instead of variances for combined distributions
  - Why it fails: Mixing up units of spread for transformed variables
  - Correct: Sum variances first, then take the square root to get the combined standard deviation
- **Wrong:** Assuming the sum of any two random normal variables is normal
  - Why it fails: Forgetting the requirement of independence for this property to hold in exam contexts
  - Correct: Confirm independence before stating that X + Y follows a normal distribution

## Cheatsheet

| Operation | Expected Value | Variance (Independent RVs) |
| --- | --- | --- |
| aX + b | aE(X) + b | a²Var(X) |
| X + Y | E(X) + E(Y) | Var(X) + Var(Y) |
| X - Y | E(X) - E(Y) | Var(X) + Var(Y) |
| aX + bY | aE(X) + bE(Y) | a²Var(X) + b²Var(Y) |
| Sum of n identical independent X | nE(X) | nVar(X) |

## What's next

Mastering these linear combination rules is a critical prerequisite for tackling more advanced IB AI HL topics including linear regression, hypothesis testing for two independent samples, and probability modelling for combined real-world datasets. These properties are frequently tested in Paper 2 and Paper 3 extended response questions, where you will often be required to justify your use of distribution properties to earn full method marks. You will next apply these rules to solve problems involving linear combinations of discrete random variables, then extend the framework to calculate confidence intervals for difference in population means. Make sure to complete the associated practice question set to reinforce your understanding before moving on.

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-ai-hl-u5-linear-transformations-and-combinations-of/
