Class 12 NCERT Ch 13: Probability (Ex 13.3 (Bayes’ Theorem & Total Probability)) Probability • CBSE • ICSE • State Boards

Bayes' Theorem: Rare Event Detective & Medical Screening Lab

Overcome the prosecutor's fallacy and base rate neglect. Explore Bayes' Theorem by simulating medical diagnostic testing for a rare disease in a population of 100,000 individuals. Adjust disease prevalence, test sensitivity, and test specificity to discover why a positive test result often means less than a 50% chance of actually having the disease.

🎯 Learning Objectives

  • Master Bayes' Theorem formula for updating prior probabilities into posterior probabilities given evidence.
  • Overcome Base Rate Neglect: understand why rare diseases (low prevalence) generate overwhelming false positive numbers.
  • Distinguish between Sensitivity (True Positive Rate P(+|D)) and Specificity (True Negative Rate P(-|~D)).
  • Calculate Positive Predictive Value (PPV): P(D|+) = [P(+|D)·P(D)] / P(+).

📐 Governing Mathematical Laws & Formulas

P(A_i | B) = \frac{P(B | A_i) P(A_i)}{P(B)} = \frac{P(B | A_i) P(A_i)}{\sum_{j=1}^n P(B | A_j) P(A_j)}

Bayes' Theorem Statement

Calculates conditional probability of hypothesis H given observed evidence E.

P(H|E) = \frac{P(E|H) \cdot P(H)}{P(E)} = \frac{P(E|H) \cdot P(H)}{P(E|H)P(H) + P(E|\neg H)P(\neg H)}

Positive Predictive Value (PPV) in Screening

The probability that a patient with a positive test result actually has the disease.

P(\text{Disease}|+) = \frac{\text{Sensitivity} \times \text{Prevalence}}{(\text{Sensitivity} \times \text{Prevalence}) + (1 - \text{Specificity}) \times (1 - \text{Prevalence})}

Geometric & First-Principle Intuition

Bayes' Theorem updates the probability of an event (hypothesis A) based on new evidence (event B): (1) Prior Probability P(A): the initial baseline belief before any test is performed (the base rate). (2) Likelihood P(B|A): the probability of observing the evidence given that the hypothesis is true (test sensitivity). (3) Law of Total Probability: P(B) = P(B|A)·P(A) + P(B|A′)·P(A′), which accounts for evidence coming from both true cases and false alarms. (4) Posterior Probability P(A|B): the updated belief after observing evidence: P(A|B) = [P(B|A)·P(A)] / P(B). When a condition is rare (P(A) << 1), even an accurate test produces many false positives.

🎛️ Simulator Controls & Input Parameters

Disease Prevalence Slider [P(D)] slider
Range: 0.1% to 10.0% (logarithmic option)

Sets how common the disease is in the general population.

Effect: Modulates the prior probability base rate.
Test Sensitivity Slider [P(+|D)] slider
Range: 80.0% to 99.9%

The probability that the test correctly identifies an infected patient.

Effect: Sets true positive rate.
Test Specificity Slider [P(-|~D)] slider
Range: 80.0% to 99.9%

The probability that the test correctly clears a healthy patient.

Effect: Sets false positive rate (1 - Specificity).
Population Grid View Toggle (10,000 Icons) toggle

Renders a grid of 10,000 individual human icons colored green (healthy) and red (infected).

Effect: Provides natural frequency visual proof of Bayes' theorem.

📋 Step-by-Step Instructions for Using the Simulator

  1. Set Prevalence = 1.0% (1 in 100 people), Sensitivity = 95%, and Specificity = 95% in a sample of 10,000 people.
  2. Examine the population breakdown: 100 people have the disease, and 9,900 people are healthy.
  3. Of the 100 sick people, 95 test positive (True Positives).
  4. Of the 9,900 healthy people, 5% falsely test positive: 0.05 × 9,900 = 495 people (False Positives)!
  5. Notice that the total positive tests are 95 + 495 = 590. The probability of actually having the disease given a positive test is 95 / 590 ≈ 16.1%, surprising most students who expected 95%!

📊 Expected Output & Visual Invariants

Interactive 2x2 confusion matrix contingency table, 10,000-person icon dot array, Sankey flow diagram showing probability mass branching, and dynamic posterior probability gauge.

Real-World STEM Application • Epidemiology, Machine Learning & Spam Detection

How Professionals Use This Mathematical Concept

Used in medical diagnostic screening protocols (mammography, COVID-19 rapid tests), Naive Bayes email spam filters, and fraud detection algorithms in banking.

