Reasoning with evidence

Conditional Probability and Bayes Rule

Use conditional probability and Bayes rule to update beliefs from new evidence, while handling base rates carefully so test results are interpreted correctly.

How this page is maintained

Written for learners, checked against the sources below, and reviewed every year. Last reviewed July 22, 2026.

Short answer

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.

  1. Let D = defective and F = flagged. Set P(D)=0.04, P(F|D)=0.90, P(F|D^c)=0.08.
  2. 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.
  3. Apply Bayes: P(D|F)=P(F|D)P(D)/P(F)=0.036/0.1128.
  4. Calculate the posterior probability numerically.
Result: P(D|F)=0.319, so about 31.9% of flagged items are truly defective.

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

Learn this with a tutor

Tell LearnLive what you already know and what you need to do with conditional and bayes.

Build this course