Random variables · Definition
Variance
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.
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
- \(X\) takes the values 0, 1 and 2 with probabilities 0.2, 0.5 and 0.3 (so \(E[X]=1.1\)). Compute \(\operatorname{Var}(X)\).
- Compute the variance of the outcome of a fair die.
- \(X\) has density \(f(x)=2x\) on \([0,1]\). Compute \(\operatorname{Var}(X)\).
- If \(\operatorname{Var}(X)=4\), what is \(\operatorname{Var}(3X+1)\)?
- If \(E[X]=2\) and \(E[X^2]=7\), what is \(\operatorname{Var}(X)\)?
- \(X\) equals 1 with probability 0.3 and 0 with probability 0.7. Compute \(\operatorname{Var}(X)\).
- Which statement about the variance is correct?
- \(X\) equals \(-2\) or \(2\) with probability \(\tfrac12\) each. Compute \(\operatorname{Var}(X)\).
- If \(\operatorname{Var}(X)=5\), what is \(\operatorname{Var}(-2X)\)?
- \(X\) has density \(f(x)=\tfrac14\) on \([0,4]\). Compute \(\operatorname{Var}(X)\).
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