Random variables · Definition

Variance

probabilityrandom variables

Before you start you need to know

The expectation tells where the center is; the variance tells how tightly or loosely the outcomes cluster around it.

Definition

The variance \(\operatorname{Var}(X)\) of a random variable \(X\) measures how spread out its values are around its expectation \(E\): it is the expected value of the squared deviation.

\[\operatorname{Var}(X)=E\big[(X-E[X])^2\big]\]

We measure each outcome's deviation \(X-E[X]\) from the center and average it. Averaging the raw deviation always gives 0, because positives cancel negatives; so it is squared before averaging, giving \(\operatorname{Var}(X)=E[(X-E[X])^2]\). Being an average of squares, it is never negative.

To compute it one almost always uses the equivalent form \(\operatorname{Var}(X)=E[X^2]-(E[X])^2\). For a fair die, \(E[X^2]=\tfrac{91}{6}\) and \(E[X]=\tfrac72\), so \(\operatorname{Var}(X)=\tfrac{35}{12}\). A typical mistake is to forget subtracting \((E[X])^2\) and stop at \(E[X^2]\).

Its properties show up under linear transformations: \(\operatorname{Var}(aX+b)=a^2\operatorname{Var}(X)\). Shifting by \(b\) leaves the spread unchanged and rescaling by \(a\) multiplies it by \(a^2\); hence \(\operatorname{Var}(-2X)=4\operatorname{Var}(X)\). It is 0 exactly when \(X\) is constant.

Its units are those of \(X\) squared, which makes it hard to interpret; the square root restores the original scale. For two variables, the variance of a sum includes a cross term measuring how they move together, an idea developed by the covariance.

Think about it

Why is the spread not defined as \(E[X-E[X]]\)?

Because that value is always 0: positive and negative deviations cancel.

If \(X\) measures a length in meters, what are the units of \(\operatorname{Var}(X)\)?

Square meters, since squares of lengths are averaged.

Exercises 10

References

  • Joseph K. Blitzstein, Jessica Hwang, Introduction to Probability, 2nd edition, CRC Press, 2019. §4.6
  • Sheldon Ross, A First Course in Probability, 10th edition, Pearson, 2019. §4.5
  • Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying Ye, Probabilidad y estadística para ingeniería y ciencias, 9.ª edición, Pearson, 2012. §4.2