Conditional probability
The probability of A once you know B has happened: the share of B's outcomes that are also in A.
Calculator
The live calculator needs JavaScript. The worked example below shows the same steps it would.
See it move
- P(A ∪ B) = 0.3 + 0.4 − 0.12 = 0.58: the overlap is counted twice, so subtract it once.
- Neither A nor B: 0.42.
What the symbols mean
- the probability of A given B,
- the probability of both A and B
- the probability of B (must be greater than 0)
When to use it
Use it whenever extra information narrows the possibilities: the chance a card is a king given it is a heart, the chance a customer buys again given they bought once, readings from two-way tables. and are usually different numbers; Bayes' theorem converts one into the other.
Worked example
40% of households in a town own a dog, and 12% own both a dog and a cat. What is the probability that a dog-owning household also owns a cat?
Start from the formula.
Substitute = , = and work it out.
Answer P(cat | dog) = 0.3
Why it works
Knowing B happened shrinks the sample space to B. The outcomes where A also happens are , so the new probability is their share of B.
Common mistakes
- Dividing by P(A) instead of the probability of the condition, P(B).
- Swapping the condition: P(positive test | ill) is not P(ill | positive test).
- Using for the numerator when A and B are not independent.