What Is Conditional Probability?
Conditional probability quantifies how the chance of one event changes given that a second event has occurred. Denoted P(A|B), it answers: "What is the probability of A, assuming B is true?" This differs fundamentally from joint probability, which measures both events occurring together.
The relationship between events matters. When event B provides information about event A—such as a positive medical test raising the likelihood of disease—the events are dependent, and conditional probability applies. Without this dependence, the conditional probability equals the unconditional probability.
- Notation: P(A|B) reads as "the probability of A given B"
- Real-world relevance: Assessing risk after new information arrives
- Key requirement: The conditioning event must have non-zero probability
Computing Conditional Probability
To find P(A|B), you need the joint probability of both events and the total probability of the conditioning event. The formula divides the intersection probability by the marginal probability:
P(A|B) = P(A ∩ B) / P(B)
P(B) = P(A ∩ B) + P(Ā ∩ B)
P(B) = P(A) × P(B|A) + P(Ā) × P(B|Ā)
P(A|B)— Conditional probability of A given B has occurredP(A ∩ B)— Joint probability that both A and B occurP(B)— Marginal or total probability of event BP(A)— Marginal probability of event AP(Ā)— Probability that event A does not occur (1 − P(A))
The Law of Total Probability
When computing conditional probabilities, you often must first calculate the total probability of your conditioning event. The law of total probability partitions the sample space into mutually exclusive, exhaustive categories and sums across them.
If event B can arise through either A or not-A occurring first, then:
- P(B) splits into two paths: one through A, one through its complement
- Each path's contribution is a product: the probability of the first event multiplied by the conditional probability of B given that first event
- This decomposition enables you to calculate P(A|B) even when you only know P(B|A) and prior probabilities
This principle underlies Bayesian inference, where prior beliefs and new evidence combine to form updated (posterior) probabilities.
A Medical Testing Example
Suppose a disease affects 2% of a population, and a diagnostic test has 95% sensitivity (true positive rate) and 90% specificity (true negative rate). Someone tests positive. What is the actual probability they carry the disease?
Using conditional probability:
- P(Disease): 0.02
- P(Positive | Disease): 0.95
- P(Positive | No Disease): 1 − 0.90 = 0.10
- P(Positive): (0.02 × 0.95) + (0.98 × 0.10) = 0.0190 + 0.0980 = 0.1170
- P(Disease | Positive): 0.0190 / 0.1170 ≈ 16.2%
Despite a positive test, the actual disease risk remains modest due to the disease's rarity in the population. This illustrates why conditional probability is essential in medicine: test accuracy alone misleads without considering baseline prevalence.
Common Pitfalls in Conditional Probability
Avoid these frequent errors when working with dependent events and Bayesian reasoning.
- Confusing P(A|B) with P(B|A) — The order matters. P(Disease | Positive test) is not the same as P(Positive test | Disease). The first asks how likely disease is given a positive result; the second asks how likely a positive is given disease. Always check which direction your question flows.
- Ignoring base rates — Focusing only on test accuracy while overlooking how rare or common an event is in the population leads to overestimating conditional probabilities. A 99% accurate test for a 0.1% event still produces many false positives. Always incorporate the prior probability.
- Assuming events are independent when they are not — Conditional probability applies only when events are dependent. If you assume independence wrongly, you'll multiply unconditional probabilities instead of using the correct formula, yielding incorrect results.
- Requiring non-zero conditioning probability — You cannot compute P(A | B) if P(B) = 0. The formula involves division by P(B), making it undefined when the conditioning event has zero probability. Ensure your conditioning event is possible.