Fill in a two-way table of counts, or enter the probabilities, and get P(A | B) spelled out in words, along with the reverse P(B | A) that's so easily confused with it.
P(A | B) = P(A and B) ÷ P(B)
| A | not A | |
|---|---|---|
| B | ||
| not B |
Rows split by B, columns by A. Name the events to have the answer written out in your words.
Conditional probability is the chance of one event once you already know another has happened. P(A | B), read "the probability of A given B", narrows attention to the cases where B happened and asks how often A happens among them.
The everyday version is a sentence starting "Of the…". "Of the smokers, 15% have the condition" is P(condition | smoker). The group after "of the" is B, and it goes on the bottom of the fraction.
The direction matters enormously. P(A | B) and P(B | A) share the same top line but divide by different groups, so they can be wildly different. Swapping them is one of the most common errors in medicine, law and the news.
Definition as given in OpenStax Introductory Statistics, chapter 3. See Sources.
Read along the B row: the cell where both happen, over the row total.
Same 30 people on top, different group underneath. A doctor asking "how worried should this smoker be?" wants the 15%. A researcher asking "what do our patients have in common?" is looking at the 60%.
Most questions never say "given". Find the group the question has already narrowed you down to: that's B.
| The question says | Write it as |
|---|---|
| “What percentage of smokers have the condition?” | P(condition | smoker) |
| “Among people with the condition, how many smoke?” | P(smoker | condition) |
| “If a student passed, what’s the chance they revised?” | P(revised | passed) |
| “A card is red. What’s the chance it’s a heart?” | P(heart | red) = 13/26 |
| “What’s the chance a person smokes and has the condition?” | Not conditional: P(smoker and condition) |
“The probability of A given B.” The vertical bar means “given”, and whatever comes after it is what you already know.
Only when P(A) = P(B). The more different the two events are in how common they are, the further apart the two conditional probabilities.
Compare P(A | B) with P(A | not B). If they’re the same, knowing B tells you nothing about A. In the example, 15% against 2.5% shows a strong link.
With survey data, small gaps can be chance. A chi-square test on the same two-way table tells you whether the gap is bigger than chance would explain.
Then P(A | B) is undefined: you can’t ask what happens in cases that never occur.
Yes. 0.2, 20% and 1/5 all work.
Bayes’ theorem turns P(B | A) into P(A | B) using the base rates: P(A | B) = P(B | A) × P(A) ÷ P(B).
Naming A and B turns the result into a plain sentence, which makes it much harder to mix up the two directions.
Related Tools
Basic probability calculations.
P(A and B) calculations.
Three event probabilities.
Conditional probability.
Probability-weighted average.
Decision theory.