Math101learn.math101.caBayes' Theorem
A precise treatment of Bayes' theorem, base rates, partitions, diagnostic tests, and interpretation.
Precise definition
For events $A,B$ with $P(B)>0$, Bayes' theorem is $P(A\mid B)=P(B\mid A)P(A)/P(B)$. If $A_1,\ldots,A_k$ partition the sample space, then $P(A_i\mid B)=P(B\mid A_i)P(A_i)/\sum_jP(B\mid A_j)P(A_j)$.
Notation and mathematical language
$P(A)$ is a prior probability, $P(B\mid A)$ a likelihood for event data, $P(A\mid B)$ a posterior, and $P(B)$ the evidence or normalizing probability. In diagnostic testing, sensitivity is $P(+\mid D)$ and specificity is $P(-\mid D^c)$; neither is the positive predictive value $P(D\mid+)$.
Conceptual picture
Bayes reverses a conditional probability by reweighting prior possibilities according to how compatible each is with the evidence. A probability tree or frequency table makes the denominator visible and prevents ignoring the many false positives possible when a condition is rare.
Conditions and key results
Events in the denominator must cover all mutually exclusive routes to $B$. Priors and likelihoods must refer to the relevant population and testing process. Conditional probabilities cannot be reversed, and dependence among repeated evidence must be modelled rather than multiplying likelihoods automatically.
A reliable strategy
- Name the target event and evidence; write the requested conditional in the correct direction.
- List a complete partition and attach priors and conditional evidence probabilities.
- Compute joint branch probabilities, sum all evidence branches for the denominator, and divide the target branch.
- Interpret the posterior for the stated population and examine sensitivity to base-rate or model assumptions.
Fully worked example
Interpretation and application
Bayesian updating supports diagnosis, quality control, classification, and scientific inference. The posterior is conditional on the prior, likelihood model, data quality, and population; it is not an assumption-free statement of certainty or causal proof.
Common mistakes
Verification and reasonableness
- Recompute with a natural-frequency table such as 10,000 cases.
- Check posterior lies between 0 and 1 and evidence probabilities sum correctly.
- Vary the prior to see whether the conclusion is base-rate sensitive.
Practice
- If $P(A)=0.2$, $P(B\mid A)=0.5$, and $P(B)=0.25$, find $P(A\mid B)$.
- What is the false-positive rate if specificity is 0.97?
- Is sensitivity the chance of disease after a positive result?
Answers and brief solutions
- $0.4$.
- $0.03$.
- No; sensitivity is $P(+\mid D)$, while the latter is $P(D\mid+)$.
Further deduction
In odds form, posterior odds equal prior odds times a likelihood ratio. For a positive diagnostic result, $LR^+=\text{sensitivity}/(1-\text{specificity})$. In the example, $LR^+=0.90/0.05=18$: the test multiplies prior odds $0.01/0.99$ by 18, yielding posterior odds about 0.1818 and probability $0.1818/(1+0.1818)\approx0.1538$.
When evidence arrives sequentially, update the posterior from the first observation and use it as the next prior. Multiplying likelihoods is valid when observations are conditionally independent given each hypothesis. If tests share specimens, instruments, or symptoms, conditional dependence can make naive multiplication overstate evidence; model that dependence or perform sensitivity analysis.
Related topics
Explore the idea
Probability sampler
Change one quantity at a time and connect what moves to Bayes' Theorem.
highlighted: expected A ∩ B cases
Try it yourself
Hints are part of learning. Open one whenever it makes the next step feel possible.
If $P(A)=0.3$, $P(B|A)=0.4$, and $P(B)=0.2$, what is $P(A|B)$?
- $P(B|A)P(A)=0.4(0.3)=0.12$.
- $0.12/0.2=0.6$.
End of lesson
Nice work making it this far.
Understanding grows through return visits. Save this lesson, try the practice, or continue when you are ready.
