Conditional probability asks how likely A is when B is known: P(A|B)=P(A and B)/P(B). Bayes rule reverses conditions: P(A|B)=P(B|A)P(A)/P(B), which combines prior probability with new evidence.
- Always define the condition first in P(A|B).
- Base rates matter, even when evidence looks strong.
- A table of counts often prevents Bayes mistakes.
Conditional probability in plain terms
P(A|B) means the probability of A inside the subset where B happened. The denominator changes from the whole sample space to only cases with B.
A two-way table turns this into arithmetic on counts. If 30 of 120 cases have B, and 18 of those also have A, then P(A|B)=18/30=0.60.
Bayes rule and base-rate effects
Bayes rule is useful when you know P(B|A) but need P(A|B). It combines how common A is initially (prior) with how strongly B is linked to A (likelihood).
Even with high sensitivity evidence, a rare event can still have low posterior probability. This is the base-rate effect, and it is easier to see with concrete counts.
- Write Bayes in words: posterior is proportional to likelihood times prior.
- Normalize by P(B) so probabilities sum correctly.
- Check denominators carefully, they are the most common error point.
Update belief after a quality screen
A factory line has 4% defective items. A screen flags a defective item 90% of the time and flags a good item 8% of the time.
- Let D = defective and F = flagged. Set P(D)=0.04, P(F|D)=0.90, P(F|D^c)=0.08.
- Compute P(F)=P(F|D)P(D)+P(F|D^c)P(D^c)=0.90*0.04+0.08*0.96=0.1128.
- Apply Bayes: P(D|F)=P(F|D)P(D)/P(F)=0.036/0.1128.
- Calculate the posterior probability numerically.
Common mistakes
- Swapping P(A|B) and P(B|A).
- Ignoring the prior probability P(A).
- Using percentages without converting them consistently to decimals.
- Forgetting to include both pathways when computing P(B).
Try one
Why can P(A|B) be low even when P(B|A) is high?
Because A may be rare. A small base rate can keep the posterior low after conditioning on B.
Sources
- OpenStax: Introductory StatisticsOpen textbook covering descriptive statistics, probability, inference, and regression fundamentals.
- Khan Academy: Statistics and probabilityClear instructional coverage of core statistics ideas with worked examples and practice.