Bayes' Theorem: Reversing a Conditional Probability | Analysis and Approaches IB Maths notes

Free preview: Bayes' Theorem: Reversing a Conditional Probability

Bayes' Theorem for Two Events

Analysis and approaches: HL only (AHL 4.13)

Let's start with a question you can already answer with a tree. A test for a disease is positive. How likely is it that the person really has the disease? The tree gives P(positive | disease), but we want it the other way round. Make a guess now: if the test catches 90% of cases, is the answer about 90%? Hold on to your guess.

What you already know

  • P(A∣B) means "the probability of A, given that B has happened".
  • The multiplication rule: P(A∩B)=P(B)P(A∣B). On a tree, you multiply along the branches.
  • B′ means "not B", and P(B′)=1−P(B).

Bayes' theorem

  • Bayes' theorem is a formula for reversing a conditional probability: it finds P(B | A) when you know P(A | B).
  • It is the same calculation you did on trees in the last note, written as one formula.
  • The IB asks for it with two events (B and B′) or three events (B₁, B₂, B₃).

Where the formula comes from

  1. Write P(A ∩ B) in two ways, using the multiplication rule: P(A∩B)=P(B)P(A∣B) and P(A∩B)=P(A)P(B∣A).
  2. Set them equal and divide by P(A): P(B∣A)=P(B)P(A∣B)P(A).
  3. Now P(A) itself comes from the two paths on a tree that end in A, one through B and one through B′: P(A)=P(B)P(A∣B)+P(B′)P(A∣B′).
  4. Put that on the bottom:

P(B∣A)=P(B)P(A∣B)P(B)P(A∣B)+P(B′)P(A∣B′)

💡 In plain words

  • Top: the one tree path that goes through B and ends in A.
  • Bottom: every path that ends in A (here, two of them).
  • B is the event that happens first (the cause). A is the event you observe (the evidence).
  • So the answer is: of all the ways to see the evidence, what fraction came through this cause?

The same thing on a tree

Here is the tree for the medical test below, written as a list of its four paths. Each path probability is the product of its two branches.

First branchSecond branchPath probabilityEnds in +?
D (0.01)+ (0.9)0.01×0.9=0.009yes
D (0.01)− (0.1)0.01×0.1=0.001no
D′ (0.99)+ (0.05)0.99×0.05=0.0495yes
D′ (0.99)− (0.95)0.99×0.95=0.9405no
  • Bayes' theorem only uses the paths that end in the evidence, +. The other two paths are ruled out by what we saw.
  • Check: the four path probabilities add to 1.

The recipe

  1. Name the events. B = the cause, A = the evidence. Why: the question asks for P(cause | evidence).
  2. Write down the four probabilities: P(B), P(B′), P(A | B), P(A | B′).
  3. Top: multiply along the path through B to A.
  4. Bottom: add the two paths that end in A.
  5. Divide, and ask whether the answer makes sense.

👀 Watch me do it: 1% of a population has a disease D. A test is positive (+) for 90% of people with the disease and for 5% of people without it. Find P(D | +)

What I writeWhy I do it
Cause: D. Evidence: +. Want P(D∣+)Step 1: name the events.
P(D) = 0.01, P(D′) = 0.99, P(+ | D) = 0.9, P(+ | D′) = 0.05Step 2: "5% of people without it" is P(+ | D′).
Top: P(D)P(+∣D)=0.01×0.9=0.009Step 3: the path through D.
Bottom: 0.009+0.99×0.05=0.009+0.0495=0.0585Step 4: both paths that end in +.
P(D∣+)=0.0090.0585=213=0.154 (3 s.f.)Step 5: divide.
Only about 15%! Much smaller than the guess of 90%.Sense check on the next line.
  • Why so small? The disease is rare, so the 5% false positives from the huge healthy group outnumber the true positives.
  • This is why Bayes' theorem matters: our instincts get these questions badly wrong.

✏️ YOUR TURN 1

Try this first:

2% of parts from a factory are faulty. A detector flags 95% of faulty parts and 10% of good parts. A part is flagged. Find the probability that it is faulty.

Answer:

Unlock the full note: start 7 days free.

Log in or subscribe to read the rest of this note. Members also get the AI tutor, practice quizzes, mock exams and flashcards for this topic.

Log in · Subscribe · Start free trial

All notes in Probability (SL 4.5, 4.6, 4.11; AHL 4.13)

  1. Sample Spaces, Venn Diagrams and Set Notation in Probability
  2. Mutually Exclusive and Independent Events with Tree Diagrams
  3. Conditional Probability: The Formula, Venn Diagrams and Two-Way Tables
  4. Conditional Probability on Tree Diagrams and Testing for Independence
  5. Bayes' Theorem: Reversing a Conditional Probability

What's inside for this topic

5 teacher notes, 71 practice questions, 38 flashcards, 2 quizzes.

Get the full notes, every practice question, flashcards, quizzes and mock papers.

Start your free 7-day trial

Questions? Chat with us on WhatsApp · Try one live lesson

Previous note: Conditional Probability on Tree Diagrams and Testing for Independence

All Analysis and Approaches IB Maths topics · IB Maths