Calculate P(A|B) — the probability of event A given that event B has occurred.
Last updated: March 2026
Conditional probability is the probability of an event A occurring given that another event B has already occurred. It's written as P(A|B), read "the probability of A given B."
In real life, we constantly use conditional probability. For example, "What's the probability it rained last night given that the grass is wet?" or "What's the probability someone has a disease given that their test came back positive?" These are conditional probabilities because they account for new information.
The fundamental formula is: P(A|B) = P(A ∩ B) / P(B), where P(A ∩ B) is the probability of both A and B occurring together, and P(B) is the probability of B occurring.
Bayes' Theorem lets us update our beliefs. If we know P(B|A) (likelihood) and P(A) (prior), we can calculate P(A|B) (posterior) — the updated probability of A given we observed B.
A disease affects 1% of the population. A test is 99% accurate (returns positive if disease present, negative if not). You test positive. What's the probability you actually have the disease?
These are NOT the same! P(A|B) is 'A given B happened' while P(B|A) is 'B given A happened'. The disease example shows this: P(Positive|Disease) ≠ P(Disease|Positive).
Use Bayes when you want to update your belief after seeing new evidence. You start with a prior P(A), observe B, then calculate the posterior P(A|B). It's fundamental to medical diagnosis, spam filtering, and machine learning.
P(A ∩ B) is the probability that both events occur together. For example, 'it rains AND I stay home.' This is the numerator in conditional probability.
Absolutely! If B increases the likelihood of A, then P(A|B) > P(A). For example, P(wet ground | rain) > P(wet ground) because rain makes wet ground more likely.
Conditional probability P(A|B) is undefined when P(B) = 0, because we're conditioning on something impossible. The formula involves dividing by P(B), so division by zero is undefined.
Events A and B are independent if P(A|B) = P(A), meaning knowing B doesn't change the probability of A. If P(A|B) ≠ P(A), the events are dependent.
Related Tools
Basic probability calculations.
P(A and B) calculations.
Three event probabilities.
Conditional probability.
Probability-weighted average.
Decision theory.