Conditional probability: “given” information
Conditional probability formalizes how probabilities change when you learn that some information is true.
If \(A\) is an event you care about and \(B\) is an event you already know occurred, then \(P(A\mid B)\) means
“the probability of \(A\) assuming \(B\) happened.” The key idea is that the sample space is effectively restricted:
once \(B\) is known, outcomes outside \(B\) are no longer possible, so you measure \(A\) only inside the region \(B\).
The formula \(P(A\mid B)=\dfrac{P(A\cap B)}{P(B)}\)
In a finite model where outcomes are equally likely, conditional probability can be understood as a ratio of counts:
\[
P(A\mid B)=\frac{\#(A\cap B)}{\#(B)}.
\]
For general probability spaces, the same ratio becomes
\[
P(A\mid B)=\frac{P(A\cap B)}{P(B)},\quad \text{provided } P(B)>0.
\]
The numerator \(P(A\cap B)\) is the joint probability that both events occur. The denominator \(P(B)\) normalizes by how “large”
event \(B\) is, because we are working only within \(B\). This is why the calculator requires \(P(B)>0\): if \(B\) has zero probability,
conditioning on \(B\) is not defined by this simple ratio.
Independence as a comparison test
Events \(A\) and \(B\) are independent if knowing \(B\) happened does not change the probability of \(A\).
In symbols, independence implies
\[
P(A\mid B)=P(A)\quad \text{(and similarly } P(B\mid A)=P(B)\text{)}.
\]
The calculator can optionally accept \(P(A)\) and compare it to \(P(A\mid B)\). If they differ (beyond a tolerance you set),
that is evidence of dependence. It’s important to interpret this correctly: the calculator’s “dependence hint” is based on the inputs you provide.
If the inputs are rounded or inconsistent, you might see a mismatch even if the real-world situation is nearly independent.
Consistency checks and common pitfalls
Joint and marginal probabilities must satisfy basic constraints. For example, \(P(A\cap B)\le P(B)\) and also \(P(A\cap B)\le P(A)\).
If your joint probability is larger than a marginal, the set of numbers cannot describe a valid probability model.
Another common mistake is confusing \(P(A\cap B)\) with \(P(A\mid B)\): the joint is usually smaller because it requires both events,
while the conditional can be larger or smaller than \(P(A)\) depending on whether \(B\) makes \(A\) more or less likely.
How to use this tool
Enter \(P(A\cap B)\) and \(P(B)\), then click Calculate to get \(P(A\mid B)\) as a decimal, percent, and (when possible) a simple fraction.
If you also provide \(P(A)\), the tool compares \(P(A\mid B)\) to \(P(A)\) to give an independence/dependence hint.
The interactive diagram shades \(B\) and highlights the overlap \(A\cap B\), illustrating that conditioning is a “within \(B\)” calculation.
Press Play to animate the shading in steps so the ratio interpretation is visually clear.