Bayes' Theorem Calculator
Calculate conditional probability P(A|B) using Bayes' theorem with prior and likelihood probabilities
Calculate Conditional Probability
Choose how to calculate the evidence probability P(B)
The prior probability of event A occurring
The probability of B given that A has occurred
The total probability of event B occurring
Bayes' Theorem Results
Formula Used
Interpretation
Given that event B has occurred, there is a 26.67% probability that event A has also occurred.
The prior probability of A was 20%, but observing event B increases our confidence that A occurred to 26.67%.
Example: Weather Prediction
Weather Example Problem
Question: What's the probability of rain given cloudy morning?
A = Rain event
B = Cloudy morning event
P(A) = 20% (probability of rain on any given day)
P(B) = 45% (probability of cloudy morning)
P(B|A) = 60% (probability of cloudy morning given rain)
Solution
P(A|B) = [P(B|A) × P(A)] / P(B)
P(A|B) = [60% × 20%] / 45%
P(A|B) = 12% / 45%
P(A|B) = 26.67%
There's a 26.67% chance of rain given a cloudy morning.
Bayes' Theorem Components
P(A|B)
Posterior probability
What we want to find
P(A)
Prior probability
Initial belief about A
P(B|A)
Likelihood
Probability of evidence given A
P(B)
Evidence
Total probability of evidence
Common Applications
Medical Diagnosis
Test accuracy and disease probability
Spam Filtering
Email classification systems
Machine Learning
Naive Bayes classifiers
Legal Evidence
Evidence evaluation in courts
Risk Assessment
Financial and insurance analysis
Bayes' Theorem Tips
Use when you know P(A) and P(B|A) but need P(A|B)
Extended mode calculates P(B) from components
Posterior combines prior belief with new evidence
All probabilities must be between 0% and 100%
Understanding Bayes' Theorem
What is Bayes' Theorem?
Bayes' theorem is a mathematical formula that describes how to update the probability of a hypothesis when given new evidence. It's named after Thomas Bayes, an 18th-century statistician and theologian.
When to Use Bayes' Theorem
- •When you know the prior probability P(A)
- •When you know the likelihood P(B|A)
- •When you need to find P(A|B)
- •For updating beliefs with new evidence
The Bayes' Formula
P(A|B) = [P(B|A) × P(A)] / P(B)
Extended Formula
P(A|B) = [P(B|A) × P(A)] / [P(A) × P(B|A) + P(¬A) × P(B|¬A)]
Where:
- • P(A|B) = Posterior probability
- • P(A) = Prior probability
- • P(B|A) = Likelihood
- • P(B) = Evidence
- • P(¬A) = Probability of NOT A