Conditional Probability and Bayes’ Theorem (DSE M1)

The conditional probability of A given B is P(A | B) = P(A ∩ B) / P(B). Bayes’ theorem reverses the condition: P(B | D) = P(B)P(D | B) / P(D), where P(D) is the total over every branch of a tree diagram that ends in D.

Solve Conditional Probability and Bayes’ Theorem questions with AI
GeoGebra tree diagram with branches for machine A 0.6 and machine B 0.4, then defective and not defective, used for Bayes theorem
The tree diagram for Example 1. The two red branches end in a defective item; machine B’s share of them is 0.020 / 0.032 = 0.625. Try it yourself →

Conditional Probability Formulas

Conditional probabilityP(A | B) = P(A ∩ B) / P(B)
Multiplication ruleP(A ∩ B) = P(A) P(B | A)
Total probabilityP(D) = P(A)P(D | A) + P(B)P(D | B)
Bayes’ theoremP(B | D) = P(B)P(D | B) / [P(A)P(D | A) + P(B)P(D | B)]
Independent eventsP(A ∩ B) = P(A)P(B) ⟺ P(A | B) = P(A)

Worked Examples — Conditional Probability and Bayes’ Theorem

Example 1: Bayes’ theorem with a tree diagram

A factory has two machines. Machine A makes 60% of the items and machine B makes 40%. 2% of the items from A and 5% of the items from B are defective. An item chosen at random is defective. Find the probability that it was made by machine B.

  1. P(A ∩ D) = 0.6 × 0.02 = 0.012
  2. P(B ∩ D) = 0.4 × 0.05 = 0.020
  3. P(D) = 0.012 + 0.020 = 0.032
  4. P(B | D) = 0.020 / 0.032 = 0.625

Answer: 0.625

Example 2: Testing whether two events are independent

Given P(A) = 0.5, P(B) = 0.4 and P(A ∪ B) = 0.7, determine whether A and B are independent.

  1. P(A ∩ B) = P(A) + P(B) − P(A ∪ B) = 0.5 + 0.4 − 0.7 = 0.2
  2. P(A) × P(B) = 0.5 × 0.4 = 0.2
  3. The two are equal, so A and B are independent.

Answer: Independent, since P(A ∩ B) = P(A)P(B).

💡 Exam Traps & Secrets

⚠️ P(B | D) is not P(D | B)In Example 1, P(D | B) = 0.05 but P(B | D) = 0.625. Read which event is known to have happened: that one goes after the bar and in the denominator.
⚠️ Independent is not mutually exclusiveMutually exclusive events cannot happen together, so P(A ∩ B) = 0. Independent events can; one simply does not change the probability of the other.

✏️ Self-Test: Quick Interactive Practice

How to study: Click any question below to instantly load it on the coordinate grid and check your steps.

(Bayes’ theorem)A test detects a disease with probability 0.95 and gives a false positive with probability 0.02. 1% of people have the disease. Find the probability that a person who tests positive has the disease.
(Tree diagram)Bag X has 3 red and 2 blue balls; bag Y has 1 red and 4 blue. A bag is chosen at random and a red ball is drawn. Find the probability it came from bag X.
(Independence)If A and B are independent with P(A) = 0.3 and P(B) = 0.6, find P(A ∪ B) and P(A′ ∩ B).

Frequently Asked Questions

Related Topics

Discrete Random Variables: Expectation and VarianceThe Binomial DistributionBinomial or Poisson? Choosing the DistributionDSE M1: all topicsDSE M1 formula sheetM1 vs M2DSE M2 notesHKDSE Math: all topics
Try a Conditional Probability and Bayes’ Theorem DSE Practice Question