Conditional Probability Calculator
Calculate P(A|B) from an intersection probability and a given condition. The page explains the denominator change, the difference between P(A|B) and P(B|A), and how conditional probability connects to independence.
Conditional probability in plain language
Conditional probability means the probability of one event after we already know another event has happened. The notation P(A|B) is read “the probability of A given B.” OpenStax introduces this language in its probability terminology and rules sections, including probability terminology and basic probability rules.
The most important idea is that the denominator changes. You are no longer looking at the whole sample space; you are looking only inside the world where B has happened.
Conditional probability formula
This calculator uses the probability formula directly. It also checks whether P(A|B) equals P(A) when P(A) is entered, because that is one common way to test whether A and B are independent.
Using counts instead of probabilities
If you have a two-way table, the same idea still applies. The numerator is the count that satisfies both conditions, and the denominator is the total count in the given condition. OpenStax uses contingency tables in its exact section on contingency tables, which is often where conditional probability becomes easier to see visually.
Frequently asked questions
-
P(A|B) means the probability that event A happens given that event B has already happened. The vertical bar does not mean division by itself; it means “given.” The calculation uses division because the sample space is restricted to the cases where B happened.
-
They are usually not the same. P(A|B) looks at the probability of A among the cases where B happened. P(B|A) looks at the probability of B among the cases where A happened. Swapping the condition changes the denominator, so the result can change a lot.
-
Two events are independent if knowing one happened does not change the probability of the other. In symbols, A and B are independent if P(A|B) = P(A), assuming P(B) is not zero. They are also independent if P(A∩B) = P(A)P(B).
-
Conditional probability P(A|B) asks what happens inside event B. If P(B) = 0, then there is no probability mass inside B to condition on, so the simple formula P(A∩B)/P(B) is undefined.
-
Yes. In a table, divide the count in the intersection by the total count for the condition. For example, if 18 students are both seniors and athletes, and 60 students are seniors, then P(athlete | senior) = 18/60 = 0.30.