Quant Ladder

Conditional Expectation and the Tower Rule

2 min read

If linearity of expectation is the most-used tool in this course, conditioning is the second. The tower rule (law of total expectation) says you can compute an expectation in stages:

E[X]=E[E[XY]]E[X] = E\big[\,E[X \mid Y]\,\big]

Average the conditional averages, weighted by how likely each condition is. Almost every "two-stage randomness" question is this identity applied once.

The basic move

"Roll a die, then flip that many fair coins. Expected heads?"

Condition on the roll: E[headsN=n]=n/2E[\text{heads} \mid N = n] = n/2. Then average over the roll:

E[heads]=E[N/2]=3.52=1.75.E[\text{heads}] = E[N/2] = \frac{3.5}{2} = 1.75.

No enumeration of 6 × outcomes — the stage structure does the work. The general pattern for a random sum S=X1++XNS = X_1 + \cdots + X_N (random NN independent of the XiX_i) is Wald's identity:

E[S]=E[N]E[X]E[S] = E[N] \cdot E[X]

Instant applications: expected total order flow (random number of trades × average trade size), total claims (random claim count × average claim), total P&L over a random number of bets. Variance has its own two-stage version (the law of total variance, Var(X)=E[Var(XY)]+Var(E[XY])\operatorname{Var}(X) = E[\operatorname{Var}(X|Y)] + \operatorname{Var}(E[X|Y])) — "within" plus "between" variance, worth knowing by name.

Conditional expectation as best prediction

E[XY]E[X \mid Y] is a random variable — a function of YY — and it is the best predictor of XX given YY in the least-squares sense. Regression (from the statistics course) is the linear approximation of exactly this object; regression to the mean is a statement about it. The martingale definition from earlier in this course ("E[Mt+1Ft]=MtE[M_{t+1} \mid \mathcal{F}_t] = M_t") now reads naturally: the best prediction of tomorrow is today.

Two properties used constantly, worth stating precisely:

  • Taking out what is known: E[f(Y)XY]=f(Y)E[XY]E[f(Y) X \mid Y] = f(Y)\, E[X \mid Y].
  • Independence drops the condition: if XYX \perp Y, then E[XY]=E[X]E[X \mid Y] = E[X].

Conditioning as a problem-solving reflex

The craft is choosing what to condition on — the first event, the first success, the identity of a maximum, a symmetry-breaking piece of information:

  • First-step conditioning built every waiting-time recurrence in this course (flips until HH, ant on the cube).
  • Condition on the source: "Two dealers quote; one is sharp (spread 2), one is wide (spread 10), you can't tell which is which. Expected spread of a random quote?"12(2)+12(10)=6\tfrac12(2) + \tfrac12(10) = 6. Trivial with conditioning, murky without.
  • The two-envelope paradox is a cautionary tale: conditioning done sloppily ("the other envelope has 2x2x or x/2x/2, each with probability ½") smuggles in an improper prior and "proves" you should always switch. Diagnosing where that argument breaks — the conditional probabilities aren't ½ for any proper prior — is a genuinely strong interview answer.

The interview version

"A miner faces three doors: one exits in 2 hours; one loops back after 3 hours; one loops back after 5. He picks uniformly at random each time, with no memory. Expected time to exit?" — Condition on the first door: E=13(2)+13(3+E)+13(5+E)E = \tfrac13(2) + \tfrac13(3 + E) + \tfrac13(5 + E), so E=103+23EE = \tfrac{10}{3} + \tfrac23 E, giving E=10E = \mathbf{10} hours. One equation, because conditioning on the first choice resets the problem. When a question has stages, layers, or a "then" in it — condition first, compute second.