Exam PRandom variablesFree to read

Expectation, variance and moments

E[X] is the centre, Var(X) the spread, and Var(X) = E[X²] − (E[X])² is the identity that turns most exam questions into two sums.

The formulas

Expectation
E[X]=∑xx p(x)or∫−∞∞xf(x) dxE[X] = \sum_x x\,p(x) \quad\text{or}\quad \int_{-\infty}^{\infty} x f(x)\,dx
Law of the unconscious statistician
E[g(X)]=∑xg(x)p(x)or∫g(x)f(x) dxE[g(X)] = \sum_x g(x)p(x) \quad\text{or}\quad \int g(x)f(x)\,dx
Variance
Var⁡(X)=E ⁣[(X−μ)2]=E[X2]−μ2\operatorname{Var}(X) = E\!\left[(X-\mu)^2\right] = E[X^{2}] - \mu^{2}
Linear transform
E[aX+b]=aE[X]+b,Var⁡(aX+b)=a2Var⁡(X)E[aX+b] = aE[X]+b, \qquad \operatorname{Var}(aX+b) = a^{2}\operatorname{Var}(X)
Survival form
E[X]=∫0∞S(x) dxE[X] = \int_0^{\infty} S(x)\,dx

non-negative X

Where it comes from

  1. Expanding E[(X−μ)2]=E[X2−2μX+μ2]E[(X-\mu)^2] = E[X^2 - 2\mu X + \mu^2] and using linearity gives E[X2]−2μ2+μ2=E[X2]−μ2E[X^2] - 2\mu^2 + \mu^2 = E[X^2] - \mu^2.
  2. The shift bb moves the whole distribution and cannot change spread, which is why it disappears from the variance.
  3. The survival form comes from swapping the order of integration in ∫0∞∫0xf(x) dt dx\int_0^\infty \int_0^x f(x)\,dt\,dx.

Worked example

The number of claims filed by a policyholder in a year takes values 0, 1, 2, 3 with probabilities 0.25, 0.35, 0.28, 0.12. Find the variance.

  1. E[X]=0(0.25)+1(0.35)+2(0.28)+3(0.12)=1.27E[X] = 0(0.25)+1(0.35)+2(0.28)+3(0.12) = 1.27.
  2. E[X2]=0+1(0.35)+4(0.28)+9(0.12)=2.55E[X^{2}] = 0+1(0.35)+4(0.28)+9(0.12) = 2.55.
  3. Var⁡(X)=2.55−1.272=2.55−1.6129\operatorname{Var}(X) = 2.55 - 1.27^{2} = 2.55 - 1.6129.
  4. Var⁡(X)=0.9371\operatorname{Var}(X) = 0.9371.

Answer: 0.9371

This answer is recomputed from the site’s own interest-theory and probability functions every time the test suite runs, so the page and the mathematics cannot drift apart.

Memory hooks

  • Var = E[X²] − (E[X])². Compute the second moment, never the squared deviations, unless the question hands you deviations.
  • Adding a constant never changes a variance; multiplying by a scales it by a².

Traps

  • Reporting the standard deviation when the question asked for the variance (or the reverse).
  • Applying E[g(X)] = g(E[X]) - true only for linear g.

Related

Drill this: the Exam P question bank has original questions on this topic, and today’s free round is open to everyone.