Mathematical Statistics
ADA University, School of Business
Information Communication Technologies Agency, Statistics Unit
2025-10-18
🏥 Scenario: A disease affects 0.5% of population…
Think (1 minute): If a test is 95% accurate, and you test positive, what’s the probability you have the disease?
👥 Pair (2 minutes): Discuss your reasoning
🗣️ Share: Let’s hear some estimates before we solve it!
The Foundation
Basic Setup: Let \(E\) and \(F\) be events. Then \(E = EF \cup EF^c\)
Total Probability Law: \[P(E) = P(EF) + P(EF^c) = P(E \mid F)P(F) + P(E \mid F^c)P(F^c)\]
Expanding: \[P(E) = P(E \mid F)P(F) + P(E \mid F^c)(1 - P(F))\]
Key Insight: Event \(E\) can happen in two mutually exclusive ways:
Definition: Bayes’ Formula
Given events \(E\) and \(F\) with \(P(E) > 0\):
\[\boxed{P(F \mid E) = \frac{P(E \mid F)P(F)}{P(E)}}\]
Or equivalently:
\[\boxed{P(F \mid E) = \frac{P(E \mid F)P(F)}{P(E \mid F)P(F) + P(E \mid F^c)P(F^c)}}\]
💡 Key Insight: Bayes’ formula allows us to “reverse” conditional probabilities!
Problem: Insurance company divides people into accident-prone and not accident-prone.
Given Data:
Question: What’s the probability a new policyholder has an accident within a year?
Define Events:
Given Information:
Solution using Total Probability: \[P(A) = P(A \mid P)P(P) + P(A \mid P^c)P(P^c)\] \[P(A) = 0.4 \times 0.3 + 0.2 \times 0.7 = 0.12 + 0.14 = \boxed{0.26}\]
🤔 New Question: If a policyholder has an accident, what’s the probability they’re accident-prone?
Think (2 minutes): How does this differ from the previous problem?
👥 Pair: Compare your approaches with a neighbor
🔑 Key Difference: We know \(P(A \mid P)\) but need \(P(P \mid A)\) - this is where Bayes shines!
Question: \(P(\text{accident-prone} \mid \text{accident occurred})\) = ?
Using Bayes’ Formula: \[P(P \mid A) = \frac{P(A \mid P)P(P)}{P(A)}\]
Solution: \[P(P \mid A) = \frac{0.4 \times 0.3}{0.26} = \frac{0.12}{0.26} = \frac{6}{13} \approx \boxed{0.462}\]
Interpretation
Before accident: 30% chance of being accident-prone
After accident: 46.2% chance - evidence updated our belief!
Scenario: Student either knows answer (probability \(p\)) or guesses (probability \(1-p\)).
Given:
Question: \(P(\text{student knew answer} \mid \text{answered correctly})\) = ?
⏱️ Group Activity: Work in pairs for 3 minutes
Define Events:
Given:
Step 1 - Total Probability: \[P(C) = P(C \mid K)P(K) + P(C \mid K^c)P(K^c) = 1 \cdot p + \frac{1}{m}(1-p)\]
Step 2 - Apply Bayes’ Formula: \[P(K \mid C) = \frac{P(C \mid K)P(K)}{P(C)} = \frac{1 \cdot p}{p + \frac{1-p}{m}}\]
Simplifying: \[\boxed{P(K \mid C) = \frac{mp}{mp + 1 - p} = \frac{mp}{(m-1)p + 1}}\]
Special Cases
The Classic Medical Test Problem:
Given Data:
🎯 Your Challenge: Person tests positive. What’s \(P(\text{has disease})\)?
⏱️ Time: 5 minutes in pairs
📝 Show: Complete calculation steps
Define Events:
Given:
Step 1 - Total Probability: \[P(T) = 0.95 \times 0.005 + 0.01 \times 0.995 = 0.00475 + 0.00995 = 0.0147\]
Step 2 - Bayes’ Formula: \[P(D \mid T) = \frac{P(T \mid D)P(D)}{P(T)} = \frac{0.95 \times 0.005}{0.0147} = \frac{0.00475}{0.0147} \approx \boxed{0.323}\]
🚨 Surprising Result
Only 32.3% chance of having the disease despite positive test!
Why? The disease is rare, so false positives outnumber true positives.
🏥 Clinical Implication: This is why retesting or additional tests are often needed.
Real-World Application: Medical practitioner’s decision-making process
Initial Setup:
Plot Twist: After positive test, patient reveals diabetes!
🏥 Clinical Decision: Surgery or more tests?
Problem Components:
👥 Think-Pair-Share: How does the diabetes information change our analysis?
Define Events:
Updated Calculation: \[P(D \mid T^+) = \frac{P(T^+ \mid D) \cdot P(D)}{P(T^+ \mid D) \cdot P(D) + P(T^+ \mid D^c, \text{diabetic}) \cdot P(D^c)}\]
Solution: \[P(D \mid T^+) = \frac{1.0 \times 0.6}{1.0 \times 0.6 + 0.3 \times 0.4} = \frac{0.6}{0.6 + 0.12} = \frac{0.6}{0.72} \approx \boxed{0.833}\]
✅ Decision
Since 83.3% > 80%, recommend surgery!
Note: Without the diabetes information, probability would be higher. The complication reduces certainty but still exceeds threshold.
Detective’s Dilemma: Inspector is 60% convinced of suspect’s guilt.
New Evidence: Criminal has certain characteristic (left-handed, bald, brown hair)
Question: How certain should the inspector now be?
🕵️ Think-Write-Pair: Work through this step by step (3 minutes)
Define Events:
Assumptions:
Solution: \[P(G \mid C) = \frac{P(C \mid G)P(G)}{P(C \mid G)P(G) + P(C \mid G^c)P(G^c)}\] \[= \frac{1.0 \times 0.6}{1.0 \times 0.6 + 0.2 \times 0.4} = \frac{0.6}{0.6 + 0.08} = \frac{0.6}{0.68} \approx \boxed{0.882}\]
Interpretation
New certainty: 88.2% - much stronger case!
Evidence increased probability from 60% to 88.2%.
Historical Case: 1965 Buenos Aires World Bridge Championships
Accusation: British pair Reese and Schapiro accused of cheating using finger signals
Legal Proceedings:
🤔 Critical Thinking: What’s wrong with the prosecution’s reasoning?
The Fallacy:
Prosecution only considered \(P(\text{play pattern} \mid \text{guilty})\)
But Bayes requires comparing: \[\frac{P(\text{pattern} \mid \text{guilty})}{P(\text{pattern} \mid \text{innocent})}\]
💡 Bayesian Insight
Evidence only favors guilt if the play pattern is more likely under guilt than innocence.
If \(P(\text{pattern} \mid \text{guilty}) \approx P(\text{pattern} \mid \text{innocent})\), the evidence is neutral!
Definition: Odds
The odds of event \(A\) are: \[\boxed{\text{Odds}(A) = \frac{P(A)}{P(A^c)} = \frac{P(A)}{1 - P(A)}}\]
Interpretation: How much more likely \(A\) is than not-\(A\)
Example: If \(P(A) = 0.75\), then \(\text{Odds}(A) = \frac{0.75}{0.25} = 3\) (written as “3 to 1”)
Odds Form of Bayes’ Theorem
\[\boxed{\frac{P(H \mid E)}{P(H^c \mid E)} = \frac{P(H)}{P(H^c)} \times \frac{P(E \mid H)}{P(E \mid H^c)}}\]
Or in words:
\[\boxed{\text{Posterior Odds} = \text{Prior Odds} \times \text{Likelihood Ratio}}\]
💡 Key Insight: Evidence multiplies prior odds by the likelihood ratio!
Setup: Urn contains 2 Type A coins and 1 Type B coin
Coin Properties:
Experiment: Random coin selected, flipped, shows heads
Question: \(P(\text{Type A coin} \mid \text{heads})\) = ?
Define Events:
Prior Probabilities:
Likelihoods:
Solution using Bayes: \[P(A \mid H) = \frac{P(H \mid A)P(A)}{P(H \mid A)P(A) + P(H \mid B)P(B)}\] \[= \frac{\frac{1}{4} \times \frac{2}{3}}{\frac{1}{4} \times \frac{2}{3} + \frac{3}{4} \times \frac{1}{3}} = \frac{\frac{1}{6}}{\frac{1}{6} + \frac{1}{4}} = \frac{\frac{1}{6}}{\frac{5}{12}} = \frac{2}{5} = \boxed{0.4}\]
Interpretation
Before flip: \(P(A) = 66.7\%\)
After heads: \(P(A|H) = 40\%\)
Observing heads makes Type B more likely!
General Formula
If \(F_1, F_2, \ldots, F_n\) are mutually exclusive and exhaustive: \[\boxed{P(E) = \sum_{i=1}^{n} P(E \mid F_i)P(F_i)}\]
Bayes’ Formula (General): \[\boxed{P(F_j \mid E) = \frac{P(E \mid F_j)P(F_j)}{\sum_{i=1}^{n} P(E \mid F_i)P(F_i)}}\]
Scenario: Plane missing, equally likely in 3 regions
Search Probabilities:
Question: \(P(\text{plane in region } i \mid \text{unsuccessful search of region 1})\) = ?
🛩️ Group Challenge: Set up and solve for \(i = 1, 2, 3\) (4 minutes)
Define Events:
Given: \(P(R_i) = \frac{1}{3}\) for all \(i\)
Likelihoods:
Total Probability: \[P(U_1) = \beta_1 \cdot \frac{1}{3} + 1 \cdot \frac{1}{3} + 1 \cdot \frac{1}{3} = \frac{\beta_1 + 2}{3}\]
Solutions: \[\boxed{P(R_1 \mid U_1) = \frac{\beta_1}{2 + \beta_1}}\]
\[\boxed{P(R_2 \mid U_1) = P(R_3 \mid U_1) = \frac{1}{2 + \beta_1}}\]
🔍 Insight: If \(\beta_1\) is small (good search), plane is unlikely in region 1.
Classic Puzzle: 3 identical cards in a hat
Card Types:
Experiment: Draw card, place down, see red side up
Question: \(P(\text{other side is black})\) = ?
⚠️ Common Mistake: Thinking it’s \(\frac{1}{2}\)
Sample Space: 6 equally likely sides could be showing
Given: Red side showing, so we have Red₁, Red₂, or Red₃
Analysis:
Solution: \(P(\text{other side black} \mid \text{red showing}) = \frac{1}{3}\)
💡 Key Insight
RR card has twice the chance to show red!
Of 3 red sides, only 1 has black on the other side.
Formal Solution: \[P(\text{Black on other} \mid \text{Red showing}) = \frac{P(\text{Red showing} \mid \text{RB card})P(\text{RB card})}{P(\text{Red showing})}\] \[= \frac{\frac{1}{2} \times \frac{1}{3}}{\frac{1}{2}} = \frac{1}{3}\]
The Ambiguous Problem: Family has 2 children, mother walks with a girl.
Question: \(P(\text{both children are girls} \mid \text{this child is a girl})\) = ?
🚨 Warning: “This problem is incapable of solution without more information”
🤔 Discussion Points:
Missing Information: How was this child selected?
Scenario A: Random selection from the two children
Scenario B: Mother always walks with a girl if she has one
💡 Lesson
The probability depends crucially on the selection mechanism!
Quality Control Problem: Bin contains 3 types of flashlights
Performance Data:
Questions:
Part A: Overall probability of lasting >100 hours
Using Total Probability: \[P(L) = P(L \mid T_1)P(T_1) + P(L \mid T_2)P(T_2) + P(L \mid T_3)P(T_3)\] \[= 0.7 \times 0.2 + 0.4 \times 0.3 + 0.3 \times 0.5\] \[= 0.14 + 0.12 + 0.15 = \boxed{0.41}\]
Part B: Given flashlight lasted >100 hours, find type probabilities
Using Bayes’ Formula: \[P(T_1 \mid L) = \frac{0.7 \times 0.2}{0.41} = \frac{0.14}{0.41} \approx \boxed{0.341}\]
\[P(T_2 \mid L) = \frac{0.4 \times 0.3}{0.41} = \frac{0.12}{0.41} \approx \boxed{0.293}\]
\[P(T_3 \mid L) = \frac{0.3 \times 0.5}{0.41} = \frac{0.15}{0.41} \approx \boxed{0.366}\]
Before Testing:
After Lasting >100 hours:
🤯 Insight
Type 3 becomes most likely, despite being worst initially!
Why? It’s so common that even with lower quality, it contributes most to successful flashlights.
Press ‘c’ to check your answer, ‘r’ to reset, ‘s’ to shuffle questions
In the medical test with 0.5% prevalence and 95% sensitivity, why is P(disease|positive) only 32%?
What is the likelihood ratio in Bayes’ odds form?
Essential Formulas
Bayes’ Formula: \[\boxed{P(H \mid E) = \frac{P(E \mid H)P(H)}{P(E)}}\]
Total Probability: \[\boxed{P(E) = \sum_{i} P(E \mid H_i)P(H_i)}\]
Odds Form: \[\boxed{\text{Posterior Odds} = \text{Prior Odds} \times \text{Likelihood Ratio}}\]
Step 1: Clearly define all events
Step 2: Identify given vs. asked
Step 3: Determine Bayes’ or Total Probability
Step 4: Set up formula with values
Step 5: Compute and interpret
⚠️ Common Pitfalls:
Where Bayes’ Theorem matters:
💡 Core Principle
Bayes’ Theorem is the mathematical foundation for rational updating of beliefs in light of new evidence.
Next Topics:
Connections:
🌟 Remember: Bayes’ Theorem is the heart of rational reasoning under uncertainty - you’ll use it throughout statistics and beyond!
🤔 Think About:
💬 Discussion Question:
“In the medical test example, most people guess 95% instead of 32%. Why do humans struggle with Bayesian reasoning? What are the practical implications?”
Thank you!
Office Hours: By appointment via email
Contact: sorujov@ada.edu.az

Mathematical Statistics - Bayes’ Formula