Conditional Probability

Statistics & Probability

Conditional probability is the probability of an event occurring given that another event has already occurred.

Formula

P(B|A) = \dfrac{P(A \text{ and } B)}{P(A)}
Visualization

Definition

Conditional probability is the chance that something happens given that we already know something else happened; the extra information changes the probability. The conditional probability of $B$ given $A$ is $P(B|A) = P(A \text{ and } B)/P(A)$, defined when $P(A) > 0$, representing the probability of $B$ in the restricted sample space where $A$ is known to have occurred; if $P(B|A) = P(B)$, the events are independent. Formally, conditional probability extends to conditional expectation $E[Y|X]$, a random variable equal to $E[Y|X=x]$ for each value $x$; the tower property $E[Y] = E[E[Y|X]]$ is fundamental in probability and statistics, and Bayes' theorem follows directly: $P(A|B) = P(B|A)P(A)/P(B)$.

Example

What is the probability of rolling a $4$ given that you already know the roll was even? The even outcomes are $\{2,4,6\}$, and only one is a $4$, so $P(4 \mid \text{even}) = 1/3$. From a class of $30$ where $18$ play sports, $12$ play music, and $6$ play both: $P(\text{music} \mid \text{sports}) = (6/30)/(18/30) = 1/3$, meaning among sports players, $1/3$ also play music. Bayes' theorem for medical diagnosis, $P(\text{disease} \mid \text{positive test}) = P(\text{positive} \mid \text{disease})P(\text{disease})/P(\text{positive})$, with prevalence $0.01$, sensitivity $0.95$, and specificity $0.90$, gives $P(\text{disease} \mid \text{positive}) = 0.95(0.01)/0.1085 = 0.0876$, only $8.76\%$ despite a positive test.

Key Insight

Conditional probability is about updating your prediction with new information; "given that..." is the key phrase that signals it, and two-way (contingency) tables are ideal for computing it: focus on the row or column corresponding to the given condition and treat it as a new sample space. The low base-rate paradox shows that even a highly accurate test has many false positives when the condition is rare, because the probability of a true positive is swamped by the large number of negatives in the population, with profound implications for medical screening programs.