Skip to content
Glacius
ProbabilityConcept reference

Variance

Variance is the expected squared deviation from the mean.

On this page 7 sections
  1. Overview
  2. Variance measures spread around the mean μ=E[X]
  3. Unequal probabilities still matter after squaring
  4. Signed deviations average to zero because positive and negative terms cancel
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01Variance measures spread around the mean μ=E[X]#

Variance measures spread around the mean μ=E[X]\mu=E[X]. Take each deviation xμx-\mu, square it, and average those squares using the probabilities.

Var(X)=E[(Xμ)2]\begin{gathered}\operatorname{Var}(X)\\=E[(X-\mu)^2]\end{gathered}

If 11 and 55 are equally likely, the mean is 33. Both squared deviations are 44, so the variance is 44.

Outcomes 1, 5 have probabilities 0.5, 0.5. The balance point is the mean 3. Below, widths are probabilities and heights are squared distances to the mean. The total weighted area is variance 4.Outcomes 1, 5 have probabilities 0.5, 0.5. The balance point is the mean 3. Below, widths are probabilities and heights are squared distances to the mean. The total weighted area is variance 4.
Figure 1Outcomes 1, 5 have probabilities 0.5, 0.5. The balance point is the mean 3. Below, widths are probabilities and heights are squared distances to the mean. The total weighted area is variance 4.
Link to this figure ↗Download SVGDownload PNG
Check your reasoning

PMF: p(0)=0.5p(0)=0.5, p(2)=0.5p(2)=0.5. Mean μ=1\mu=1. Find Var(X)\operatorname{Var}(X).

Show answer and explanation
1

Squared deviations: 1,11, 1. Weighted sum: 0.5+0.5=10.5+0.5=1.

02Unequal probabilities still matter after squaring#

Unequal probabilities still matter after squaring. A rare large deviation contributes its squared size multiplied by its probability.

These exercises describe a probability model. Use its supplied masses; no sample correction is involved.

Check your reasoning

A two-state model gives X=0X=0 with probability 0.75 and X=4X=4 otherwise. Mean μ=1\mu=1. Find Var(X)\operatorname{Var}(X).

Show answer and explanation
3

Squared deviations: 1,91, 9. Weighted sum: 0.75+2.25=30.75+2.25=3.

03Signed deviations average to zero because positive and negative terms cancel#

Signed deviations average to zero because positive and negative terms cancel. Squaring before averaging prevents that cancellation.

Variance is nonnegative. It is zero when the model puts all probability at its mean. Its units are the original units squared.

Check your reasoning

PMF: p(3)=0.5p(-3)=0.5, p(3)=0.5p(3)=0.5. Mean μ=0\mu=0. A learner averages signed deviations and gets zero. Find the variance.

Show answer and explanation
9

Squared deviations: 9,99, 9. Weighted sum: 4.5+4.5=94.5+4.5=9.

Key takeaway

Center, square, then weight by probability; signed cancellation is not a measure of spread.

  • Compute variance as expected squared deviation from the mean.

Sources & further reading

  1. [1]
    Pishro-Nik, Introduction to Probability: VariancePishro-Nik: Introduction to Probability · Article

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Variance.” Math behind ML. /learn/p-variance