Mathematics, Statistics & Geometry

Bayes Theorem Calculator

Calculate posterior probability using Bayes Theorem. Find P(A|B) given prior probabilities and conditional likelihoods with clear steps.

P(A|B) - Posterior Probability
64
P(B) - Evidence12.5%
P(not A)90%
Calculation StepsBayes' Theorem: P(A|B) = [P(B|A) * P(A)] / P(B) 1. Calculate P(B): P(B) = P(B|A)P(A) + P(B|¬A)P(¬A) P(B) = (0.8 * 0.1) + (0.05 * 0.9000) = 0.125000 2. Calculate P(A|B): P(A|B) = (0.8 * 0.1) / 0.125000 = 0.640000

Calculated locally in your browser. Fast, secure, and private.

The Logic of Uncertainty

The Bayes Theorem calculator provides a professional way to update probabilities based on new evidence. This theorem is the gold standard for reasoning under uncertainty, used by data scientists, doctors, and forensic investigators to turn "raw evidence" into "posterior probabilities."

P(AB)=P(BA)P(A)P(B)\begin{aligned} P(A|B) = \frac{P(B|A) P(A)}{P(B)} \end{aligned}

Where:
P(A|B)=
Probability of event A occurring given that B is true
P(B|A)=
Probability of event B occurring given that A is true
P(A)=
The initial probability of event A
P(B)=
The total probability of event B occurring

Understanding the Variables

  • P(A): Your initial belief (e.g., the probability that a patient has a disease before taking a test).
  • P(B|A): The test's sensitivity (probability of a positive result if the person has the disease).
  • P(B|not A): The false positive rate (probability of a positive result if the person does NOT have the disease).
  • P(A|B): The final result (the probability the person actually has the disease given a positive test result).

Common Paradox: The Base Rate Fallacy

Bayes' Theorem often produces counter-intuitive results. For example, if a disease is very rare (low P(A)), even a very accurate test might produce more false positives than true positives. Our calculator helps you avoid this common logical trap by showing the exact probability breakdown.

Practical Applications

  • Medical Diagnosis: Estimating the actual risk of a disease after a positive screening test.
  • Spam Filtering: Calculating the probability a message is "spam" based on the presence of certain words.
  • Machine Learning: Using Naive Bayes classifiers for document categorization and sentiment analysis.
  • Forensics: Determining the probability of a suspect's guilt given a DNA match or other evidence.

Frequently Asked Questions

Bayes' Theorem is a mathematical formula used to determine the probability of an event based on prior knowledge of conditions that might be related to the event. It is the foundation of Bayesian statistics.

In most Bayesian problems, P(B) is calculated using the Law of Total Probability: P(B) = P(B|A)P(A) + P(B|not A)P(not A).

It allows us to update our beliefs as new evidence becomes available. It is widely used in medical testing, spam filtering, and risk assessment.

A false positive is represented by P(B|not A)—the probability that the evidence B appears even when the condition A is actually false.

Yes, the generalized version of Bayes' Theorem can be used to compare multiple mutually exclusive hypotheses.