The Law of Total Probability for Random Variables
You'll learn how to compute unconditional probabilities and expectations by cleverly conditioning on another variable and then "averaging out" over all its possibilities.
The Core Idea
Imagine you want to find the overall expected value of some random variable (Y), but it's complicated to compute directly. The Law of Total Probability (also called the Law of Total Expectation when dealing with expectations) says you can break this problem into simpler pieces by conditioning on another variable (X).
Here's the magic formula:
In words: The unconditional expectation of (Y) equals the expectation of the conditional expectation of (Y) given (X).
Think of it like this: First, compute (E[Y|X=x]) for each possible value of (x). This gives you a function of (x). Then take the expectation of that function with respect to (X)'s distribution—essentially a weighted average where weights come from the marginal distribution of (X).
Why This Works
You're partitioning the sample space based on the values of (X). Within each partition, you compute the expected value of (Y). Then you average these conditional expectations according to how likely each partition is.
For discrete (X):
For continuous (X):
This extends to probabilities too: (P(Y \in A) = E[P(Y \in A | X)]).
Key Takeaway: The Law of Total Probability lets you compute hard-to-find unconditional quantities by conditioning on a helpful variable and then integrating/summing over its marginal distribution.