Posterior Probability of Gender Given Infection
A population is split evenly between men and women. A disease infects 3% of men but only 1% of women. You randomly select a person and discover they are infected.
What is the probability that the infected person is male?
Generalize: if the population has fraction $q$ male, men are infected at rate $p_M$, and women at rate $p_F$, derive $P(\text{Male} \mid \text{Infected})$.
Hints
- Think about how many infected men vs. infected women you'd expect in a concrete population of, say, 10,000.
- Use the law of total probability to compute the overall infection rate, then apply Bayes' theorem.
- Write $P(M \mid I) = \frac{P(I \mid M) P(M)}{P(I \mid M) P(M) + P(I \mid F) P(F)}$ and plug in the numbers.
Worked Solution
How to Think About It: Before doing any math, think about what your gut says. Men get infected at 3x the rate of women, and the population is 50-50. So among all infected people, men should be over-represented -- roughly 3 out of every 4 infected people should be male. That is your quick estimate: about 75%. Now let's confirm.
Quick Estimate: In a population of 10,000 (5,000 men, 5,000 women), about $5{,}000 \times 0.03 = 150$ men are infected and $5{,}000 \times 0.01 = 50$ women are infected. Total infected: 200. Fraction male: $150/200 = 0.75$. Done -- 75%.
Approach: Bayes' theorem with the law of total probability.
Formal Solution:
Define: - $P(M) = q$, $P(F) = 1 - q$ - $P(I \mid M) = p_M$, $P(I \mid F) = p_F$
By the law of total probability: $$P(I) = p_M \cdot q + p_F \cdot (1 - q)$$
By Bayes' theorem: $$P(M \mid I) = \frac{P(I \mid M) \cdot P(M)}{P(I)} = \frac{p_M \cdot q}{p_M \cdot q + p_F \cdot (1 - q)}$$
Plugging in $q = 0.5$, $p_M = 0.03$, $p_F = 0.01$: $$P(M \mid I) = \frac{0.03 \times 0.5}{0.03 \times 0.5 + 0.01 \times 0.5} = \frac{0.015}{0.02} = 0.75$$
Answer: $P(\text{Male} \mid \text{Infected}) = 0.75$. In general, $P(M \mid I) = \dfrac{p_M \cdot q}{p_M \cdot q + p_F(1 - q)}$.
Intuition
This is the most fundamental application of Bayes' theorem: flipping a conditional probability. You know the infection rate given gender, but you want the gender given infection status. The key insight is that even a moderate difference in conditional rates (3% vs. 1%) produces a dramatic shift in the posterior (75% vs. 25%) when the base rates are equal. In practice, this pattern shows up constantly -- in medical testing (disease prevalence vs. test accuracy), in trading (signal accuracy vs. base rate of profitable trades), and in fraud detection. The concrete counting approach ("imagine 10,000 people") is almost always the fastest way to get the answer in an interview and avoids formula errors.