← Back to Statistics

Conditional probability and independence

Knowing that one event happened can change the probability of another. Conditional probability captures this, and independence describes when it does not.

Conditional probability

The probability of \(A\) given that \(B\) has occurred is \(P(A \mid B) = \frac{P(A \cap B)}{P(B)}\). We restrict attention to the outcomes in \(B\). If 30% of students take chemistry and 12% take both chemistry and physics, then among chemistry students, \(P(\text{physics} \mid \text{chemistry}) = \frac{0.12}{0.30} = 0.4\).

P(A \mid B) = \frac{P(A \cap B)}{P(B)}

The multiplication rule

Rearranging gives \(P(A \cap B) = P(B)\,P(A \mid B)\). Drawing two cards without replacement, the probability both are aces is \(\frac{4}{52} \cdot \frac{3}{51} \approx 0.0045\): the second probability is conditional on the first card being an ace.

Independence

Events are independent if knowing one happened does not change the probability of the other: \(P(A \mid B) = P(A)\). Then \(P(A \cap B) = P(A)P(B)\). Successive coin flips are independent. Drawing cards without replacement is not: removing an ace changes the chance of the next ace.

P(A \cap B) = P(A)\,P(B)

Independent versus mutually exclusive

These are often confused. Mutually exclusive events cannot both happen, so if one occurs the other's probability drops to 0: they are strongly dependent. Independent events can happen together and do not influence each other. Two events with positive probability cannot be both mutually exclusive and independent.

Tree diagrams

Tree diagrams organise multi-stage processes. Each branch carries a conditional probability; multiply along a path for a joint probability and add paths for an overall probability. They are especially helpful for medical testing problems.

Worked example: a medical test

A disease affects 1% of people. A test detects it 95% of the time when present and falsely signals it 5% of the time when absent. \(P(\text{positive}) = 0.01(0.95) + 0.99(0.05) = 0.059\). The probability that a positive tester actually has the disease is \(\frac{0.0095}{0.059} \approx 0.16\). Most positives are false because the disease is rare, a result that surprises many doctors.

Bayes' theorem

The calculation above is Bayes' theorem: \(P(A \mid B) = \frac{P(B \mid A)P(A)}{P(B)}\). It reverses a conditional probability, turning 'probability of a positive test given disease' into 'probability of disease given a positive test'. It underlies spam filters, diagnostics, and the Bayesian inference unit later in this course.

P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}

Common mistakes

Confusing \(P(A \mid B)\) with \(P(B \mid A)\), the 'prosecutor's fallacy'. Multiplying probabilities of dependent events as if they were independent. Treating mutually exclusive events as independent. Forgetting to update the total after drawing without replacement.

Key takeaways

Conditional probability restricts to the given event: \(P(A \cap B)/P(B)\). Multiply along branches with conditional probabilities. Independence means \(P(A \cap B) = P(A)P(B)\), which is different from mutual exclusivity. Bayes' theorem reverses conditional probabilities and explains why rare-disease tests produce many false positives.

Flashcard

P(A \mid B)

Probability of A given B

Equals P(A and B) divided by P(B).

Check your understanding

Two fair coins are flipped. Given that at least one is heads, what is the probability both are heads?

← Previous lesson Next lesson →