Conditional Expectation
Average over a hidden quantity: .
What is it?
The tower property lets you compute by first fixing another variable , finding , and then averaging over .
Why is it useful?
Two-stage random experiments are everywhere in interviews: a random number of trials, a random parameter, a random coin.
When should you think of it?
Use it when the experiment has a first random stage that determines the rules of a second stage.
Think of this method when…
- A random count of trials (roll a die, then flip that many coins)
- A random parameter, such as a coin with unknown bias
- Easy answer if one variable were known
- Variance questions: law of total variance
Core idea
Condition on whatever makes the problem easy, then average the conditional answer.
Step-by-step playbook
- 1Pick the variable that simplifies things when known.
- 2Compute as a function of .
- 3Take the expectation of that function over .
Worked example
Worked example
Roll a fair die to get , then flip fair coins. What is the expected number of heads?
- 1
Given , the expected number of heads is , so .
- 2
Average over .
- Answer:
Common mistakes
- Plugging in inside a nonlinear function of .
- Forgetting the second term of the law of total variance.
Would you use this method?
A coin's bias is uniform on . What is the probability of heads on one flip?
Practice this method
12 QuantSolve questions are tagged with this method.
Practice this method