Skip to main content

TL;DR

Law of Total Variance: Var(X) = E[Var(X|Y)] + Var(E[X|Y]) — decompose variance into within-group and between-group. This concept is essential for quantitative trading interviews and is frequently tested at top firms.

By Valenke Exam Prep Team·Last updated 2026-06-01
Probability

Law of Total Variance

Var(X) = E[Var(X|Y)] + Var(E[X|Y]) — decompose variance into within-group and between-group.

The Law of Total Variance (also called the Eve's law or conditional variance formula) decomposes the total variance of XX into two pieces: Var(X)=E[Var(XY)]+Var(E[XY])\text{Var}(X) = E[\text{Var}(X \mid Y)] + \text{Var}(E[X \mid Y]) Intuition: Think of grouping data by some variable YY. The first term captures the average spread *within* each group. The second term captures how much the group means *differ from each other*. Total variance = average within-group variance + between-group variance. Concrete example: You roll a fair die to get NN, then flip NN fair coins. Let XX = number of heads. Given NN, XBin(N,1/2)X \sim \text{Bin}(N, 12\frac{1}{2}), so E[XN]=N/2E[X \mid N] = N/2 and Var(XN)=N/4\text{Var}(X \mid N) = N/4. E[Var(XN)]=E[N/4]=E[N]/4=3.5/4=0.875E[\text{Var}(X \mid N)] = E[N/4] = E[N]/4 = 3.54\frac{5}{4} = 0.875 Var(E[XN])=Var(N/2)=Var(N)/4=(35/12)/40.729\text{Var}(E[X \mid N]) = \text{Var}(N/2) = \text{Var}(N)/4 = (3512\frac{35}{12})/4 \approx 0.729 Var(X)=0.875+0.729=1.604\text{Var}(X) = 0.875 + 0.729 = 1.604 When to use: Problems with hierarchical randomness — first a parameter is drawn randomly, then observations are generated conditional on that parameter. Common in compound distributions, Bayesian models, and random sample size problems. The formula tells you whether most variability comes from randomness within groups or differences between groups.

Ready to practice for the Valenke Finance Exam?

Adaptive practice powered by Item Response Theory targets your weak areas. Start with 3 free sessions.

Start free practice →