Mathwords logoMathwords

Conditional Expectation — Definition, Formula & Example

Conditional expectation is the average value you expect a random variable to take once you know that some event has happened. It is the ordinary expected value, recalculated using only the outcomes that are still possible.

For a random variable XX and an event AA with P(A)>0P(A) > 0, the conditional expectation of XX given AA is E[X∣A]=E[X⋅1A]P(A)E[X \mid A] = \dfrac{E[X \cdot \mathbf{1}_A]}{P(A)}, where 1A\mathbf{1}_A equals 1 on AA and 0 otherwise. For a discrete random variable YY, E[X∣Y]E[X \mid Y] is the random variable g(Y)g(Y), where g(y)=E[X∣Y=y]g(y) = E[X \mid Y = y]. It satisfies the law of total expectation, E[E[X∣Y]]=E[X]E\big[E[X \mid Y]\big] = E[X].

Key Formula

E[X∣A]=∑xx⋅P(X=x∣A)E[X \mid A] = \sum_{x} x \cdot P(X = x \mid A)
Where:
  • XX = A discrete random variable
  • AA = The given event, with P(A) > 0
  • xx = Each possible value of X
  • P(X=x∣A)P(X = x \mid A) = The conditional probability that X equals x, given that A occurred

Worked Example

Problem: You roll two fair six-sided dice. Let SS be their sum. Given that the first die shows 4, what is the expected value of SS?
Step 1: Once the first die shows 4, the possible sums are 5 through 10. Each one comes from exactly one face of the second die. Divide each joint probability by the probability of the given event.
P(S=s∣first=4)=1/366/36=16,s=5,6,…,10P(S = s \mid \text{first} = 4) = \frac{1/36}{6/36} = \frac{1}{6}, \quad s = 5, 6, \dots, 10
Step 2: Multiply each possible sum by its conditional probability, then add the products.
E[S∣first=4]=5+6+7+8+9+106=456=7.5E[S \mid \text{first} = 4] = \frac{5 + 6 + 7 + 8 + 9 + 10}{6} = \frac{45}{6} = 7.5
Step 3: Compare with the unconditional mean. Without any information, each die averages 3.5, so the sum averages 7.
E[S]=3.5+3.5=7E[S] = 3.5 + 3.5 = 7
Answer: E[S∣first=4]=7.5E[S \mid \text{first} = 4] = 7.5. This is 0.5 more than E[S]=7E[S] = 7 because the first die is fixed at 4, which is 0.5 above its average of 3.5. The second die still averages 3.5.

Why It Matters

In statistics, the regression function E[Y∣X=x]E[Y \mid X = x] is the best predictor of YY from XX in the mean-squared-error sense. Actuaries use conditional expectation to price insurance for specific risk groups. The law of total expectation lets you solve hard expected-value problems, such as the expected number of coin flips until two heads in a row, by first conditioning on the outcome of the first flip.

Common Mistakes

Mistake: Weighting the remaining outcomes by their original probabilities instead of their conditional probabilities. In the example, this gives 4536=1.25\frac{45}{36} = 1.25 instead of 7.5.
Correction: After you condition on AA, the probabilities of the outcomes inside AA must add to 1. Divide each one by P(A)P(A) before you multiply by the values.

Related Terms