Bayes' Theorem Calculator
Input Probabilities
Interpretation
Even with a 90% sensitive test, a positive result for a 1% prevalence condition only gives a 15.4% chance of truly having it. Most positives are false positives due to the low base rate.
What is Bayes' Theorem?
Bayes' Theorem is a fundamental formula in probability theory that describes how to update the probability of a hypothesis based on new evidence. It's named after Reverend Thomas Bayes, who first formulated the theorem in the 18th century.
Where:
P(A|B) is the posterior probability - the probability of A given that B is observed
P(A) is the prior probability - your initial belief about A before seeing evidence B
P(B|A) is the likelihood - the probability of observing evidence B if A is true
P(B) is the marginal probability - the total probability of observing evidence B
How to Calculate P(B)
The total probability P(B) is calculated using the law of total probability:
This accounts for all possible ways that evidence B can occur - either when A is true or when A is false.
Real-World Applications
Medical Diagnosis
If a disease has 1% prevalence and a test is 90% accurate with 5% false positives, a positive test only means 15.4% chance of having the disease. This counterintuitive result shows why confirmatory testing is crucial.
Spam Filtering
Email spam filters use Bayes' Theorem to calculate the probability an email is spam based on words it contains. The filter updates its belief as it learns from more emails you mark as spam or legitimate.
Machine Learning
Naive Bayes classifiers use this theorem to predict categories. Despite the "naive" assumption of feature independence, they work remarkably well for text classification, sentiment analysis, and recommendation systems.
Privacy & Limitations
- All calculations run entirely in your browser -- nothing is sent to any server.
- Results are computed using standard formulas and should be verified for critical applications.
Related Tools
- Diamond Problem Solver -- Find two numbers from their product and sum using the diamond method
- Matrix Calculator -- Add, multiply, transpose, and find determinants of matrices
- GCD & LCM Calculator -- Find the greatest common divisor and least common multiple
- Completing The Square Calculator -- Convert quadratic expressions to vertex form with step-by-step work
Related Tools
View all toolsGCD & LCM Calculator
Find the greatest common divisor and least common multiple
Random Number Generator
Generate random numbers within a range
Completing The Square Calculator
Convert quadratic expressions to vertex form with step-by-step work
Factoring Calculator
Factor polynomials and trinomials step by step showing GCF, difference of squares, and AC method
Midpoint Calculator
Find the midpoint between two points in 2D or 3D
Diamond Problem Solver
Find two numbers from their product and sum using the diamond method
Bayes Theorem Calculator FAQ
What is Bayes' Theorem?
Bayes' Theorem is a mathematical formula for calculating conditional probability. It allows you to update the probability of a hypothesis (A) based on new evidence (B). The formula is P(A|B) = P(B|A) × P(A) / P(B).
How do you calculate posterior probability?
Posterior probability P(A|B) is calculated by multiplying the prior probability P(A) by the likelihood P(B|A), then dividing by the total probability of the evidence P(B). This gives you the updated probability after considering new evidence.
What is the difference between prior and posterior probability?
Prior probability is your initial belief before seeing evidence. Posterior probability is your updated belief after observing evidence. Bayes' Theorem mathematically shows how to update from prior to posterior.
What are real-world applications of Bayes' Theorem?
Bayes' Theorem is used in medical diagnosis (interpreting test results), spam filtering, machine learning, weather forecasting, legal reasoning, and any field where you need to update beliefs based on new evidence.