HomeAI & Machine LearningBayes' Theorem and Medical Testing

🧮 Bayes' Theorem and the Medical Testing Paradox

A 3D population of test-takers sorts itself live into true-positive, false-positive, true-negative and false-negative groups as you tune disease prevalence, test sensitivity and specificity — watch Bayes' theorem explain why rare-disease tests produce mostly false alarms.

AI & Machine Learning3DAdvanced60 FPS
bayes-theorem-medical-testing-paradox-lab ↗ Open standalone

A 3D crowd of simulated patients sorts itself into four glowing pens — true positive, false negative, false positive and true negative — showing exactly why a highly accurate test can still be wrong more often than right when the disease is rare.

🔬 What It Demonstrates

Each sphere is one simulated person; disease status is drawn from prevalence, then a diagnostic test is applied using sensitivity and specificity. The four resulting pens are the four cells of a confusion matrix, and the live positive predictive value is Bayes' theorem in action.

🎮 How to Use

Lower the prevalence slider toward rare-disease territory and watch the false-positive pen swell relative to the true-positive pen, even with a highly sensitive and specific test. Toggle sorting off to see the same crowd as an unsorted population.

💡 Did You Know?

A test that is "99% accurate" on a disease affecting 1 in 1,000 people can still mean fewer than 1 in 10 positive results are real — the base rate, not the test's headline accuracy, dominates the answer.

⚙ Under the hood

A 3D population of test-takers sorts itself live into true-positive, false-positive, true-negative and false-negative groups as you tune disease prevalence, test sensitivity and specificity — watch Bayes' theorem explain why rare-disease tests produce mostly false alarms.

machine learningbayesian networksstatistical modelingdata analysismedical testingfalse alarmsThree.js

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)