Course contentsShow
← Computer Science
Lesson 136 of 2,8723. Probability for Computer ScienceFree lesson

Variance of Linear Transformations

Learn how scaling and shifting affect variance: Var(aX + b) = a²Var(X), with shifts having no effect.

Variance of Linear Transformations

You'll learn how multiplying and adding constants to a random variable affects its spread — a key tool for simplifying probability calculations.

The Core Idea

When you transform a random variable X by scaling it (multiplying by a constant a) or shifting it (adding a constant b), the variance changes in a specific, predictable way:

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

Notice two critical facts:

  1. Scaling squares the effect: Multiplying X by a multiplies the variance by a², not just a
  2. Shifting does nothing: Adding a constant b has zero effect on variance

Why This Makes Sense

Think of variance as measuring how "spread out" your data is from the mean.

  • Shifting (+b): If you add 10 to every value in a dataset, the values all move together. The distance between values stays the same, so the spread (variance) doesn't change.

  • Scaling (×a): If you double every value, the distances between points also double. But variance measures squared distances from the mean, so doubling creates four times the variance (2² = 4).

Quick Example

If Var(X) = 9:

  • Var(X + 5) = 9 (shift by 5 → no change)
  • Var(3X) = 3² × 9 = 9 × 9 = 81 (triple the values → 9× the variance)
  • Var(3X - 7) = 9 × 9 = 81 (the -7 shift still has no effect)

This formula lets you quickly compute variance for transformed variables without recalculating from scratch — extremely useful when analyzing algorithm performance with scaled inputs.

Key Takeaway: Variance responds to scaling quadratically (a²) but ignores constant shifts entirely: Var(aX + b) = a²Var(X).