An experiment whose outcome cannot be predicted with certainty in advance, although the set of all possible outcomes is known, is called a random experiment (or a trial).
Tossing a fair coin: outcomes = {Head, Tail}. We don't know in advance which one will occur.
Drawing a card from a well-shuffled pack: outcomes = 52 cards. The drawn card cannot be predicted.
The set of all possible outcomes of a random experiment is called the sample space.
Tossing two coins: \(S = \{HH, HT, TH, TT\}\); \(|S|=4\).
Throwing a die: \(S = \{1,2,3,4,5,6\}\); \(|S|=6\).
An event is any subset of the sample space \(S\).
Throwing one die. \(A\) = "even number", \(B\) = "odd number". \(A \cap B = \varnothing\); they are mutually exclusive and also exhaustive.
Drawing one card from a pack: each of the 52 cards is an equally likely outcome.
An experiment is any activity that produces a result, called its outcome: tossing a coin, measuring the length of a table.
Probability is about random experiments only. A deterministic experiment has a single possible outcome, which happens with certainty, so there is nothing to measure.
A trial is one performance of the experiment. Tossing three coins once is one trial of the experiment “toss three coins”; drawing one card from a pack is one trial of “draw a card”. If three players A, B and C play a game, the sample space of “who wins” is \(S = \{A, B, C\}\).
The theory of probability began in the 17th century with problems of gambling on dice, in the correspondence of Blaise Pascal and Pierre de Fermat (1654). James (Jacob) Bernoulli's Ars Conjectandi (published in 1713, after his death) proved the first law of large numbers, and Abraham De Moivre's The Doctrine of Chances appeared in 1718. Bayes, Laplace, Chebyshev, Markov, Lyapunov, Lévy, von Mises, Fisher and Khinchin developed it further, and in 1933 Kolmogorov gave it the axioms of §2.3.
If a random experiment has \(n\) mutually exclusive, exhaustive and equally likely outcomes, of which \(m\) are favourable to event \(A\), then
Limitations: assumes all outcomes equally likely; fails when \(n\) is infinite or outcomes are not equally likely.
Probability of getting a king from a pack of 52 cards.
Favourable = 4 kings, total = 52. \(P(K) = 4/52 = 1/13\).
Probability of getting a sum of 7 on two dice.
Total outcomes = 36. Favourable: (1,6),(2,5),(3,4),(4,3),(5,2),(6,1) = 6. \(P = 6/36 = 1/6\).
If a random experiment is repeated \(N\) times under identical conditions and event \(A\) occurs \(m\) times, then
A coin is tossed 10 000 times and 5 037 heads are observed. The empirical probability of head is \(5037/10000 = 0.5037\), close to the theoretical value 0.5.
From last 1 000 customers, 320 ordered tea. Empirical probability that a new customer orders tea = 0.32.
Let \(S\) be a sample space and \(\mathcal{F}\) a \(\sigma\)-field of events. A probability measure \(P\) is a function \(P : \mathcal{F} \to \mathbb{R}\) satisfying three axioms:
For an infinite sample space the third axiom is required for every sequence \(E_1, E_2, \ldots\) of mutually disjoint events (countable additivity); the finite form is the case \(E_{n+1} = E_{n+2} = \cdots = \varnothing\).
When \(S\) is finite (or countable), \(\mathcal{B}\) can be the class of all subsets of \(S\), and every subset is an event. That is the setting of every problem on this page.
Result 1: \(P(\varnothing) = 0\). \(S = S \cup \varnothing\), and \(S\) and \(\varnothing\) are disjoint, so by additivity and certainty
\[ 1 = P(S) = P(S) + P(\varnothing) = 1 + P(\varnothing) \quad\Rightarrow\quad P(\varnothing) = 0 . \]Result 2: \(P(\bar A) = 1 - P(A)\). \(A \cup \bar A = S\) with \(A\) and \(\bar A\) disjoint, so \(P(A) + P(\bar A) = P(S) = 1\).
Result 3: \(P(\bar A \cap B) = P(B) - P(A \cap B)\). Split \(B\) by whether \(A\) happens: \(B = (A \cap B) \cup (\bar A \cap B)\), a union of two disjoint events (Fig 1.1, in §5). By additivity \(P(B) = P(A \cap B) + P(\bar A \cap B)\); subtract. In the same way, \(P(A \cap \bar B) = P(A) - P(A \cap B)\).
Monotonicity. If \(A \subset B\) then \(A \cap B = A\), and Result 3 gives \(P(B) - P(A) = P(\bar A \cap B) \ge 0\). In particular \(A \subset S\) gives \(0 \le P(A) \le 1\).
Result 9: \(P(A \cap B) \le P(A) \le P(A \cup B) \le P(A) + P(B)\).
Putting (1), (3) and (4) together gives the chain.
When the outcome is a point chosen "at random" in a region \(S\) of a line, plane or space, equally likely outcomes are replaced by equal measure: the probability of falling in a part \(A\) of \(S\) is \(P(A) = \dfrac{\text{length (area, volume) of } A}{\text{length (area, volume) of } S}\). This is the classical definition with counting replaced by measuring, and it satisfies the axioms.
Two friends each arrive at a random time between 5:00 and 6:00 and wait 15 minutes for the other. With arrival times \(x, y\) in minutes, the sample space is the square \([0,60]^{2}\) and they meet if \(|x - y| \le 15\). The two corner triangles where they miss each have legs of 45, so
\[ P(\text{meet}) = 1 - \frac{45^{2}}{60^{2}} = 1 - \frac{9}{16} = \frac{7}{16} = 0.4375. \]The conditional probability of event \(A\) given that event \(B\) has occurred (\(P(B) > 0\)) is
A die is rolled. Given that the outcome is even, what is the probability that it is 4?
\(B\) = even = {2,4,6}; \(A \cap B\) = {4}.
\(P(A|B) = (1/6)/(3/6) = 1/3\).
In a class of 60 students, 30 study Math, 24 study Statistics and 12 study both.
Find probability that a randomly selected student studies Statistics, given that he studies Math.
\(P(\text{Stat}|\text{Math}) = P(\text{Stat} \cap \text{Math})/P(\text{Math}) = (12/60)/(30/60) = 12/30 = 0.40\).
When the \(n(S)\) outcomes are equally likely, \(P(E) = n(E)/n(S)\) for every event, and the definition becomes a count:
\[ P(A \mid B) = \frac{P(A \cap B)}{P(B)} = \frac{n(A \cap B)/n(S)}{n(B)/n(S)} = \frac{n(A \cap B)}{n(B)} . \]The \(n(S)\) cancels: once \(B\) is known to have happened, \(B\) is the new sample space, and \(A\) is favoured by the outcomes of \(B\) that are also in \(A\). In Example 1 above, \(n(A \cap B) = 1\) and \(n(B) = 3\), so \(P(A \mid B) = 1/3\) at once. The counting form holds only for equally likely outcomes; the ratio of probabilities holds always.
For a fixed event \(C\) with \(P(C) > 0\), \(P(\,\cdot \mid C)\) obeys the same rules as \(P\).
Result 4: \(P(A \cup B \mid C) = P(A \mid C) + P(B \mid C) - P(A \cap B \mid C)\). By the distributive law \((A \cup B) \cap C = (A \cap C) \cup (B \cap C)\). Apply the addition theorem to the events \(A \cap C\) and \(B \cap C\), whose intersection is \((A \cap C) \cap (B \cap C) = A \cap B \cap C\):
\[ P[(A \cup B) \cap C] = P(A \cap C) + P(B \cap C) - P(A \cap B \cap C) . \]Divide every term by \(P(C)\); each ratio is a conditional probability.
Result 5: \(P(A \cap \bar B \mid C) + P(A \cap B \mid C) = P(A \mid C)\). By the definition of conditional probability,
\[ \begin{aligned} P(A \cap \bar B \mid C) + P(A \cap B \mid C) &= \frac{P(A \cap \bar B \cap C)}{P(C)} + \frac{P(A \cap B \cap C)}{P(C)} = \frac{P(A \cap C)}{P(C)} \\ &= P(A \mid C), \end{aligned} \]because \(A \cap \bar B \cap C\) and \(A \cap B \cap C\) are disjoint and together make up \(A \cap C\), so their probabilities add to \(P(A \cap C)\).
Two events \(A\) and \(B\) are independent if the occurrence of one does not affect the probability of the other:
Equivalently, \(P(A|B) = P(A)\) and \(P(B|A) = P(B)\), provided both probabilities are positive.
For three events \(A,B,C\) — mutual independence requires:
Two coins are tossed. \(A\) = "first coin H", \(B\) = "second coin H". \(P(A)=P(B)=1/2\), \(P(A \cap B) = 1/4 = P(A)P(B)\). Independent ✓.
A die is rolled. \(A\) = "even", \(B\) = "≥ 4".
\(P(A) = 1/2,\; P(B) = 1/2,\; A \cap B = \{4,6\},\; P(A \cap B) = 2/6 = 1/3\).
\(P(A)P(B) = 1/4 \ne 1/3\). Hence not independent.
The two forms of the definition agree: if \(P(B \mid A) = P(B)\), the multiplication theorem (§6) gives \(P(A \cap B) = P(A)P(B \mid A) = P(A)P(B)\), and in the same way \(P(A \mid B) = P(A)\) gives the product. If \(A\) and \(B\) are independent, so are their complements, in every combination.
Result 6: \(A\) and \(\bar B\). By Result 3 and independence,
\[ \begin{aligned} P(A \cap \bar B) &= P(A) - P(A \cap B) = P(A) - P(A)P(B) = P(A)\,[1 - P(B)] \\ &= P(A)\,P(\bar B) . \end{aligned} \]Result 7: \(\bar A\) and \(B\). The same with the roles exchanged: \(P(\bar A \cap B) = P(B) - P(A)P(B) = P(B)\,P(\bar A)\).
Result 8: \(\bar A\) and \(\bar B\). By De Morgan's law \(\bar A \cap \bar B = \overline{A \cup B}\), so
\[ \begin{aligned} P(\bar A \cap \bar B) &= 1 - P(A \cup B) = 1 - P(A) - P(B) + P(A)P(B) \\ &= [1 - P(A)]\,[1 - P(B)] = P(\bar A)\,P(\bar B) . \end{aligned} \]The last step is the factorisation \(1 - a - b + ab = (1 - a)(1 - b)\).
Independent is not the same as mutually exclusive. If \(A\) and \(B\) are mutually exclusive with \(P(A), P(B) > 0\), then \(P(A \cap B) = 0 \ne P(A)P(B)\): knowing that \(A\) happened tells you that \(B\) did not, so they are dependent.
If \(A,B\) are mutually exclusive: \(P(A \cup B) = P(A) + P(B)\).
From a deck, find the probability of drawing a king or a heart.
\(P(K) = 4/52,\; P(H) = 13/52,\; P(K \cap H) = 1/52\).
\(P(K \cup H) = 4/52 + 13/52 - 1/52 = 16/52 = 4/13\).
Probability that a student passes Math is 0.7, Physics 0.6 and both 0.5. Probability of passing at least one = 0.7 + 0.6 − 0.5 = 0.8.
Write \(A \cup B\) as the union of two disjoint events, \(A\) and \(\bar A \cap B\) (Fig 1.1):
\[ A \cup B = A \cup (\bar A \cap B) \quad\Rightarrow\quad P(A \cup B) = P(A) + P(\bar A \cap B) \]by additivity. Add and subtract \(P(A \cap B)\):
\[ \begin{aligned} P(A \cup B) &= P(A) + P(\bar A \cap B) + P(A \cap B) - P(A \cap B) \\ &= P(A) + P[(\bar A \cap B) \cup (A \cap B)] \\ &\quad - P(A \cap B) \qquad [\bar A \cap B \text{ and } A \cap B \text{ are disjoint}] \\ &= P(A) + P(B) - P(A \cap B) \qquad [B = (\bar A \cap B) \cup (A \cap B), \text{ Fig 1.1}] . \end{aligned} \]Hence \(P(A \cup B) = P(A) + P(B) - P(A \cap B)\). \(\square\)
In words: adding \(P(A)\) and \(P(B)\) counts the overlap \(A \cap B\) twice, so it is taken away once.
Statement. For \(n\) events \(A_1, A_2, \ldots, A_n\),
\[ \begin{aligned} P\!\left(\bigcup_{i=1}^{n} A_i\right) &= \sum_{i=1}^{n} P(A_i) - \mathop{\sum\sum}_{1 \le i < j \le n} P(A_i \cap A_j) \\ &\quad + \mathop{\sum\sum\sum}_{1 \le i < j < k \le n} P(A_i \cap A_j \cap A_k) - \cdots + (-1)^{n-1} P(A_1 \cap A_2 \cap \cdots \cap A_n) . \end{aligned} \]Proof, by mathematical induction. For two events,
\[ P(A_1 \cup A_2) = P(A_1) + P(A_2) - P(A_1 \cap A_2) , \qquad \ldots(1) \]so the theorem is true for \(n = 2\). Suppose it is true for \(n = r\):
\[ \begin{gathered} \begin{aligned} P\!\left(\bigcup_{i=1}^{r} A_i\right) &= \sum_{i=1}^{r} P(A_i) - \mathop{\sum\sum}_{1 \le i < j \le r} P(A_i \cap A_j) \\ &\quad + \cdots + (-1)^{r-1} P(A_1 \cap A_2 \cap \cdots \cap A_r) . \end{aligned} \qquad \ldots(2) \end{gathered} \]We have to prove it for \(n = r + 1\). Apply (1) to the two events \(\bigcup_{i=1}^{r} A_i\) and \(A_{r+1}\):
\[ P\!\left(\bigcup_{i=1}^{r+1} A_i\right) = P\!\left[\left(\bigcup_{i=1}^{r} A_i\right) \cup A_{r+1}\right] = P\!\left(\bigcup_{i=1}^{r} A_i\right) + P(A_{r+1}) - P\!\left[\bigcup_{i=1}^{r} (A_i \cap A_{r+1})\right] , \]where the distributive law gives \(\left(\bigcup_{i=1}^{r} A_i\right) \cap A_{r+1} = \bigcup_{i=1}^{r} (A_i \cap A_{r+1})\). Using (2) for the first union,
\[ \begin{aligned} P\!\left(\bigcup_{i=1}^{r+1} A_i\right) &= \sum_{i=1}^{r+1} P(A_i) - \mathop{\sum\sum}_{1 \le i < j \le r} P(A_i \cap A_j) + \cdots + (-1)^{r-1} P(A_1 \cap \cdots \cap A_r) \\ &\quad - P\!\left[\bigcup_{i=1}^{r} (A_i \cap A_{r+1})\right] , \end{aligned} \]the term \(P(A_{r+1})\) joining the first sum. The last union is again a union of \(r\) events, \(A_1 \cap A_{r+1}, \ldots, A_r \cap A_{r+1}\), so (2) applies to it too:
\[ \begin{aligned} P\!\left(\bigcup_{i=1}^{r+1} A_i\right) &= \sum_{i=1}^{r+1} P(A_i) - \mathop{\sum\sum}_{1 \le i < j \le r} P(A_i \cap A_j) + \cdots \\ &\quad + (-1)^{r-1} P(A_1 \cap \cdots \cap A_r) \\ &\quad - \bigg[\sum_{i=1}^{r} P(A_i \cap A_{r+1}) - \mathop{\sum\sum}_{1 \le i < j \le r} P[(A_i \cap A_{r+1}) \cap (A_j \cap A_{r+1})] \\ &\qquad + \cdots + (-1)^{r-1} P[(A_1 \cap A_{r+1}) \cap \cdots \cap (A_r \cap A_{r+1})]\bigg] \\ &= \sum_{i=1}^{r+1} P(A_i) - \mathop{\sum\sum}_{1 \le i < j \le r} P(A_i \cap A_j) + \cdots \\ &\quad + (-1)^{r-1} P(A_1 \cap \cdots \cap A_r) \\ &\quad - \bigg[\sum_{i=1}^{r} P(A_i \cap A_{r+1}) - \mathop{\sum\sum}_{1 \le i < j \le r} P(A_i \cap A_j \cap A_{r+1}) \\ &\qquad + \cdots + (-1)^{r-1} P(A_1 \cap A_2 \cap \cdots \cap A_r \cap A_{r+1})\bigg] . \end{aligned} \]Now collect terms of the same order. The pairs \(P(A_i \cap A_{r+1})\) from the bracket, which enter with a minus sign, are exactly the pairs with \(j = r + 1\) missing from \(\sum\sum_{1 \le i < j \le r}\); together they make the sum over \(1 \le i < j \le r + 1\). In the same way the triples \(P(A_i \cap A_j \cap A_{r+1})\), now with a plus sign, complete the triple sum, and so on; the last term, \(-(-1)^{r-1} = (-1)^{r}\) times \(P(A_1 \cap \cdots \cap A_{r+1})\), stands alone. So
\[ \begin{aligned} P\!\left(\bigcup_{i=1}^{r+1} A_i\right) &= \sum_{i=1}^{r+1} P(A_i) - \mathop{\sum\sum}_{1 \le i < j \le r+1} P(A_i \cap A_j) + \mathop{\sum\sum\sum}_{1 \le i < j < k \le r+1} P(A_i \cap A_j \cap A_k) \\ &\quad - \cdots + (-1)^{r+1-1} P(A_1 \cap A_2 \cap \cdots \cap A_{r+1}) . \end{aligned} \]Hence the theorem is true for \(n = r + 1\), and by mathematical induction it is true for all \(n\). \(\square\)
If \(A,B\) are independent: \(P(A \cap B) = P(A) P(B)\).
If events are mutually independent: \(P\!\left(\bigcap A_i\right) = \prod P(A_i)\).
Two cards are drawn one after another without replacement. Probability both are aces.
\(P(A_1) = 4/52,\; P(A_2|A_1) = 3/51\). \(P(A_1 \cap A_2) = (4/52)(3/51) = 1/221\).
Probability of three independent machines functioning is 0.9, 0.8, 0.7. Probability all three function = 0.9 × 0.8 × 0.7 = 0.504.
Let \(n(S)\) be the total number of (equally likely) outcomes in the sample space, \(n(A)\) and \(n(B)\) the numbers favourable to \(A\) and \(B\), and \(n(A \cap B)\) the number favourable to \(A \cap B\). By the definition of probability,
\[ \begin{gathered} P(A) = \frac{n(A)}{n(S)}, \quad P(B) = \frac{n(B)}{n(S)}, \quad P(A \cap B) = \frac{n(A \cap B)}{n(S)}, \\ P(A \mid B) = \frac{n(A \cap B)}{n(B)}, \quad P(B \mid A) = \frac{n(A \cap B)}{n(A)} . \end{gathered} \]Consider \(P(A \cap B) = n(A \cap B)/n(S)\) and multiply and divide by \(n(B)\):
\[ \begin{gathered} P(A \cap B) = \frac{n(A \cap B)}{n(S)} \cdot \frac{n(B)}{n(B)} = \frac{n(B)}{n(S)} \cdot \frac{n(A \cap B)}{n(B)} = P(B)\,P(A \mid B), \\ P(B) > 0 . \end{gathered} \]Now multiply and divide by \(n(A)\) instead:
\[ \begin{gathered} P(A \cap B) = \frac{n(A \cap B)}{n(S)} \cdot \frac{n(A)}{n(A)} = \frac{n(A)}{n(S)} \cdot \frac{n(A \cap B)}{n(A)} = P(A)\,P(B \mid A), \\ P(A) > 0 . \;\square \end{gathered} \]When the outcomes are not equally likely, the theorem follows directly from the definition \(P(B \mid A) = P(A \cap B)/P(A)\), multiplied through by \(P(A)\).
\(n = 2\): \(P(A_1 \cap A_2) = P(A_1)\,P(A_2 \mid A_1)\), the theorem above. …(1)
\(n = 3\): by (1), applied to \(A_1\) and \(A_2 \cap A_3\), and then to \(A_2\) and \(A_3\) given \(A_1\),
\[ \begin{aligned} P(A_1 \cap A_2 \cap A_3) &= P[A_1 \cap (A_2 \cap A_3)] = P(A_1)\,P(A_2 \cap A_3 \mid A_1) \\ &= P(A_1)\,P(A_2 \mid A_1)\,P(A_3 \mid A_1 \cap A_2) . \end{aligned} \]From \(r\) to \(r + 1\): suppose the theorem is true for \(n = r\) …(2). Treat \(A_1 \cap \cdots \cap A_r\) as one event and apply (1), then (2):
\[ \begin{aligned} P(A_1 \cap \cdots \cap A_r \cap A_{r+1}) &= P(A_1 \cap \cdots \cap A_r)\; P(A_{r+1} \mid A_1 \cap \cdots \cap A_r) \\ &= P(A_1)\, P(A_2 \mid A_1) \cdots P(A_r \mid A_1 \cap \cdots \cap A_{r-1}) \\ &\quad \times P(A_{r+1} \mid A_1 \cap \cdots \cap A_r) . \end{aligned} \]So the theorem holds for \(r + 1\) events, and by induction for all \(n\). The condition \(P(A_1 \cap \cdots \cap A_{n-1}) > 0\) makes every conditional probability in the product defined. \(\square\)
For any events \(A_1, A_2, \ldots, A_n\) (not necessarily disjoint or independent):
(i)
\[ P\!\left(\bigcap_{i=1}^{n} A_i\right) \;\ge\; \sum_{i=1}^{n} P(A_i) - (n - 1) \](ii)
\[ P\!\left(\bigcup_{i=1}^{n} A_i\right) \;\le\; \sum_{i=1}^{n} P(A_i) \]Since \(P(\bar A_i) = 1 - P(A_i)\), form (i) can also be written \(P\!\left(\bigcap A_i\right) \ge 1 - \sum P(\bar A_i)\) (Bonferroni's form).
If \(P(A) = 0.4, P(B) = 0.5, P(C) = 0.3\), then \(P(A \cup B \cup C) \le 0.4 + 0.5 + 0.3 = 1.2\) (so at most 1).
If three events have probabilities 0.05, 0.04, 0.03 (rare failures), the probability that at least one occurs is at most 0.12. This is widely used in reliability engineering.
(i) \(P\!\left(\bigcap_{i=1}^{n} A_i\right) \ge \sum_{i=1}^{n} P(A_i) - (n - 1)\). By mathematical induction. For \(n = 2\),
\[ \begin{aligned} &P(A_1 \cup A_2) \le 1 \\ &P(A_1) + P(A_2) - P(A_1 \cap A_2) \le 1 \\ &P(A_1) + P(A_2) - 1 \le P(A_1 \cap A_2) \\ &P(A_1 \cap A_2) \ge P(A_1) + P(A_2) - 1 , \qquad \ldots(1) \end{aligned} \]so the theorem is true for \(n = 2\). Suppose it is true for \(n = r\): \(P\!\left(\bigcap_{i=1}^{r} A_i\right) \ge \sum_{i=1}^{r} P(A_i) - (r - 1)\) …(2). For \(n = r + 1\),
\[ \begin{aligned} P\!\left(\bigcap_{i=1}^{r+1} A_i\right) &= P\!\left(\bigcap_{i=1}^{r} A_i \cap A_{r+1}\right) \\ &\ge P\!\left(\bigcap_{i=1}^{r} A_i\right) + P(A_{r+1}) - 1 && [\text{from (1)}] \\ &\ge \sum_{i=1}^{r} P(A_i) - (r - 1) + P(A_{r+1}) - 1 && [\text{from (2)}] \\ &= \sum_{i=1}^{r+1} P(A_i) - (r + 1 - 1) . \end{aligned} \]So the theorem is true for \(n = r + 1\), and by induction for all \(n\).
(ii) \(P\!\left(\bigcup_{i=1}^{n} A_i\right) \le \sum_{i=1}^{n} P(A_i)\). By mathematical induction. For \(n = 2\),
\[ \begin{gathered} P(A_1 \cup A_2) = P(A_1) + P(A_2) - P(A_1 \cap A_2) \le P(A_1) + P(A_2) \\ [P(A_1 \cap A_2) \ge 0] \quad \ldots(1) \end{gathered} \]Suppose it is true for \(n = r\): \(P\!\left(\bigcup_{i=1}^{r} A_i\right) \le \sum_{i=1}^{r} P(A_i)\) …(2). Then
\[ \begin{aligned} P\!\left(\bigcup_{i=1}^{r+1} A_i\right) = P\!\left(\bigcup_{i=1}^{r} A_i \cup A_{r+1}\right) &\le P\!\left(\bigcup_{i=1}^{r} A_i\right) + P(A_{r+1}) && [\text{from (1)}] \\ &\le \sum_{i=1}^{r} P(A_i) + P(A_{r+1}) && [\text{from (2)}] \\ &= \sum_{i=1}^{r+1} P(A_i) . \end{aligned} \]So the theorem is true for \(n = r + 1\), and by induction for all \(n\). \(\square\)
Let \(B_1, B_2, \ldots, B_n\) be mutually exclusive and exhaustive events (a partition of \(S\)) with \(P(B_i) > 0\), and let \(A\) be any event with \(P(A) > 0\).
Prior \(P(B_k)\) updated by data \(A\) gives the posterior \(P(B_k|A)\).
Bayes' theorem is just conditional probability with its numerator and denominator each rewritten:
\[ P(B_k \mid A) = \frac{P(B_k \cap A)}{P(A)} = \frac{\overbrace{P(B_k)P(A\mid B_k)}^{\text{multiplication rule}}} {\underbrace{\sum_i P(B_i)P(A\mid B_i)}_{\text{total probability}}}. \]
The numerator is the multiplication theorem (Section 6); the denominator is the total-probability law above. Bayes therefore introduces nothing new — it reverses the conditioning from \(P(A\mid B_k)\) (which we can measure) to \(P(B_k\mid A)\) (which we want).
Three machines \(M_1,M_2,M_3\) produce 25 %, 35 %, 40 % of items with defective rates 5 %, 4 %, 2 % respectively. A random item is found defective. Find probability it came from \(M_1\).
\[ \begin{aligned} P(D) &= 0.25(0.05) + 0.35(0.04) + 0.40(0.02) = 0.0125 + 0.0140 + 0.0080 \\ &= 0.0345 \end{aligned} \].
\(P(M_1 | D) = 0.0125 / 0.0345 = 0.362\) (≈ 36.2 %).
1 % of population has a disease. Test sensitivity = 0.99 (true positive), false-positive rate = 0.05. Given a positive test, what is the probability the person has the disease?
\(P(D|+) = \dfrac{(0.01)(0.99)}{(0.01)(0.99) + (0.99)(0.05)} = \dfrac{0.0099}{0.0594} \approx 0.167\).
Despite the test being 99 % sensitive, only ~17 % of positives are truly diseased — the rare base rate matters!
Statement. If \(E_1, E_2, \ldots, E_n\) are \(n\) mutually disjoint events with \(P(E_i) \ne 0\), \(i = 1, 2, \ldots, n\), then for any event \(A\) which is a subset of \(\bigcup_{i=1}^{n} E_i\) and has \(P(A) > 0\),
\[ P(E_i \mid A) = \frac{P(E_i)\,P(A \mid E_i)}{\sum_{j=1}^{n} P(E_j)\,P(A \mid E_j)}, \qquad i = 1, 2, \ldots, n . \](A partition of \(S\) satisfies the condition for every \(A\).)
Step 1: split \(A\). Since \(A \subset \bigcup_i E_i\),
\[ A = A \cap \bigcup_{i=1}^{n} E_i = (A \cap E_1) \cup (A \cap E_2) \cup \cdots \cup (A \cap E_n), \]by the distributive law. The \(E_i\) are disjoint, so the pieces \(A \cap E_i\) are disjoint too.
Step 2: total probability. By additivity, then the multiplication theorem \(P(A \cap E_i) = P(E_i)\,P(A \mid E_i)\),
\[ P(A) = \sum_{i=1}^{n} P(A \cap E_i) = \sum_{i=1}^{n} P(E_i)\,P(A \mid E_i) . \qquad \ldots(1) \]Step 3. By the definition of conditional probability, the multiplication theorem in the numerator and (1) in the denominator,
\[ P(E_i \mid A) = \frac{P(A \cap E_i)}{P(A)} = \frac{P(E_i)\,P(A \mid E_i)}{\sum_{j=1}^{n} P(E_j)\,P(A \mid E_j)}, \qquad i = 1, \ldots, n . \;\square \]Twenty-two problems: nine on the classical definition, four on the addition theorem, six on the multiplication theorem and independence, and three on Bayes' theorem, followed by exercises with answers. Each one names its sample space, counts (or multiplies) the favourable cases, and states the answer as a fraction in lowest terms. The counting tools are the ones from algebra: \(^{n}C_r = \binom{n}{r}\) ways to choose \(r\) things from \(n\), and \(n!\) ways to arrange \(n\) different things. Where a sample space is small enough to list, the count has been checked by listing it.
Three coins are tossed. Find the probability of at least two heads.
\(S = \{HHH, HHT, HTH, THH, HTT, THT, TTH, TTT\}\), \(n = 8\) equally likely outcomes. Let \(E\) = at least two heads \(= \{HHH, HHT, HTH, THH\}\), \(m = 4\).
\[ P(E) = \frac{4}{8} = \dfrac{1}{2} . \]By symmetry this had to be \(\tfrac12\): “at least two heads” and “at least two tails” are complements, and swapping H and T maps one onto the other.
Two dice are thrown. Find the probability that the sum is 8.
Each die has 6 faces, so \(n = 6 \times 6 = 36\) ordered pairs. Sum 8: \(E = \{(2,6), (3,5), (4,4), (5,3), (6,2)\}\), \(m = 5\).
\[ P(E) = \frac{5}{36} = \dfrac{5}{36} . \]Note that \((2,6)\) and \((6,2)\) are different outcomes: the dice are told apart (say, red and blue), which is what makes the 36 outcomes equally likely.
A bag contains 4 red, 5 green and 6 yellow balls. Two balls are drawn. Find the probability that they are one green and one red.
15 balls; two can be chosen in \(n = \binom{15}{2} = \dfrac{15 \times 14}{2} = 105\) ways. One green from 5 and one red from 4: \(m = \binom{5}{1}\binom{4}{1} = 5 \times 4 = 20\).
\[ P(E) = \frac{20}{105} = \dfrac{4}{21} . \]Two cards are drawn from a well-shuffled pack of 52. Find the probability that they are (i) two hearts, (ii) a jack and a ten.
\(n = \binom{52}{2} = \dfrac{52 \times 51}{2} = 1326\).
(i) Two of the 13 hearts: \(m = \binom{13}{2} = 78\), so \(P = \dfrac{78}{1326} = \dfrac{1}{17}\).
(ii) One of 4 jacks and one of 4 tens: \(m = \binom41\binom41 = 16\), so \(P = \dfrac{16}{1326} = \dfrac{8}{663}\).
Check of (i) by the multiplication theorem (§6): \(\dfrac{13}{52} \times \dfrac{12}{51} = \dfrac{1}{17}\).
Find the probability that a leap year has 53 Fridays.
366 days \(= 52\) weeks \(+ 2\) days. The 52 weeks give 52 Fridays whatever happens; a 53rd needs one of the two extra, consecutive days to be a Friday. The pair can be
(Sun, Mon), (Mon, Tue), (Tue, Wed), (Wed, Thu), (Thu, Fri), (Fri, Sat), (Sat, Sun),
\(n = 7\), taken as equally likely. Two contain a Friday: (Thu, Fri) and (Fri, Sat), so \(m = 2\) and
\[ P = \frac{2}{7} . \]The model takes the year to start on any day of the week with equal chance; any named day gives the same \(\tfrac27\).
Four-digit numbers are formed from the digits 0, 1, 2, 3, 5, 7, no digit repeated. Find the probability that the number ends in 5.
The first digit cannot be 0: 5 choices, then 5, 4 and 3 for the remaining places, so \(n = 5 \times 5 \times 4 \times 3 = 300\).
Fix 5 in the units place. The first digit is now one of 1, 2, 3, 7 (4 choices, still not 0), then 4 and 3 choices for the middle places: \(m = 4 \times 4 \times 3 = 48\).
\[ P = \frac{48}{300} = \dfrac{4}{25} . \]Note why the answer is not simply \(\tfrac16\): the zero cannot lead, so the six final digits are not equally common. Numbers ending in 0 are over-represented (\(5 \times 4 \times 3 = 60\) of the 300), and each other final digit, 5 included, gets 48, a little under one sixth.
Five keys are hung at random on five labelled hooks. Find the probability that at least one key is on the wrong hook.
\(n = 5! = 120\) ways to hang the keys. The complement, “every key on its own hook”, happens in exactly \(m = 1\) way.
\[ P(\text{at least one wrong}) = 1 - \frac{1}{120} = \dfrac{119}{120} . \]The letters of ASSESSMENT are arranged at random. Find the probability that the four S's come together.
10 letters: S four times, E twice, and A, M, N, T once each. Arrangements of letters with repeats divide out the orders of the identical letters:
\[ n = \frac{10!}{4!\,2!} = \frac{3628800}{24 \times 2} = 75600 . \]Glue the four S's into one block. Then there are 7 units (the block, two E's, A, M, N, T):
\[ m = \frac{7!}{2!} = \frac{5040}{2} = 2520, \qquad P = \frac{2520}{75600} = \dfrac{1}{30} . \]The letters of BIOLOGY are arranged at random. Find the probability that the two O's do not come together.
7 letters with O twice: \(n = 7!/2!\). For the complement, glue the two O's together: 6 units, all different, \(6!\) arrangements.
\[ P(\text{together}) = \frac{6!}{7!/2!} = \frac{2}{7}, \qquad P(\text{apart}) = 1 - \frac27 = \frac57 . \]A quicker view: only the two positions of the O's matter. Of the \(\binom72 = 21\) pairs of positions, 6 are next to each other, and \(6/21 = 2/7\).
Two dice are thrown. Find the probability that the sum is either 9 or 12.
\(n(S) = 36\). \(A\) = sum 9 \(= \{(3,6), (4,5), (5,4), (6,3)\}\), \(n(A) = 4\); \(B\) = sum 12 \(= \{(6,6)\}\), \(n(B) = 1\). No pair has both sums, so \(A \cap B = \varnothing\).
\[ P(A \cup B) = P(A) + P(B) - P(A \cap B) = \frac{4}{36} + \frac{1}{36} - 0 = \dfrac{5}{36} . \]A card is drawn from a pack of 52. Find the probability that it is a spade or a face card (jack, queen or king).
\(A\) = spade: 13 cards; \(B\) = face card: 12 cards; \(A \cap B\) = face card of spades: 3 cards.
\[ P(A \cup B) = \frac{13}{52} + \frac{12}{52} - \frac{3}{52} = \frac{22}{52} = \dfrac{11}{26} . \]Without the subtraction the three face cards of spades would be counted twice.
A token is drawn at random from 30 tokens numbered 1 to 30. Find the probability that its number is divisible by 4 or 6.
\(A = \{4, 8, 12, 16, 20, 24, 28\}\), \(B = \{6, 12, 18, 24, 30\}\), \(A \cap B = \{12, 24\}\) (divisible by both, i.e. by 12, the least common multiple — not by 24).
\[ P(A \cup B) = \frac{7}{30} + \frac{5}{30} - \frac{2}{30} = \frac{10}{30} = \dfrac{1}{3} . \]A box contains 7 white and 5 blue balls. Two are drawn at random. Find the probability that they are both white or both blue.
\(n = \binom{12}{2} = 66\). \(A\) = both white: \(\binom{7}{2} = 21\); \(B\) = both blue: \(\binom{5}{2} = 10\). Two balls cannot be both white and both blue, so \(A \cap B = \varnothing\).
\[ P(A \cup B) = \frac{21}{66} + \frac{10}{66} = \frac{31}{66} = \dfrac{31}{66} . \]A bag contains 5 green and 7 white balls. Two are drawn in succession. Find the probability that both are green if the first ball is (i) replaced, (ii) not replaced.
Let \(A\) = green at the first draw, \(B\) = green at the second.
(i) Replaced. The bag is the same for both draws, so \(A\) and \(B\) are independent: \(P(A) = P(B) = 5/12\) and
\[ P(A \cap B) = P(A)\,P(B) = \frac{5}{12} \cdot \frac{5}{12} = \dfrac{25}{144} . \](ii) Not replaced. After a green ball is taken, 11 balls remain, 4 of them green: \(P(B \mid A) = 4/11\). By the multiplication theorem,
\[ P(A \cap B) = P(A)\,P(B \mid A) = \frac{5}{12} \cdot \frac{4}{11} = \frac{20}{132} = \dfrac{5}{33} . \]Three students are selected one after another from a class of 14 boys and 6 girls. Find the probability that all three are girls.
\(A\), \(B\), \(C\) = a girl at the first, second, third selection. Each selection leaves one girl and one student fewer:
\[ P(A \cap B \cap C) = P(A)\,P(B \mid A)\,P(C \mid A \cap B) = \frac{6}{20} \cdot \frac{5}{19} \cdot \frac{4}{18} = \frac{120}{6840} = \dfrac{1}{57} . \]Check by counting: \(\binom{6}{3} \big/ \binom{20}{3} = 20/1140 = \dfrac{1}{57}\).
Two archers shoot at a target in turn, hitting it with probabilities 0.4 and 0.25. The second shoots only if the first misses. Find the probability that (i) the target is hit, (ii) both miss.
\(A\) = first hits, \(B\) = second hits, the two attempts independent.
(i) The target is hit if the first hits, or the first misses and the second hits. These are mutually exclusive, so
\[ P = P(A) + P(\bar A \cap B) = P(A) + P(\bar A)\,P(B) = 0.4 + (0.6)(0.25) = 0.55 . \](ii) \(P(\bar A \cap \bar B) = P(\bar A)\,P(\bar B) = (0.6)(0.75) = 0.45\) (Result 8). As a check, (i) and (ii) are complements: \(0.55 + 0.45 = 1\).
Three friends, working independently, solve a puzzle with probabilities \(\tfrac13\), \(\tfrac25\) and \(\tfrac12\). Find the probability that it is solved.
It is solved if at least one solves it: \(P(A \cup B \cup C)\). By the addition theorem for three events, with independence turning each intersection into a product,
\[ P(A \cup B \cup C) = \frac13 + \frac25 + \frac12 - \frac13\cdot\frac25 - \frac25\cdot\frac12 - \frac13\cdot\frac12 + \frac13\cdot\frac25\cdot\frac12 . \]Over the common denominator 30,
\[ P(A \cup B \cup C) = \frac{10 + 12 + 15 - 4 - 6 - 5 + 2}{30} = \dfrac{4}{5} . \]Another way. It is unsolved only if all three fail, and (Result 8) the failures are independent too:
\[ P(\bar A \cap \bar B \cap \bar C) = \frac23 \cdot \frac35 \cdot \frac12 = \dfrac{1}{5}, \qquad P(A \cup B \cup C) = 1 - \dfrac{1}{5} = \dfrac{4}{5} . \]A box contains 5 red, 3 white and 4 black balls. Four are drawn at random. Find the probability that there is at least one of each colour.
\(n = \binom{12}{4} = 495\). Four balls with all three colours means one colour twice and the others once — three disjoint cases:
\(P(A) = \tfrac{2}{3}\) and \(P(B) = \tfrac{3}{5}\). Show that (i) \(P(A \cup B) \ge \tfrac{2}{3}\), (ii) \(\tfrac{4}{15} \le P(A \cap B) \le \tfrac{3}{5}\).
(i) \(A \subset A \cup B\), so by monotonicity (§2) \(P(A \cup B) \ge P(A) = \tfrac{2}{3}\).
(ii) \(A \cap B \subset B\), so \(P(A \cap B) \le P(B) = \tfrac{3}{5}\). For the lower bound, \(P(A \cup B) \le 1\) and the addition theorem give
\[ P(A \cap B) \ge P(A) + P(B) - 1 = \tfrac{2}{3} + \tfrac{3}{5} - 1 = \dfrac{4}{15} , \]which is Boole's inequality in its intersection form (§7) with \(n = 2\). The two probabilities add to more than 1, so the events must overlap by at least the excess, \(\tfrac{4}{15}\).
Bag I holds 2 white, 3 black and 1 red balls; bag II 1 white, 2 black and 3 red; bag III 3 white, 4 black and 5 red. A bag is chosen at random and two balls drawn: one white, one red. Find the probability that they came from each bag.
\(E_1, E_2, E_3\) = bag I, II, III chosen, each with prior \(\tfrac13\). \(A\) = one white and one red.
\[ \begin{gathered} P(A \mid E_1) = \frac{\binom{2}1\binom{1}1}{\binom{6}2} = \frac{2}{15} = \dfrac{2}{15}, \quad P(A \mid E_2) = \frac{\binom{1}1\binom{3}1}{\binom{6}2} = \frac{3}{15} = \dfrac{1}{5}, \\ P(A \mid E_3) = \frac{\binom{3}1\binom{5}1}{\binom{12}2} = \frac{15}{66} = \dfrac{5}{22} . \end{gathered} \]Total probability:
\[ P(A) = \frac13\left(\dfrac{2}{15} + \dfrac{1}{5} + \dfrac{5}{22}\right) = \dfrac{37}{198} . \]Bayes' theorem divides each path by this total:
\[ P(E_1 \mid A) = \dfrac{44}{185}, \qquad P(E_2 \mid A) = \dfrac{66}{185}, \qquad P(E_3 \mid A) = \dfrac{15}{37} . \]They add to 1, as they must. Bag III, the most likely source, is the one where a white-red pair is easiest to draw.
Assembly lines A, B, C make 25%, 35% and 40% of a factory's switches; 5%, 4% and 2% of their output is faulty. A switch drawn at random is faulty. Find the probability that it was made on each line.
Priors \(P(E_1) = 0.25\), \(P(E_2) = 0.35\), \(P(E_3) = 0.40\); likelihoods \(P(A \mid E_i) = 0.05, 0.04, 0.02\).
\[ \begin{aligned} P(A) &= (0.25)(0.05) + (0.35)(0.04) + (0.40)(0.02) = 0.0125 + 0.0140 + 0.0080 \\ &= 0.0345 , \end{aligned} \] \[ \begin{aligned} P(E_1 \mid A) &= \frac{0.0125}{0.0345} = \dfrac{25}{69} = 0.3623, \\ P(E_2 \mid A) &= \frac{0.0140}{0.0345} = \dfrac{28}{69} = 0.4058, \\ P(E_3 \mid A) &= \frac{0.0080}{0.0345} = \dfrac{16}{69} = 0.2319 . \end{aligned} \]Line C makes the most switches but is the least likely culprit: its fault rate is the lowest. Line B, with a high share and a high rate, leads.
Urn I holds 40 red, 30 white and 30 black balls (100); urn II 25 red, 45 white and 20 black (90); urn III 35 red, 50 white and 55 black (140). An urn is chosen at random and 6 balls drawn: 4 red and 2 white. Find the probability that they came from urn I, and from urn III.
Priors \(\tfrac13\) each. The likelihoods choose 4 of the reds and 2 of the whites out of all \(\binom{N}{6}\) samples:
\[ \begin{gathered} P(A \mid E_1) = \frac{\binom{40}{4}\binom{30}{2}}{\binom{100}{6}} = 0.0333, \quad P(A \mid E_2) = \frac{\binom{25}{4}\binom{45}{2}}{\binom{90}{6}} = 0.0201, \\ P(A \mid E_3) = \frac{\binom{35}{4}\binom{50}{2}}{\binom{140}{6}} = 0.0068, \end{gathered} \] \[ P(A) = \tfrac13(0.0333 + 0.0201 + 0.0068) = 0.02010 . \]Carrying full precision rather than the four-place values,
\[ P(E_1 \mid A) = 0.5531, \qquad P(E_2 \mid A) = 0.3336, \qquad P(E_3 \mid A) = 0.1134 , \]and the probability that the balls came from urn I or urn III is \(0.5531 + 0.1134 = 0.6664\). With likelihoods this small, rounding them to four places before dividing can move the third decimal of the answers, so keep the exact values until the end.