math calculator
Bayes' Theorem & Conditional Probability Calculator
Calculate conditional probabilities, visualize tree diagrams, and analyze medical/spam test accuracy.
Inputs
Results
Posterior Probability P(A|B)
16.67%
Probability Breakdown
Confusion Matrix (n = 10,000)
99
True Positive
495
False Positive
1
False Negative
9,405
True Negative
Population of 10,000 · 100 with condition · 9900 without condition
Calculation Steps
Given: \(P(A) = 0.01,\; P(B|A) = 0.99,\; P(B|A') = 0.05\)
Compute the marginal probability of testing positive using the Law of Total Probability:
Apply Bayes' Theorem to compute the posterior probability:
In a population of 10,000: 100 have the condition. Of these, 99 test positive (true positive) and 1 test negative (false negative).
9900 do not have the condition. Of these, 495 test positive (false positive) and 9405 test negative (true negative).
Formula
Bayes' Theorem Formula
P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B|A)P(A) + P(B|A')(1-P(A))}Bayes' Theorem updates a prior probability P(A) into a posterior probability P(A|B) after observing evidence B. The denominator uses the Law of Total Probability to normalize.
Step by step
How the calculation works
- 1Enter the prior probability (disease prevalence), sensitivity (true positive rate), and false positive rate.
- 2The calculator shows the posterior probability of having the condition given a positive test.
- 3The confusion matrix shows how these rates translate for a population of 10,000 people.
Related guides
Learn more about this calculation
Guide
Standard Deviation Guide: Measure Data Spread Clearly
Understand variance, population vs sample formulas, and data spread with worked examples tied to the live DTC standard deviation calculator.
Site Guide
How to Use Do The Calculation Calculators: A Practical Step-by-Step Guide
Learn the fastest reliable workflow for using Do The Calculation calculators, reading results, checking formulas, and using save, print, share, and export actions correctly.
Percentage
Percentage Calculator
Convert between fractions, ratios, and percentages.
Activation Funcs
Activation Functions
Compute Softmax and Sigmoid probability outputs for neural networks.