← back to probability

Expected Value and Variance

Grinstead & Snell · GFDL · PDF

Expected value is the weighted average of outcomes: E[X] = sum of x P(x). Variance measures how far outcomes spread from the mean. Linearity of expectation holds even when variables are dependent.

Expected value

The expected value E[X] is the long-run average. Weight each outcome by its probability and add. For a fair die: E[X] = (1 + 2 + 3 + 4 + 5 + 6)/6 = 3.5. You never roll 3.5, but that is what you get on average.

1 2 3 4 5 6 μ = E[X] σ (std dev)
Scheme

Variance and standard deviation

Variance measures spread: Var(X) = E[(X - mu)^2] = E[X^2] - (E[X])^2. Standard deviation sigma = sqrt(Var(X)) lives in the same units as X. Low variance means the distribution clusters near the mean. High variance means it sprawls.

Scheme

Linearity of expectation

The most useful property in probability: E[X + Y] = E[X] + E[Y], always. It does not matter whether X and Y are independent. E[aX + b] = a E[X] + b. This lets you compute expected values of complicated sums by breaking them into simple pieces.

Scheme

Connection: expected value and entropy

Shannon entropy H(X) = -sum P(x) log P(x) is itself an expected value: the average surprise. Baez and Fritz (2011) showed that entropy is the unique functor preserving this expectation structure. Expected value is not just a summary statistic. It is the interface between probability and information.

Scheme

Notation reference

Notation Scheme Meaning
E[X](expected-value xs ps)Expected value: weighted average
Var(X)(variance xs ps)Variance: E[X²] - (E[X])²
σ(sqrt (variance xs ps))Standard deviation
E[aX + b](+ (* a mu) b)Linearity of expectation
H(X)(entropy probs)Shannon entropy: expected surprise
Neighbors

Probability chapters

  • 🎰 Ch 5 — the distributions whose expected values and variances we compute here
  • 🎰 Ch 7 — sums of random variables: linearity in action
  • 🎰 Ch 8 — law of large numbers: sample means converge to E[X]

Paper pages

Related foundations

Foundations (Wikipedia)

Ready for the real thing? Read Grinstead & Snell, Chapter 6.

jkThe Handshake