Conditional probability describes how the probability of an event changes after information about another event is available.

Conditional probability

DefinitionConditional probability

For events AA and BB with P(B)>0P(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 definition immediately gives the multiplication rule

P(AB)=P(AB)P(B)=P(BA)P(A),P(A\cap B)=P(A\mid B)P(B)=P(B\mid A)P(A),

whenever both conditional probabilities are defined. Conditioning restricts attention to BB and renormalizes the probabilities inside that event.

TheoremLaw of total probability

If B1,,BnB_1,\ldots,B_n are pairwise disjoint events whose union is Ω\Omega, then

P(A)=i=1nP(ABi)P(Bi).P(A)=\sum_{i=1}^{n}P(A\mid B_i)P(B_i).

The events BiB_i form a partition of the sample space. The theorem is just the disjoint decomposition

A=i=1n(ABi)A=\bigcup_{i=1}^{n}(A\cap B_i)

followed by the multiplication rule.

TheoremBayes' theorem

For events AA and BB with positive denominators,

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

If B1,,BnB_1,\ldots,B_n is a partition, then

P(BjA)=P(ABj)P(Bj)i=1nP(ABi)P(Bi).P(B_j\mid A)= \frac{P(A\mid B_j)P(B_j)} {\sum_{i=1}^{n}P(A\mid B_i)P(B_i)}.

The numerator combines a prior probability P(Bj)P(B_j) with the likelihood P(ABj)P(A\mid B_j). The denominator normalizes over all possible explanations of the evidence AA.

ExampleA diagnostic test

Suppose a condition has prior probability P(D)=0.01P(D)=0.01, a test has sensitivity P(+D)=0.95P(+\mid D)=0.95, and its false-positive rate is P(+Dc)=0.05P(+\mid D^c)=0.05. Then

P(+)=0.95(0.01)+0.05(0.99)=0.059,P(+)=0.95(0.01)+0.05(0.99)=0.059,

and Bayes’ theorem gives

P(D+)=0.95(0.01)0.0590.161.P(D\mid +)=\frac{0.95(0.01)}{0.059}\approx0.161.

Even a fairly accurate test can have a modest positive predictive value when the condition is rare.

Independence

DefinitionIndependent events

Events AA and BB are independent if

P(AB)=P(A)P(B).P(A\cap B)=P(A)P(B).

If P(B)>0P(B)>0, this is equivalent to P(AB)=P(A)P(A\mid B)=P(A).

Independence means that learning whether one event occurred does not change the probability of the other. It is stronger than being disjoint. If AA and BB are disjoint and both have positive probability, they cannot be independent because P(AB)=0P(A\cap B)=0 while P(A)P(B)>0P(A)P(B)>0.

For independent events, complements preserve independence. For example, if AA and BB are independent, then AcA^c and BB are independent because

P(AcB)=P(B)P(AB)=P(B)(1P(A))=P(Ac)P(B).P(A^c\cap B)=P(B)-P(A\cap B)=P(B)(1-P(A))=P(A^c)P(B).

Sequential conditioning

For events A1,,AnA_1,\ldots,A_n with positive conditioning probabilities, repeated use of the multiplication rule gives the chain rule

P(i=1nAi)=P(A1)P(A2A1)P(A3A1A2)P(Ani=1n1Ai).P\left(\bigcap_{i=1}^{n}A_i\right) =P(A_1)P(A_2\mid A_1)P(A_3\mid A_1\cap A_2)\cdots P\left(A_n\mid\bigcap_{i=1}^{n-1}A_i\right).

This identity is useful for sequential experiments and for probabilistic models that factor a joint distribution into local conditional distributions.

Remark

Pairwise independence does not necessarily imply mutual independence. For three or more events, mutual independence requires the product identity for every nonempty subcollection, not only for each pair.