← Math pathway
MATHEMATICAL UNIT M2

Conditional probability and Bayes' rule

Base rates and updating beliefs

45–70 minFirst-year extension

Objectives

Explain the formula, show each numerical step, and state its assumptions.

Mathematical reasoning

P(A|B)=P(A∩B)/P(B), for P(B)>0, is the chance of A conditional on B. P(positive|event) and P(event|positive) refer to different denominators.

Bayes' rule updates the prior P(H) with new evidence: P(H|+)=P(+|H)P(H)/[P(+|H)P(H)+P(+|not H)P(not H)].

For rare events, high sensitivity need not imply high positive predictive value. This is a feature of a fictional screening model, not diagnostic advice.

Key formula

P(H|+) = Se×Prev / [Se×Prev + (1−Sp)×(1−Prev)]

Worked example: step by step

  1. Assume fictional prevalence 1%, sensitivity 90%, specificity 95%.
  2. Of 10,000 people, 100 have the event; 90 true positives. Among 9,900 without it, 5%=495 false positives.
  3. There are 585 positive results, so P(event|positive)=90/585≈15.38%.

Independent exercises

  1. Calculate P(H|+) for prior 0.2, sensitivity 0.8, false-positive rate 0.1.
  2. If 20 of 500 people have an event, what is prevalence?
  3. Does P(A|B)=0.6 alone determine P(B|A)?

Optional base R check

Download the R script

prev <- 0.01; se <- 0.90; sp <- 0.95
ppv <- se*prev/(se*prev+(1-sp)*(1-prev))
ppv
# Fictional rates. Not a real medical test.

Quick knowledge check

1. Which quantity is P(event|positive)?
2. PPV with 90 true and 495 false positives?
3. What does prior mean?

Core lesson connection

Statistics module 4