Conditional Probability
& Expectation
Master the foundations of conditional probability and conditional expectation: how new information reshapes uncertainty and refines predictions.
What Is Conditional Probability?
Conditional probability measures the likelihood of an event given that another event has already occurred. It answers: "How does knowing \(B\) happened change the probability of \(A\)?"
The denominator restricts the sample space to outcomes where \(B\) occurs, and the numerator counts only those outcomes that also satisfy \(A\).
Visualizing \(P(A \mid B)\)
Why Conditioning Matters
Conditional probability is the backbone of Bayesian inference, decision theory, and virtually every applied statistics problem.
The Multiplication Rule
A natural extension to multiple events yields the chain rule:
This chain rule is central to modeling sequential processes such as Markov chains and language models.
Bayes' Theorem
Bayes' Theorem updates our prior belief \(P(A)\) using new evidence \(P(B \mid A)\) to produce a posterior \(P(A \mid B)\).
Law of Total Probability
The total probability of \(A\) is obtained by summing its conditional probability across each partition slice, weighted by that slice's probability.
Independence vs Dependence
| Independent | Dependent | |
|---|---|---|
| Definition | \(P(A \mid B) = P(A)\) | \(P(A \mid B) \neq P(A)\) |
| Joint prob. | \(P(A \cap B) = P(A)P(B)\) | \(P(A \cap B) = P(A \mid B)P(B)\) |
| Intuition | Knowing \(B\) tells nothing about \(A\) | Knowing \(B\) changes our belief about \(A\) |
| Example | Two fair coin flips | Drawing cards without replacement |
What Is Conditional Expectation?
Just as conditional probability restricts the sample space, conditional expectation computes the expected value of a random variable using a conditional distribution.
\(E[X \mid Y]\) is itself a random variable: it's a function of \(Y\) that gives the "best prediction" of \(X\) for each value of \(Y\).
The Tower Property
This is one of the most powerful tools in probability: it decomposes hard expectations into simpler conditional pieces.
How to Apply Conditional Reasoning
Example 1: Medical Test
A disease affects \(1\%\) of the population. A test has sensitivity \(95\%\) (true positive rate) and specificity \(90\%\) (true negative rate). What is \(P(\text{disease} \mid +)\)?
Example 2: Dice & Tower Property
Roll a fair die to get \(N\). Then flip \(N\) fair coins. Let \(X\) = number of heads. Find \(E[X]\).
The tower property turned a complex two-stage problem into a simple calculation.
Example 3: Eve's Law (Law of Total Variance)
Using the dice example (\(N\) = die roll, \(X\) = heads from \(N\) coins):
Common Mistakes
Summary of Key Formulas
| Concept | Formula | Key Idea |
|---|---|---|
| Conditional Prob. | \(P(A \mid B) = \frac{P(A \cap B)}{P(B)}\) | Restrict sample space |
| Multiplication Rule | \(P(A \cap B) = P(A \mid B)\,P(B)\) | Joint from conditional |
| Bayes' Theorem | \(P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}\) | Invert conditioning |
| Total Probability | \(P(A) = \sum_i P(A \mid B_i)\,P(B_i)\) | Marginalize over partition |
| Tower Property | \(E[X] = E[E[X \mid Y]]\) | Iterated expectation |
| Eve's Law | \(\text{Var}(X) = E[\text{Var}(X \mid Y)] + \text{Var}(E[X \mid Y])\) | Decompose variance |
Question 1 of 5
If \(P(A) = 0.3\), \(P(B) = 0.5\), and \(P(A \cap B) = 0.15\), what is \(P(A \mid B)\)?
Question 2 of 5
Events \(A\) and \(B\) are independent with \(P(A) = 0.4\) and \(P(B) = 0.6\). What is \(P(A \cap B)\)?
Question 3 of 5
A disease has prevalence \(P(D) = 0.02\). A test has \(P(+ \mid D) = 0.99\) and \(P(+ \mid D^c) = 0.05\). Approximately what is \(P(D \mid +)\)?
Question 4 of 5
You roll a fair die to get \(N\), then draw \(N\) balls from an urn (with replacement), each red with probability \(\frac{1}{3}\). Let \(X\) = number of red balls. Using the tower property, what is \(E[X]\)?
Question 5 of 5
Which of the following correctly states the Law of Total Variance?