Conditional independence: “independent once you know \(C\)”
In probability, two events \(A\) and \(B\) are independent if knowing that one happened does not change the probability of the other.
Formally, one common test is \(P(A\cap B)=P(A)P(B)\). In many real problems, however, there is a third event \(C\) that explains the connection between \(A\) and \(B\).
In that setting we use conditional independence, written \(A \perp B \mid C\).
It means that once we restrict attention to cases where \(C\) is known to hold, \(A\) and \(B\) behave independently.
The defining equality
The standard definition is:
\[
A \perp B \mid C
\quad\Longleftrightarrow\quad
P(A\cap B\mid C)=P(A\mid C)\,P(B\mid C),
\]
provided \(P(C)>0\) so that conditioning on \(C\) makes sense.
This equality is a “factorization” rule: the joint conditional probability on the left equals the product of the two conditional probabilities on the right.
Intuitively, within the world where \(C\) is true, the chance that both \(A\) and \(B\) happen is exactly what you would expect if they were unrelated.
How this differs from ordinary independence
Conditional independence is not the same as unconditional independence.
It is possible for \(A\) and \(B\) to be dependent overall but conditionally independent once \(C\) is fixed.
A classic example is a “common cause”: \(C\) influences both \(A\) and \(B\).
If you do not condition on \(C\), observing \(A\) provides information about \(C\), which in turn changes the likelihood of \(B\).
After conditioning on \(C\), that indirect pathway is removed, and the remaining relationship can become independent.
Conversely, there are situations where conditioning can create dependence (for example, conditioning on a common effect), so “adding conditions” does not always make events more independent.
Numerical checking and tolerance
In exact mathematics, the equality must hold exactly.
In computations and data-based estimates, you often compare values up to a small tolerance.
This tool computes the left-hand side \(P(A\cap B\mid C)\) and the right-hand side \(P(A\mid C)P(B\mid C)\), then reports the difference
\(\text{LHS}-\text{RHS}\). If the absolute difference is below the chosen tolerance, it reports that the condition holds (numerically).
If it fails, the calculator shows a direct counterexample by stating what value the left-hand side would need to be for conditional independence to hold.
How to use this tool
Enter three probabilities: \(P(A\mid C)\), \(P(B\mid C)\), and \(P(A\cap B\mid C)\).
Click Calculate to see a yes/no verdict, the computed product \(P(A\mid C)P(B\mid C)\), and a step-by-step verification of the defining identity.
The visualization is a conceptual “given \(C\)” diagram and a bar comparison of LHS vs RHS.
Press Play to animate the “given \(C\)” shading and the equality check, which helps you see conditional independence as a factorization test inside the conditioned scenario.