Mathematics · Glossary

What is Conditional probability?

Definition 32.1 High School Mathematics · Chapter 32 — Conditional Probability and Independence

Let BB be an event with P(B)>0\P(B) > 0. The probability of AA given BB is

PB ⁣(A)=P(AB)P(B).\pcond{B}{A} = \frac{\P(A \cap B)}{\P(B)} .
A two-level tree: multiply along a path, add over the leaves. For instance (A) is the sum of the first and third leaf probabilities.
A two-level tree: multiply along a path, add over the leaves. For instance P(A)\P(A) is the sum of the first and third leaf probabilities.

Examples

Example 32.6 (Screening test)

A disease affects 1%1\% of a population. A test detects it with probability 0.990.99 (sensitivity) and gives a false positive with probability 0.050.05. Given a positive test, the probability of actually having the disease is

0.01×0.990.01×0.99+0.99×0.05=0.00990.0099+0.0495=160.17.\frac{0.01 \times 0.99}{0.01\times0.99 + 0.99\times0.05} = \frac{0.0099}{0.0099 + 0.0495} = \frac{1}{6} \approx 0.17 .

Despite the accurate test, five positives out of six are false — because the disease is rare. Confusing PA ⁣(B)\pcond{A}{B} with PB ⁣(A)\pcond{B}{A} is the prosecutor’s fallacy.

Read in context →
Definition 21.10 University Mathematics — Year 2 · Chapter 21 — Probability on Countable Spaces

For events A,BA, B with P(B)>0\P(B) > 0, the conditional probability of AA given BB is

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

The map AP(AB)A \mapsto \P(A \mid B) is itself a probability measure on Ω\Omega.

Examples

Example 21.12 (Conditioning can create uniformity)

Roll two fair dice and condition on the sum being 77: for each k[ ⁣[1,6] ⁣]k \in \intint16,

P{S=7} ⁣(X=k)=P(X=k, Y=7k)P(S=7)=1/366/36=16:\pcond{\{S = 7\}}{X = k} = \frac{\P(X = k,\ Y = 7 - k)}{\P(S = 7)} = \frac{1/36}{6/36} = \frac16 :

given a sum of 77, the first die is exactly uniform — 77 is the only total compatible with every face, so the conditioning erases all information about XX. Any other total skews the law (given S=4S = 4, the first die is uniform on {1,2,3}\{1, 2, 3\} only). Computing a conditional law means renormalizing the joint weights along the conditioning event, nothing more.

Example 21.13 (The second draw is as good as the first)

An urn holds 33 white and 22 black balls; draw two without replacement. Everyone agrees P(W1)=35\P(W_1) = \frac35; what is P(W2)\P(W_2)? Total probability along the first draw:

P(W2)=PW1 ⁣(W2)P(W1)+PB1 ⁣(W2)P(B1)=2435+3425=1220=35:\P(W_2) = \pcond{W_1}{W_2}\,\P(W_1) + \pcond{B_1}{W_2}\,\P(B_1) = \frac24\cdot\frac35 + \frac34\cdot\frac25 = \frac{12}{20} = \frac35 :

exactly P(W1)\P(W_1). No computation was needed: by symmetry, every ball is equally likely to be the second one drawn, so the second draw — unconditionally — has the same law as the first. Conditioning on the first result changes the odds; not knowing it does not. This exchangeability argument returns in the next chapter for sampling without replacement, where it gives the hypergeometric mean npnp with no binomial identities at all.

Example 21.15 (The birthday collision, by the chain rule)

With nn people whose birthdays are independent and uniform over 365365 days, let Dn=D_n = {}“all nn birthdays differ”. Conditioning person by person (chain rule):

P(Dn)=k=1n1(1k365),\P(D_n) = \prod_{k=1}^{n-1}\Bigl(1 - \frac{k}{365}\Bigr),

each new person having to avoid the kk days already taken. For n=23n = 23: P(D23)0.493\P(D_{23}) \approx 0.493 — a shared birthday is already more likely than not. The heuristic that explains the smallness of 2323: taking logarithms, lnP(Dn)k<nk365=(n2)365-\ln \P(D_n) \approx \sum_{k<n}\frac k{365} = \frac{\binom n2}{365}, and (232)=253\binom{23}2 = 253 gives 253/3650.693ln2253/365 \approx 0.693 \approx \ln 2. What matters is the number of pairs, which grows quadratically: collision problems live on the scale n365n \sim \sqrt{365}, not n365n \sim 365 — the birthday paradox is a square root in disguise.

Read in context →