What Is Conditional Probability?
Conditional probability measures the likelihood of an event A happening given that another event B has already occurred. It is written \(P(A|B)\), read as "the probability of A given B." This concept is fundamental to statistics, machine learning, risk analysis, and everyday decision-making where new information updates our expectations.
How to Use This Calculator
Enter two values between 0 and 1: the joint probability P(A and B) — the chance that both events occur together — and P(B) — the chance that event B occurs. The calculator divides the joint probability by \(P(B)\) and returns \(P(A|B)\) both as a decimal and a percentage.
The Formula Explained
The defining equation is:
$$P(A \mid B) = \frac{\text{P(A and B)}}{\text{P(B)}}$$
The numerator, P(A and B), is the probability that both A and B happen. Dividing by \(P(B)\) rescales this to the "world" in which B is known to have happened. Note that \(P(B)\) must be greater than zero, since conditioning on an impossible event is undefined.
Worked Example
Suppose the probability that it rains and you carry an umbrella is \(P(A \text{ and } B) = 0.2\), and the probability that you carry an umbrella is \(P(B) = 0.5\). Then the probability that it rains given that you carry an umbrella is $$P(A|B) = \frac{0.2}{0.5} = 0.4,$$ or 40%.
FAQ
What if P(B) is zero? Conditional probability is undefined when \(P(B) = 0\), because you cannot condition on an event that never happens. This calculator returns 0 in that case as a safeguard.
Can the result exceed 1? No. As long as \(P(A \text{ and } B) \le P(B)\), the result stays between 0 and 1. A result above 1 means your inputs are inconsistent.
How is this different from P(A and B)? P(A and B) is the joint chance both occur; \(P(A|B)\) assumes B already happened and asks only about A, so it is generally larger.