SJMaths
MYP 4–5 · Extended Curriculum

Conditional Probability & Bayes' Rule

Update probabilities in light of new evidence. Study the conditional formula $P(A|B)$, extract conditional likelihoods from two-way contingency tables, verify event independence, and apply introductory Bayes' theorem to medical screening dilemmas.

4 Core Modules 10 Tiered Exercises 5 Self-Grading Quiz Items Criteria A, C & D Assessed
MYP Inquiry Framework
Key Concept Relationships
Related Concepts Dependence, Generalization, Evidence
Global Context Scientific and technical innovation (Diagnostic screening & Bayesian decision systems)
Statement of Inquiry Evaluating conditional likelihoods based on updated evidence reveals hidden dependent relationships in complex networks.
1

The Conditional Probability Concept & Formula

Conditional probability is the probability of an event $A$ occurring, given that another event $B$ has already occurred. The condition "given $B$" restricts the entire universe of outcomes exclusively to $B$.

The Conditional Probability Formula: $$P(A|B) = \frac{P(A \cap B)}{P(B)} \quad \text{provided } P(B) > 0$$ Using outcome counts directly from a restricted sample space: $$P(A|B) = \frac{n(A \cap B)}{n(B)}$$

Conceptual Distinction: $P(A \cap B)$ is the probability that both $A$ and $B$ happen out of the entire population $U$. In contrast, $P(A|B)$ is the probability that $A$ happens out of the restricted subset of elements that satisfy $B$.

2

The General Multiplication Rule & Testing Independence

Rearranging the conditional probability formula produces the fundamental multiplication rule for any pair of events.

The General Multiplication Rule: $$P(A \cap B) = P(B) \times P(A|B) = P(A) \times P(B|A)$$
Formal Mathematical Criteria for Independence:
Events $A$ and $B$ are statistically independent if and only if any one of the following equivalent statements holds:
  1. $P(A|B) = P(A)$ (knowing $B$ occurred does not change the probability of $A$)
  2. $P(B|A) = P(B)$ (knowing $A$ occurred does not change the probability of $B$)
  3. $P(A \cap B) = P(A) \times P(B)$
If $P(A|B) \neq P(A)$, the events are dependent.
3

Extracting Conditional Probabilities from Contingency Tables

Contingency tables provide the most straightforward visual method for calculating conditional probabilities without formula errors.

Contingency Table Probability Types:
Swipe or scroll horizontally to view every column.
Probability Query Numerator Denominator
Joint: $P(A \cap B)$ Intersection cell $n(A \cap B)$ Grand Total $N$
Marginal: $P(B)$ Column Total for $B$ Grand Total $N$
Conditional: $P(A|B)$ Intersection cell $n(A \cap B)$ Column Total for $B$ (NOT Grand Total!)
4

The Law of Total Probability & Bayes' Theorem (Medical Screening)

Bayes' Theorem reverses the direction of conditioning: it calculates $P(\text{Cause}|\text{Effect})$ from knowledge of $P(\text{Effect}|\text{Cause})$.

The Law of Total Probability:
If the population is divided into two mutually exclusive groups $D$ (Disease) and $D'$ (Healthy): $$P(T^+) = P(D) \times P(T^+|D) + P(D') \times P(T^+|D')$$
Bayes' Theorem: $$P(D|T^+) = \frac{P(D \cap T^+)}{P(T^+)} = \frac{P(D) \times P(T^+|D)}{P(D)P(T^+|D) + P(D')P(T^+|D')}$$ where $P(D|T^+)$ is the positive predictive value: the probability a patient actually has the disease given that their test came back positive.
Disease (1%) Healthy (99%) Test + (95%) True Pos: 0.0095 False Neg: 0.0005 Test + (5%) False Pos: 0.0495 True Neg: 0.9405

Medical screening tree: In rare conditions ($1\%$), false positives ($0.0495$) outnumber true positives ($0.0095$).

Worked Example 1: Contingency Table Conditional Analysis

A survey of 150 drivers classified their vehicle type (Electric vs. Petrol) and accident history over the past 5 years:

Swipe or scroll horizontally to view every column.
Vehicle type and accident history for 150 drivers
Vehicle Accident ($A$) No Accident ($A'$) Total
Electric ($E$) $12$$48$$60$
Petrol ($P$) $27$$63$$90$
Total $39$$111$$150$

a) Find the probability that a randomly chosen driver drives an Electric vehicle: $P(E)$.
b) Find the probability that a driver had an accident given that they drive an Electric vehicle: $P(A|E)$.
c) Find the probability that an accident driver drove an Electric vehicle: $P(E|A)$.
d) Determine mathematically whether driving an Electric vehicle and having an accident are independent.

