Conditional Probability

Calculate conditional probability P(A|B) using Bayes' theorem online. Enter the prior probability, true positive rate, and false positive rate for instant results with charts.

Calculate conditional probability using Bayes' theorem

About This Calculator

The Conditional Probability Calculator helps you compute the probability of an event occurring given that another event has already occurred. It is essential for students, statisticians, data scientists, healthcare professionals, and anyone working with Bayesian reasoning or diagnostic testing scenarios.

The calculator uses Bayes' theorem: P(A|B) = P(A) × P(B|A) / P(B). First, the joint probability P(A∩B) is computed as P(A) × P(B|A). Next, the total probability P(B) is found by summing P(A∩B) and P(not A∩B). Finally, P(A|B) is the ratio of P(A∩B) to P(B). The calculator also shows P(not A|B), P(A|not B), and P(not A|not B) for a complete posterior probability picture.

Regional Notes

India (IN): Conditional probability is widely used in Indian medical research, public health screening programs, and quality control in manufacturing. The ICMR uses Bayesian methods for diagnostic test evaluation and disease prevalence estimation.

United States (US): The FDA relies on conditional probability for medical device and drug approval decisions. Bayesian methods are standard in US clinical trials, epidemiology, and machine learning applications across industries.

United Kingdom (UK): The NHS uses conditional probability in diagnostic pathways and screening programmes. NICE guidelines incorporate Bayesian analysis for health technology assessments and clinical decision-making.

Frequently Asked Questions

What is conditional probability?

Conditional probability measures the probability of an event occurring given that another event has already occurred. It is denoted as P(A|B), meaning the probability of event A happening given that event B has occurred. The formula is P(A|B) = P(A∩B) / P(B).

How do you calculate conditional probability?

To calculate conditional probability P(A|B), first find the joint probability P(A∩B) by multiplying P(A) by P(B|A). Then compute the total probability P(B) as P(A)P(B|A) + P(not A)P(B|not A). Finally, divide P(A∩B) by P(B). This calculator automates all these steps.

What is Bayes' theorem?

Bayes' theorem describes the probability of an event based on prior knowledge of conditions related to the event. The formula is P(A|B) = P(A) × P(B|A) / P(B). It is widely used in diagnostic testing, spam filtering, machine learning, and scientific research to update probabilities as new evidence becomes available.

What are some real-world examples of conditional probability?

Common examples include medical diagnostic testing (probability of having a disease given a positive test), weather forecasting (probability of rain given cloudy skies), spam filtering (probability an email is spam given certain keywords), and quality control (probability a product is defective given it failed a test).

How is conditional probability used in medical testing?

In medical testing, P(A|B) represents the probability of having a disease given a positive test result. Even with a highly accurate test (91% sensitivity, 95% specificity), a rare disease (5% prevalence) yields only about 49% probability of actually having the disease after a positive result. This highlights why confirmatory testing is essential.

What is the difference between P(A|B) and P(B|A)?

P(A|B) is the probability of event A occurring given that event B has occurred, while P(B|A) is the probability of event B occurring given that event A has occurred. These are generally not equal. For example, P(having a disease|positive test) is very different from P(positive test|having the disease) in both meaning and numerical value.

Can conditional probability be greater than 1?

No, conditional probability is always between 0 and 1 (0% and 100%). A probability of 0 means the event cannot occur, while a probability of 1 means it is certain to occur. This calculator validates inputs to ensure all probabilities stay within valid ranges.

What inputs does this conditional probability calculator need?

You need three inputs: P(A) the prior probability of event A, P(B|A) the true positive rate or probability of B given A, and P(B|not A) the false positive rate or probability of B given not A. The calculator then computes P(A|B), P(not A|B), P(B), P(A∩B), and P(A|not B) with interactive charts.