How to Calculate Conditional Probability

Calculates the probability that A happens given that B happened, P(A|B) = P(A∩B) ÷ P(B). It is the share of A within the world where B has occurred.

The conditional probability P(AB)P(A \mid B) is the chance that AA happens given that BB has happened.

P(AB)=P(AB)P(B)P(A \mid B) = \dfrac{P(A \cap B)}{P(B)}

Here P(AB)P(A \cap B) is the probability that AA and BB both occur.

The idea is to shrink the world down to BB. Treat the outcomes where BB happened as the new whole, and measure what fraction of them also contain AA.

Example

If P(AB)=0.2P(A \cap B) = 0.2 and P(B)=0.5P(B) = 0.5:

P(AB)=0.20.5=0.4P(A \mid B) = \dfrac{0.2}{0.5} = 0.4

Restricted to the cases where BB occurred, AA happens 40% of the time. Whatever the unconditional probability of AA was, learning that BB happened has updated it.

Independence

When P(AB)=P(A)P(A \mid B) = P(A), the events AA and BB are independent: knowing about BB tells you nothing about AA.

In that case P(AB)=P(A)P(B)P(A \cap B) = P(A)P(B), so the probabilities simply multiply. The converse is the trap: multiplying probabilities that are not independent gives the wrong answer.

Watch out