Step-by-step Solution:

Part a: Marginal probability $P(E)$
$P(E) = \frac{\text{Total Electric}}{\text{Grand Total}} = \frac{60}{150} = \frac{2}{5} = 0.40$. [A1]

Part b: Conditional $P(A|E)$
Restrict sample space to Electric drivers ($n(E) = 60$): [M1]
$P(A|E) = \frac{n(A \cap E)}{n(E)} = \frac{12}{60} = \frac{1}{5} = 0.20$ ($20\%$). [A1]

Part c: Conditional $P(E|A)$
Restrict sample space to drivers who had an accident ($n(A) = 39$): [M1]
$P(E|A) = \frac{n(E \cap A)}{n(A)} = \frac{12}{39} = \frac{4}{13} \approx 0.308$ ($30.8\%$). [A1]

Part d: Test for independence
Overall accident probability $P(A) = \frac{39}{150} = 0.26$.
Since $P(A|E) = 0.20 \neq P(A) = 0.26$, knowing that a driver has an electric car lowers the probability of an accident from $26\%$ to $20\%$. Therefore, driving an electric car and having an accident are dependent events. [Criterion A & C: Analysis & Communication]

Worked Example 2: Bayesian Medical Screening (False Positives)

A rare medical condition affects $1\%$ of a population. A diagnostic blood test has:
- Sensitivity: $96\%$ (if a person has the condition, the test is positive with probability $0.96$).
- Specificity: $95\%$ (if a person does not have the condition, the test is negative with probability $0.95$).
A patient tests positive. Calculate the probability that the patient actually has the condition: $P(\text{Condition}|\text{Positive})$.

Step-by-step Solution:

