ASSIGN

Conditional probability and Bayes

Use conditional probability and Bayes’ theorem while keeping the direction of conditioning clear.

  • AA HL
  • Bayes' theorem
  • Papers 1 and 2
  • GDC optional
  • About 20 min

By the end of this lesson

  • calculate conditional probabilities from tables and trees
  • test independence
  • use total probability and Bayes’ theorem to reverse a condition

Why this matters. New evidence changes the relevant sample space. Most errors come from using the right numbers in the wrong direction.

Restrict the sample space

$P(A\mid B)$ means the probability of $A$ among outcomes where $B$ has occurred.

$$P(A\mid B)=\frac{P(A\cap B)}{P(B)},\qquad P(B)>0.$$

Independence means the condition does not change the probability: $P(A\mid B)=P(A)$, equivalently $P(A\cap B)=P(A)P(B)$.

Machine and defect probability treeA probability tree branches first into machine A with probability 0.6 and machine B with probability 0.4, then into defective and not defective outcomes. Defect rates are 0.02 for A and 0.05 for B.0.60.4AB0.020.980.050.95defectivenot defectivedefectivenot defective
Multiply along a branch. Add mutually exclusive branches that lead to the same final event.

Checkpoint

In $P(A\mid D)$, which event defines the reduced sample space?
Show explanation

The event after the conditioning bar is known to have happened.

Example 1

Read a table conditionally

Condition on a row total

In a group of $120$ students, $50$ study physics, and $18$ of those physics students also study art. Find $P(\text{art}\mid\text{physics})$.

$$P(A\mid P)=\frac{18}{50}=0.36.$$

The denominator is $50$, not $120$, because physics is the condition.

Move forward through a tree

For the machine tree above, the total defective probability is

$$P(D)=0.6(0.02)+0.4(0.05)=0.032.$$

Checkpoint

A defective item is selected. Which numerator is needed for $P(B\mid D)$?
Show explanation

Bayes starts with the joint path that satisfies both B and defective.

Example 2

Reverse the condition

Which machine made it?

Using the tree, find the probability that a defective item came from machine B.

$$P(B\mid D)=\frac{P(B\cap D)}{P(D)}=\frac{0.4(0.05)}{0.032}=0.625.$$

A higher defect rate makes B more represented among defective items, even though B produces fewer items overall.

Why is this not $0.05$?

$0.05=P(D\mid B)$ is the forward defect rate within B. The question asks the reverse probability $P(B\mid D)$.

Test independence

Compare a joint probability with the product of marginals, or compare a conditional probability with its corresponding marginal.

Checkpoint

If $P(A)=0.4$, $P(B)=0.5$, and $P(A\cap B)=0.2$, what follows?
Show explanation

$P(A)P(B)=0.4(0.5)=0.2=P(A\cap B)$.

Example 3

Combine total probability and Bayes

A screening result

A condition affects $3\%$ of a population. A test is positive for $92\%$ of affected people and $6\%$ of unaffected people. Find $P(C\mid +)$.

$$P(+)=0.03(0.92)+0.97(0.06)=0.0858.$$
$$P(C\mid +)=\frac{0.03(0.92)}{0.0858}\approx0.322.$$

The positive predictive probability is not the same as the sensitivity $0.92$.

In the exam

Quick check

Five questions to check the main decisions from this lesson.

Your score is not saved.

  1. In $P(X\mid Y)$, what is known?
    Show explanation

    The event after the bar is the condition.

  2. Which gives $P(A\cap B)$?
    Show explanation

    Rearrange the conditional probability formula.

  3. Independent events satisfy…
    Show explanation

    This product rule characterizes independence.

  4. On a tree, probabilities along one complete path are…
    Show explanation

    A path describes an intersection of successive events.

  5. Why can a rare condition still have many false positives?
    Show explanation

    A small false-positive rate applied to a large group may outweigh true positives from a small group.

Lesson Rewards
1
Experience points earned for the lesson 5

Rate this lesson

Feedback submitted. Thank you for helping us improve!

Comments

Get another hint

Having trouble? Use a hint

Correct! View the step-by-step solution

ASSIGN