New information changes probabilities. If you know a family owns a dog, the chance it also owns a cat is a different question from the chance a random family owns a cat. Conditional probability makes that precise, and it reuses the Venn diagram picture.
Key idea
The probability of A given B is $$P(A \mid B) = \dfrac{P(A \cap B)}{P(B)},$$ the fraction of B's outcomes that are also in A. With counts: $P(A \mid B) = \frac{\text{number in both}}{\text{number in } B}$.
Why it works
"Given B" means we now know we are somewhere inside B. Everything outside B is ruled out, so B becomes the new sample space. Within it, the outcomes where A also happens are exactly $A \cap B$. So the new probability is the size of $A \cap B$ compared with the size of B, not with the whole sample space.
Worked example: Counts
Of 200 households, 80 own a dog, 50 own a cat, and 20 own both. A dog-owning household is chosen at random. What is the probability it also owns a cat?
- Given "dog," the sample space shrinks to the 80 dog owners.
- Of those, 20 also own a cat.
- $P(\text{cat} \mid \text{dog}) = \dfrac{20}{80} = \dfrac{1}{4}$.
Answer: $\frac{1}{4}$
Worked example: The other direction
Using the same households, find $P(\text{dog} \mid \text{cat})$.
- Given "cat," use only the 50 cat owners.
- Of those, 20 own a dog: $\dfrac{20}{50} = \dfrac{2}{5}$.
- Same overlap, different condition, different answer: $\frac{1}{4} \ne \frac{2}{5}$.
Answer: $\frac{2}{5}$
Worked example: With probabilities
$P(B) = 0.4$ and $P(A \cap B) = 0.1$. Find $P(A \mid B)$.
- Divide the probability of both by the probability of the condition.
- $P(A \mid B) = \dfrac{0.1}{0.4} = 0.25$.
Answer: $0.25$
Common mistake
Confusing $P(A \mid B)$ with $P(B \mid A)$. The probability that a person who tested positive is sick is not the probability that a sick person tests positive. Check what comes after the bar: that event is the condition, and its total goes in the denominator.