Let $C$ be Condition, $C'$ be Healthy, and $T^+$ be Positive Test.
Given: $P(C) = 0.01$, $P(C') = 0.99$.
$P(T^+|C) = 0.96$, and $P(T^+|C') = 1 - 0.95 = 0.05$ (False positive rate). [M1]

Step 1: Total Probability of testing Positive $P(T^+)$
$P(T^+) = P(C \cap T^+) + P(C' \cap T^+)$
$P(T^+) = (0.01 \times 0.96) + (0.99 \times 0.05) = 0.0096 + 0.0495 = 0.0591$. [M1][A1]

Step 2: Bayes' Theorem for $P(C|T^+)$
$$P(C|T^+) = \frac{P(C \cap T^+)}{P(T^+)} = \frac{0.0096}{0.0591} \approx 0.1624 = 16.2\%$$ Even with a $96\%$ accurate test, a person who tests positive has only a $16.2\%$ chance of actually having the condition because the false positives from the large healthy population ($0.0495$) dwarf the true positives from the small sick population ($0.0096$). [Criterion D: Real-World Evaluation]

Tiered Practice Exercises

10 problems advancing from basic $P(A|B)$ formula substitution and contingency tables to multi-stage tree diagrams, independence proofs, and Bayesian probability modelling.

Tier 1: Standard Exercise 1

Given $P(A \cap B) = 0.18$ and $P(B) = 0.45$, find $P(A|B)$.

View Solution & Markscheme

Method & Marks:

Formula: $P(A|B) = \frac{P(A \cap B)}{P(B)}$ [M1]
$P(A|B) = \frac{0.18}{0.45} = \frac{2}{5} = 0.40$. [A1]

Tier 1: Standard Exercise 2

A fair 6-sided die is rolled. Find the probability of rolling a 2, given that the number rolled is even.

View Solution & Markscheme

Method & Marks:

Condition $B = \text{Even} = \{2, 4, 6\}$, so $n(B) = 3$. [M1]
Favorable outcome $A \cap B = \{2\}$, so $n(A \cap B) = 1$.
$P(2|\text{Even}) = \frac{1}{3}$. [A1]

Tier 1: Standard Exercise 3

A standard card deck has 52 cards. A card is drawn. Given that the card is a Red card, what is the probability that it is a Queen?

View Solution & Markscheme

Method & Marks:

Total Red cards $n(\text{Red}) = 26$. [M1]
Red Queens $n(\text{Queen} \cap \text{Red}) = 2$ (Queen of Hearts and Queen of Diamonds).
$P(\text{Queen}|\text{Red}) = \frac{2}{26} = \frac{1}{13}$. [A1]

Tier 2: Intermediate Exercise 4

In a school of 100 students, 60 study Chemistry, 45 study Physics, and 25 study both. A student is selected at random.
a) Given that the student studies Chemistry, what is the probability they study Physics?
b) Given that the student studies Physics, what is the probability they study Chemistry?

View Solution & Markscheme

Method & Marks:

a) $P(\text{Physics}|\text{Chemistry}) = \frac{n(\text{Both})}{n(\text{Chemistry})} = \frac{25}{60} = \frac{5}{12} \approx 0.417$. [A1]
b) $P(\text{Chemistry}|\text{Physics}) = \frac{n(\text{Both})}{n(\text{Physics})} = \frac{25}{45} = \frac{5}{9} \approx 0.556$. [A1]

Tier 2: Intermediate Exercise 5

Events $X$ and $Y$ satisfy $P(X) = 0.5$, $P(Y) = 0.3$, and $P(X \cup Y) = 0.65$.
a) Calculate $P(X \cap Y)$.
b) Calculate $P(X|Y)$ and $P(Y|X)$.
c) Determine whether $X$ and $Y$ are independent.

View Solution & Markscheme

Method & Marks:

a) $P(X \cap Y) = P(X) + P(Y) - P(X \cup Y) = 0.5 + 0.3 - 0.65 = 0.15$. [M1][A1]
b) $P(X|Y) = \frac{0.15}{0.3} = 0.50$. [A1]
$P(Y|X) = \frac{0.15}{0.5} = 0.30$. [A1]
c) Notice $P(X|Y) = 0.50 = P(X)$, and $P(X \cap Y) = 0.15 = 0.5 \times 0.3 = P(X)P(Y)$.
Therefore, events $X$ and $Y$ are independent. [R1]

Tier 2: Intermediate Exercise 6

A factory has two machines producing ceramic mugs: Machine A produces $60\%$ of the mugs with a defect rate of $2\%$, while Machine B produces $40\%$ with a defect rate of $5\%$.
a) Find the probability that a randomly chosen mug is defective.
b) If a mug is found to be defective, find the probability that it was produced by Machine B.

View Solution & Markscheme

Method & Marks:

a) Total Probability of Defect ($D$): [M1]
$P(D) = P(A)P(D|A) + P(B)P(D|B) = (0.60 \times 0.02) + (0.40 \times 0.05) = 0.012 + 0.020 = 0.032$ ($3.2\%$). [A1]
b) Bayes' Rule for $P(B|D)$: [M1]
$P(B|D) = \frac{P(B \cap D)}{P(D)} = \frac{0.020}{0.032} = \frac{20}{32} = \frac{5}{8} = 0.625$ ($62.5\%$). [A1]

Tier 2: Intermediate Exercise 7