Practical Example: Email spam filters evaluate Bayes' rule P(Spam|words) by updating the prior probability of an email being spam based on the frequency of trigger words like "winner" or "urgent".

Alka Ma'am's Exam Shortcut

The Natural Frequencies Hack: Never calculate Bayes' theorem with decimals in your head! Out of 1,000 people: 20 are sick (2%), 980 are healthy. 95% of 20 sick = 19 test positive. 5% of 980 healthy = 49 false positives. Total positive tests = 19 + 49 = 68. Probability you are sick = 19 / 68 ≈ 27.9%! Solved in 10 seconds without memorizing formulas!

Common Textbook Trap

Students confuse conditional probability directions: P(Test Positive | Sick) is NOT equal to P(Sick | Test Positive). When the disease is rare, false positives from the large healthy population dwarf the true positives!

CBSE Class 12 Board Exam (6 Marks)

CBSE 6-Mark Exam Classic: The Three Factory Machines

A factory has three machines A, B, and C producing 50%, 30%, and 20% of the total bolts respectively. Of their total output, 2%, 3%, and 4% are defective bolts. A bolt is drawn at random and found to be defective. What is the probability that it was manufactured by machine B?

  1. Define Events and State Prior Probabilities: Let E₁, E₂, E₃ be the events that the bolt was produced by Machine A, B, C. Let D be the event that the bolt is defective:
    P(E_1) = 0.50, \quad P(E_2) = 0.30, \quad P(E_3) = 0.20
  2. State Conditional Probabilities (Defect Rates): The defect rates for each machine are given:
    P(D|E_1) = 0.02, \quad P(D|E_2) = 0.03, \quad P(D|E_3) = 0.04
  3. Calculate Total Probability of Drawing a Defective Bolt P(D): By the Law of Total Probability: P(D) = P(E₁)P(D|E₁) + P(E₂)P(D|E₂) + P(E₃)P(D|E₃):
    P(D) = (0.50 \times 0.02) + (0.30 \times 0.03) + (0.20 \times 0.04) = 0.010 + 0.009 + 0.008 = 0.027
  4. Apply Bayes Theorem to Find P(E₂ | D): Compute the posterior probability that Machine B produced the defective bolt:
    P(E_2 | D) = \frac{P(E_2) P(D|E_2)}{P(D)} = \frac{0.30 \times 0.03}{0.027} = \frac{0.009}{0.027} = \frac{9}{27} = \frac{1}{3}
Final Verified Answer: The probability that the defective bolt came from machine B is exactly 1/3 (≈ 33.3%).

Frequently Asked Concept Doubts

Q: Why is P(Sick | Positive Test) so low even when the test is 95% accurate?

Because of the vast difference in group sizes! If only 2% of people are sick, 98% are healthy. Even a low 5% false positive rate applied to the massive 98% healthy group generates 49 false positives, compared to only 19 true positives from the sick group. 19 / (19 + 49) is only ~28%!

P(\text{Sick} | +) = \frac{0.95 \times 0.02}{(0.95 \times 0.02) + (0.05 \times 0.98)} = \frac{0.019}{0.019 + 0.049} = \frac{0.019}{0.068} \approx 27.9\%

Q: What is the Law of Total Probability in Class 12 CBSE?

If events E₁, E₂, ..., Eₙ form a partition of the sample space S (mutually exclusive and exhaustive events), then for any event A: P(A) = Σ P(Eᵢ) · P(A|Eᵢ). This denominator represents all possible pathways through which event A can occur.

P(A) = \sum_{i=1}^n P(E_i) P(A | E_i) = P(E_1)P(A|E_1) + P(E_2)P(A|E_2) + \dots + P(E_n)P(A|E_n)

Q: What happens if a patient takes a second independent test and it also comes back positive?

You apply Bayes theorem again! But now the prior probability P(A) is no longer the population baseline 2%, but the updated posterior 28%! Repeating with prior = 0.28 yields a new posterior probability > 88%!

P(\text{Sick} | ++ ) = \frac{0.95 \times 0.28}{(0.95 \times 0.28) + (0.05 \times 0.72)} \approx 88.1\%

Prerequisites & Related Visual Labs

Class 10
Monty Hall
Trigonometry • Foundation
Class 12
Probability Distributions
Probability • Intermediate
Class 11
Permutations & Combinations
Algebra • Intermediate
Class 9
Statistics Fulcrum
Probability • Foundation

itsmathtime.co.in Parent Portal Solutions

Access comprehensive NCERT exercises, step-by-step proofs, and video lectures for Probability.

Explore Notes →