Skip to content

Mathematics · Ch 9 — Probability

Bayes' Theorem

9.4

Bayes' Theorem

Bayes' theorem (also called Bayes' law or Bayes' rule) is a direct extension of conditional probability that lets us go 'in reverse' - from knowing an outcome AA occurred, back to the probability that a particular underlying cause EiE_i produced it. It is especially useful for computing such posterior probabilities.

Theorem. If E1,E2,…,EnE_1,E_2,\ldots,E_n are mutually exclusive and exhaustive events with P(Ei)≠0P(E_i)\ne0 for each ii, and AA is any event (a subset of the union of the EiE_i) with P(A)>0P(A)>0, then P(Ei/A)=P(Ei)⋅P(A/Ei)∑i=1nP(Ei)⋅P(A/Ei).P(E_i/A)=\frac{P(E_i)\cdot P(A/E_i)}{\displaystyle\sum_{i=1}^{n}P(E_i)\cdot P(A/E_i)}.

Proof. Because the EiE_i are exhaustive, AA can be written as A=(A∩E1)∪(A∩E2)∪⋯∪(A∩En)A=(A\cap E_1)\cup(A\cap E_2)\cup\cdots\cup(A\cap E_n), and because the EiE_i are mutually exclusive, so are the pieces A∩EiA\cap E_i. Property 10 (additivity over mutually exclusive events) then gives P(A)=∑i=1nP(A∩Ei)P(A)=\sum_{i=1}^{n}P(A\cap E_i) - this is the law of total probability, used repeatedly to compute P(A)P(A) in every worked example below. By the multiplication theorem, each term is P(A∩Ei)=P(Ei)⋅P(A/Ei)P(A\cap E_i)=P(E_i)\cdot P(A/E_i), so P(A)=∑iP(Ei)P(A/Ei)P(A)=\sum_i P(E_i)P(A/E_i). Meanwhile P(Ei/A)=P(A∩Ei)/P(A)=P(Ei)P(A/Ei)/P(A)P(E_i/A)=P(A\cap E_i)/P(A)=P(E_i)P(A/E_i)/P(A); substituting the sum for P(A)P(A) in the denominator gives the theorem.

Three kinds of probability appear in the formula: the P(Ei)P(E_i) are prior probabilities, known before the experiment; the P(A/Ei)P(A/E_i) are likelihood probabilities, telling us how likely AA is under each possible cause EiE_i; and the P(Ei/A)P(E_i/A) are posterior probabilities, obtained only after the experiment (after AA is observed). …

Figure Fig9.2Bayes' theorem diagram for n = 3

What this figure shows. A diagram showing three mutually exclusive, exhaustive causes E1, E2, E3 each feeding into event A, illustrating how A splits into the disjoint pieces A intersect E1, A intersect E2, A intersect E3 that the proof sums over. …

Misc Ex1Transferring a ball between two bags

Worked out. A ball is moved from a first bag to a second bag without noting its colour, then a ball is drawn from the second bag; the law of total probability gives the probability the drawn ball is blue. …

Misc Ex2X, Y, Z becoming manager and introducing a bonus scheme

Worked out. Given the chances of three candidates becoming manager and their conditional probabilities of introducing a bonus scheme, finds the posterior probability that X is the manager given the bonus was introduced. …

Misc Ex3Rental cars needing repair by agency

Worked out. Given the market share of three car-rental agencies and their repair rates, finds the posterior probability a repaired car came from a specific agency. …