The weather forecast states that the probability of rain tomorrow is $0.4$. If it rains, the probability of heavy traffic is $0.8$. If it does not rain, the probability of heavy traffic is $0.3$.
a) Draw a probability tree diagram for this scenario.
b) What is the probability that there is heavy traffic tomorrow?
c) Given that there is heavy traffic, what is the probability that it rained?

View Solution & Markscheme

Method & Marks:

b) Total Probability of Traffic ($T$):
$P(T) = P(R)P(T|R) + P(R')P(T|R') = (0.4 \times 0.8) + (0.6 \times 0.3) = 0.32 + 0.18 = 0.50$. [M1][A1]
c) Conditional $P(R|T)$:
$P(R|T) = \frac{P(R \cap T)}{P(T)} = \frac{0.32}{0.50} = \frac{32}{50} = 0.64$ ($64\%$). [A1]

Tier 3: Extended Exercise 8

For any two events $A$ and $B$ where $P(B) > 0$, prove algebraically that: $$P(A'|B) = 1 - P(A|B)$$

View Solution & Markscheme

Method & Marks:

Within the sample space of event $B$, $B = (A \cap B) \cup (A' \cap B)$, and $(A \cap B)$ and $(A' \cap B)$ are mutually exclusive. [M1]
Therefore, $P(B) = P(A \cap B) + P(A' \cap B)$. [M1]
Divide the entire equation by $P(B)$: $$\frac{P(B)}{P(B)} = \frac{P(A \cap B)}{P(B)} + \frac{P(A' \cap B)}{P(B)}$$ $$1 = P(A|B) + P(A'|B)$$ $$P(A'|B) = 1 - P(A|B). \quad \blacksquare$$ [A1][R1]

Tier 3: Extended Exercise 9

An insurance company models driver risk: $20\%$ are high-risk drivers with an annual accident probability of $0.25$, and $80\%$ are low-risk drivers with an annual accident probability of $0.05$.
a) Find the probability that a randomly chosen driver has an accident in their first year.
b) A new customer has an accident in their first year. Find the probability that they belong to the high-risk category.
c) Assuming consecutive years are conditionally independent for a given driver type, find the probability that a customer has an accident in year 2 given that they had an accident in year 1.

View Solution & Markscheme

Method & Marks:

a) $P(A_1) = (0.20 \times 0.25) + (0.80 \times 0.05) = 0.05 + 0.04 = 0.09$ ($9\%$). [M1][A1]
b) $P(H|A_1) = \frac{P(H \cap A_1)}{P(A_1)} = \frac{0.05}{0.09} = \frac{5}{9} \approx 0.556$ ($55.6\%$). [A1]
c) $P(A_1 \cap A_2) = (0.20 \times 0.25^2) + (0.80 \times 0.05^2) = 0.20(0.0625) + 0.80(0.0025) = 0.0125 + 0.002 = 0.0145$. [M1]
$P(A_2|A_1) = \frac{P(A_1 \cap A_2)}{P(A_1)} = \frac{0.0145}{0.09} = \frac{145}{900} = \frac{29}{180} \approx 0.161$ ($16.1\%$). [A1][R1]

Tier 3: Extended Exercise 10

Criterion C & D Investigation on The Prosecutor's Fallacy: In a criminal trial, DNA evidence from the crime scene matches the suspect. An expert witness testifies: "The probability that an innocent person's DNA matches this profile by chance is 1 in 100,000. Therefore, there is a 99.999% chance that the suspect is guilty."
a) Define the Prosecutor's Fallacy by identifying which conditional probability the expert stated versus which conditional probability the expert concluded.
b) If the crime occurred in a metropolitan area of $1{,}000{,}000$ people and there is no other evidence, calculate the expected number of innocent people whose DNA matches the profile.
c) Evaluate the true probability that the suspect is guilty, assuming every person in the city was equally likely to have committed the crime.

View Solution & Markscheme

Method & Marks:

