Statistics Quest

Expected value and variance of a random variable

The expected value is the long-run average of a random quantity and its variance the long-run average squared distance from that mean.

E⁡(X)=μ=∑xx P(X=x),Var⁡(X)=∑x(x−μ)2P(X=x)=E⁡(X2)−μ2\E(X) = \mu = \sum_x x\,P(X = x), \qquad \Var(X) = \sum_x (x - \mu)^2 P(X = x) = \E(X^2) - \mu^2
Discrete random variable.
xx
Each possible value of XX.
P(X=x)P(X = x)
Its probability (they sum to 1).
E⁡(aX+b)=a E⁡(X)+b,Var⁡(aX+b)=a2Var⁡(X)\E(aX + b) = a\,\E(X) + b, \qquad \Var(aX + b) = a^2 \Var(X)
Linear transformation.
a, ba,\ b
Constants.
E⁡(X+Y)=E⁡(X)+E⁡(Y),Var⁡(X±Y)=Var⁡(X)+Var⁡(Y)  (X,Y independent)\E(X + Y) = \E(X) + \E(Y), \qquad \Var(X \pm Y) = \Var(X) + \Var(Y) \ \ (X, Y \text{ independent})
Sums and differences.
X, YX,\ Y
Random variables; the variance rule needs independence (otherwise add ±2Cov⁡(X,Y)\pm 2\Cov(X, Y)).

When to use

  • Fair games, insurance premiums, expected profit of a decision, expected cost of errors.
  • Summarising any probability distribution (continuous versions replace sums with integrals).

How to interpret

E⁡(X)\E(X) is what the average outcome approaches over many independent repetitions (law of large numbers) — it need not be a possible outcome. SD⁡(X)=Var⁡(X)\SD(X) = \sqrt{\Var(X)} measures risk: two bets with the same expected value can have very different spreads. A game is fair when the expected net gain is 0.

Common mistakes

  • Adding standard deviations instead of variances.
  • Subtracting variances for a difference: Var⁡(X−Y)\Var(X - Y) is Var⁡(X)+Var⁡(Y)\Var(X) + \Var(Y) for independent variables.
  • Forgetting to square aa in Var⁡(aX)\Var(aX).
  • Judging a one-off decision only by its expected value, ignoring risk.

Example

A promotion loses 2 with probability 0.5, breaks even with probability 0.3 and gains 10 with probability 0.2. E⁡(X)=−1+0+2=1\E(X) = -1 + 0 + 2 = 1; E⁡(X2)=2+0+20=22\E(X^2) = 2 + 0 + 20 = 22; Var⁡(X)=22−1=21\Var(X) = 22 - 1 = 21, SD⁡(X)=4.58\SD(X) = 4.58. Positive on average, but highly variable.