Part a: Fallacy Analysis: The expert stated $P(\text{Match}|\text{Innocent}) = \frac{1}{100{,}000}$, but incorrectly concluded that $P(\text{Innocent}|\text{Match}) = \frac{1}{100{,}000}$ (or $P(\text{Guilty}|\text{Match}) = 99.999\%$). Transposing the condition ($P(A|B) \ne P(B|A)$) is the classic Prosecutor's Fallacy. [R1: Criterion C]
Part b: Expected innocent matches: In a city of $1{,}000{,}000$, with $1$ guilty person and $999{,}999$ innocent people: expected false positive matches $= 999{,}999 \times \frac{1}{100{,}000} \approx 10\text{ innocent people}$. [M1][A1]
Part c: True probability of guilt: Total people matching the profile $= 1 \text{ (guilty)} + 10 \text{ (innocent)} = 11\text{ people}$.
$P(\text{Guilty}|\text{Match}) = \frac{1}{11} \approx 9.09\%$.
Far from being $99.999\%$ certain, the suspect has only an approximately $9\%$ chance of being guilty without corroborating evidence! [A1][R1: Criterion D Reflection]

Conditional Probability Quick Reference

Conditional Definition

$$P(A|B) = \frac{P(A \cap B)}{P(B)}$$

Sample space restricted to $B$.

General Multiplication

$$P(A \cap B) = P(B) \times P(A|B)$$

Applies to any two events.

Independence Test

$$P(A|B) = P(A) \iff P(A \cap B) = P(A)P(B)$$

Condition does not affect chance.

Total Probability

$$P(A) = P(B)P(A|B) + P(B')P(A|B')$$

Weighted partition sum.

Bayes' Rule

$$P(B|A) = \frac{P(B)P(A|B)}{P(A)}$$

Inverse conditional probability.

Conditional Complement

$$P(A'|B) = 1 - P(A|B)$$

Complements within condition $B$.

Top 5 Common MYP Conditional Pitfalls

  • Confusing $P(A|B)$ with $P(B|A)$: Order matters profoundly! $P(\text{Cloudy}|\text{Rain}) \approx 1.0$ (it is almost certainly cloudy if it rains), but $P(\text{Rain}|\text{Cloudy}) \approx 0.3$ (most cloudy days don't rain).
  • Dividing by Grand Total Instead of the Condition: When computing $P(A|B)$ from a two-way table, the denominator must be the column or row total for $B$, NOT the grand total $N$.
  • The Prosecutor's Fallacy: Do not confuse the rarity of evidence given innocence ($P(\text{Match}|\text{Innocent})$) with the probability of innocence given a match ($P(\text{Innocent}|\text{Match})$). In large populations, rare events produce false positive clusters.
  • Assuming $P(A|B) = P(A \cap B)$: $P(A \cap B)$ is the probability that both occur out of the full population; $P(A|B)$ scales this up by dividing by $P(B)$.
  • Mistaking Mutually Exclusive for Independent: If two non-impossible events are mutually exclusive ($P(A \cap B) = 0$), they are NEVER independent! Knowing $B$ occurred means $A$ is impossible ($P(A|B) = 0 \ne P(A)$).

Self-Grading Mini Test

5 quiz questions on conditional probability, contingency tables, and independence.

Question 1 of 5 Conditional Formula

If $P(A \cap B) = 0.15$ and $P(B) = 0.50$, what is $P(A|B)$?

Question 2 of 5 Independence Condition

If events $A$ and $B$ are independent, which of the following is always true?

Question 3 of 5 Die Roll Conditional

A standard die is rolled. What is the probability that the number is greater than 3, given that it is odd?

Question 4 of 5 Contingency Table Conditional

In a group of 80 people, 30 are vegetarians, and 12 of the vegetarians are male. If a person is chosen at random and found to be vegetarian, what is the probability they are male?

Question 5 of 5 Multiplication Rule

If $P(B) = 0.4$ and $P(A|B) = 0.7$, what is $P(A \cap B)$?