Chapter 13 ยท Probability

13.3 The Theorem of Total Probability and Bayes' Theorem

Split the sample space into the possible causes $E_1,\dots,E_n$. Adding over the causes gives the chance of an effect $A$ (total probability); turning the question round gives the chance of each cause once the effect is seen (Bayes' theorem).

A factory makes the same bolt on three machines (all the numbers here are illustrative). Machine $M_1$ makes $50\%$ of the bolts, $M_2$ makes $30\%$ and $M_3$ makes $20\%$; their defect rates are $2\%$, $3\%$ and $5\%$. Two questions come up every day. The quality manager asks: what fraction of all bolts is defective? And when a customer returns a defective bolt, the engineer asks: which machine most probably made it? The first question runs forwards, from the causes (the machines) to the effect (a defect). The second runs backwards, from the effect to the causes.

The forward question is answered by the theorem of total probability: work out the chance of a defect along each machine's branch and add. The backward question is answered by Bayes' theorem, named after the English minister and mathematician Thomas Bayes (1701โ€“1761), whose idea was published after his death. It is now used everywhere that evidence has to be weighed โ€” medical diagnosis, spam filters, forensic science, weather forecasting and machine learning. Its answers are often surprising, and in this section you will see why.

Partitions and the Theorem of Total Probability

The three machines split the bolts into three groups that do not overlap and together cover everything. In Section 1.1 such a splitting of a set was called a partition; here is the version for events.

๐Ÿ“˜ Definition 13.4 โ€” Partition of a sample space
Events $E_1,E_2,\dots,E_n$ of a sample space $S$ form a partition of the sample space $S$ if

(a) they are pairwise disjoint: $E_i\cap E_j=\phi$ for $i\ne j$;
(b) they are exhaustive: $E_1\cup E_2\cup\cdots\cup E_n=S$;
(c) each has non-zero probability: $P(E_i)\gt0$ for every $i$.

In other words, whatever the outcome, exactly one of the events $E_1,\dots,E_n$ happens. For any event $E$ with $0\lt P(E)\lt1$, the pair $E$, $E'$ is the simplest partition.
๐Ÿ“ Theorem 13.4 โ€” Theorem of total probability
Let $E_1,E_2,\dots,E_n$ be a partition of the sample space $S$, and let $A$ be any event of $S$. Then $$P(A)=P(E_1)P(A\mid E_1)+P(E_2)P(A\mid E_2)+\cdots+P(E_n)P(A\mid E_n)$$ $$=\sum_{j=1}^{n}P(E_j)\,P(A\mid E_j).$$

Proof. Because the $E_j$ cover $S$, $A=A\cap S$ $=(A\cap E_1)\cup(A\cap E_2)\cup\cdots\cup(A\cap E_n)$. Because the $E_j$ are pairwise disjoint, so are the pieces $A\cap E_j$. By the addition rule for mutually exclusive events,

$$P(A)=P(A\cap E_1)+P(A\cap E_2)+\cdots+P(A\cap E_n).$$

Finally, each $P(E_j)\gt0$, so by the multiplication theorem (Theorem 13.2) $P(A\cap E_j)=P(E_j)P(A\mid E_j)$. $\square$

In a tree diagram the theorem is just "multiply along each branch that ends in $A$, then add across" โ€” the first branching is the partition. It also says that $P(A)$ is a weighted average of the conditional probabilities $P(A\mid E_j)$, with weights $P(E_j)$ that add up to $1$. So $P(A)$ always lies between the smallest and the largest of the $P(A\mid E_j)$.

โœ๏ธ Example 1 โ€” Choosing a bag with a die
Bag I contains $3$ red and $4$ black balls; Bag II contains $5$ red and $2$ black balls. A die is thrown: if it shows $1$ or $2$, a ball is drawn from Bag I, otherwise from Bag II. Find the probability that the ball is red.
Partition $E_1$: "Bag I is used", $P(E_1)=\tfrac26=\tfrac13$; $E_2$: "Bag II is used", $P(E_2)=\tfrac23$. Exactly one of them happens.
Conditionals $P(R\mid E_1)=\tfrac37$, $P(R\mid E_2)=\tfrac57$.
Total $P(R)=\tfrac13\cdot\tfrac37+\tfrac23\cdot\tfrac57=\tfrac{3}{21}+\tfrac{10}{21}=\tfrac{13}{21}$.
Check $\tfrac{13}{21}\approx0.62$ lies between $\tfrac37\approx0.43$ and $\tfrac57\approx0.71$, and nearer $\tfrac57$ because Bag II is used more often โœ“.
โœ๏ธ Example 2 โ€” The factory: what fraction is defective?
For the factory in the introduction, find the probability that a bolt chosen at random from the day's output is defective.
Partition $E_1,E_2,E_3$: "made by $M_1$, $M_2$, $M_3$", with $P(E_1)=0.5$, $P(E_2)=0.3$, $P(E_3)=0.2$ (sum $1$ โœ“). $D$: "defective", with $P(D\mid E_1)=0.02$, $P(D\mid E_2)=0.03$, $P(D\mid E_3)=0.05$.
Total $P(D)=0.5(0.02)+0.3(0.03)+0.2(0.05)$ $=0.010+0.009+0.010=0.029$.
Answer $2.9\%$ of the bolts are defective. In a batch of $10\,000$ bolts, expect about $100+90+100=290$ defective ones.
โœ๏ธ Example 3 โ€” Transferring a ball
Bag A contains $3$ white and $2$ black balls; Bag B contains $2$ white and $4$ black balls. One ball is taken at random from Bag A and put into Bag B without looking at it. A ball is then drawn from Bag B. Find the probability that it is white.
Partition The unseen transferred ball is the "cause": $E_1$: "white transferred", $P(E_1)=\tfrac35$; $E_2$: "black transferred", $P(E_2)=\tfrac25$.
Conditionals After $E_1$, Bag B has $3$ white and $4$ black: $P(W\mid E_1)=\tfrac37$. After $E_2$, it has $2$ white and $5$ black: $P(W\mid E_2)=\tfrac27$.
Total $P(W)=\tfrac35\cdot\tfrac37+\tfrac25\cdot\tfrac27=\tfrac{9}{35}+\tfrac{4}{35}=\tfrac{13}{35}$.
Interactive 1 โ€” Adding Over the Causes

Three machines share the output of a factory (illustrative numbers). Set each machine's share and defect rate. The tree multiplies along each machine's branch to get $P(E_j)P(D\mid E_j)$; the bar on the right stacks these three pieces โ€” their total is $P(D)$, by the theorem of total probability. The lower bar shows each machine's share of the defective bolts, which is exactly what Bayes' theorem computes. Press Play to watch the pieces being added one by one.

sharesโ€”
$P(D)$โ€”
$P(E_1\mid D),\ P(E_2\mid D),\ P(E_3\mid D)$โ€”

Bayes' Theorem: From the Effect Back to the Causes

Now the engineer's question. A bolt is defective; what is $P(E_1\mid D)$? By Definition 13.1 it is $\dfrac{P(E_1\cap D)}{P(D)}$. The top is one branch of the tree, $P(E_1)P(D\mid E_1)$, and the bottom is the sum over all the branches โ€” the theorem of total probability. That is the whole of Bayes' theorem.

๐Ÿ“ Theorem 13.5 โ€” Bayes' theorem
Let $E_1,E_2,\dots,E_n$ be a partition of the sample space $S$, and let $A$ be an event with $P(A)\ne0$. Then for each $i=1,2,\dots,n$, $$P(E_i\mid A)=\frac{P(E_i)\,P(A\mid E_i)}{\displaystyle\sum_{j=1}^{n}P(E_j)\,P(A\mid E_j)}.$$

Proof. By Definition 13.1 and the multiplication theorem, $P(E_i\mid A)=\dfrac{P(E_i\cap A)}{P(A)}=\dfrac{P(E_i)P(A\mid E_i)}{P(A)}$. Replace $P(A)$ by the sum given by Theorem 13.4. $\square$

The words used with Bayes' theorem are worth learning. The $E_i$ are the possible causes or hypotheses. $P(E_i)$ is the prior probability of $E_i$ โ€” how likely it was before the evidence $A$ was seen. $P(A\mid E_i)$ is how likely the evidence is under each hypothesis. $P(E_i\mid A)$ is the posterior probability โ€” how likely $E_i$ is after the evidence. The posterior probabilities of all the causes add up to $1$, because the denominator is the sum of all the numerators.

๐Ÿงญ Problem-solving strategy โ€” Bayes' theorem in five steps
  1. Name the causes $E_1,\dots,E_n$ (they must form a partition โ€” check that they cannot overlap and that one of them must happen) and the observed event $A$.
  2. Write the priors $P(E_i)$ and check that they add up to $1$.
  3. Write the conditionals $P(A\mid E_i)$ โ€” read carefully which way round each given percentage goes.
  4. Multiply and add: the products $P(E_i)P(A\mid E_i)$ and their sum $P(A)$. A tree or a table keeps them tidy.
  5. Divide the product for the cause you want by the total, and check that all the posteriors add up to $1$.
โœ๏ธ Example 4 โ€” Which machine made the defective bolt?
In the factory of Example 2, a bolt is found to be defective. Find the probability that it was made by each of the machines $M_1$, $M_2$, $M_3$.
Products $P(E_1)P(D\mid E_1)=0.010$, $P(E_2)P(D\mid E_2)=0.009$, $P(E_3)P(D\mid E_3)=0.010$; total $P(D)=0.029$ (Example 2).
Divide $P(E_1\mid D)=\tfrac{0.010}{0.029}=\tfrac{10}{29}$, $P(E_2\mid D)=\tfrac9{29}$, $P(E_3\mid D)=\tfrac{10}{29}$.
Check $\tfrac{10+9+10}{29}=1$ โœ“.
Interpret Before the defect was seen, $M_3$ was the least likely source (prior $0.2$). After it, $M_3$ is tied for the most likely (posterior $\tfrac{10}{29}\approx0.34$), because its high defect rate makes the evidence much more likely under $E_3$. The evidence shifts belief towards the causes that explain it best.
โœ๏ธ Example 5 โ€” A positive test for a rare condition
A condition affects $1\%$ of a population. A screening test detects it in $98\%$ of people who have it, but also gives a positive result for $3\%$ of people who do not. (These numbers are illustrative.) A person chosen at random tests positive. Find the probability that the person has the condition.
Causes $E_1$: "has the condition", $P(E_1)=0.01$; $E_2=E_1'$, $P(E_2)=0.99$. Evidence $A$: "positive", with $P(A\mid E_1)=0.98$ and $P(A\mid E_2)=0.03$.
Total $P(A)=0.01(0.98)+0.99(0.03)$ $=0.0098+0.0297=0.0395$.
Bayes $P(E_1\mid A)=\dfrac{0.0098}{0.0395}=\dfrac{98}{395}\approx0.248$.
Natural frequencies Picture $10\,000$ people: $100$ have the condition and $98$ of them test positive; $9900$ do not, and $3\%$ of them, $297$, also test positive. Of the $98+297=395$ positives only $98$ are real: $\tfrac{98}{395}$ again. A positive result raises the chance from $1\%$ to about $25\%$ โ€” a big rise, but most positives are still false alarms, because the healthy group is so large. That is why a positive screening result is followed by a second, more precise test.
โœ๏ธ Example 6 โ€” Stay or switch, solved
In the game in the chapter introduction, a prize is behind one of three doors, each with probability $\tfrac13$. You pick door $1$. The host, who knows where the prize is, opens one of the other doors that hides nothing, choosing at random if he has a choice. He opens door $3$. Find the probability that the prize is behind door $1$, and behind door $2$.
Causes $E_i$: "the prize is behind door $i$", $P(E_i)=\tfrac13$ for $i=1,2,3$. Evidence $A$: "the host opens door $3$".
Conditionals If the prize is behind door $1$, the host may open door $2$ or $3$: $P(A\mid E_1)=\tfrac12$. If it is behind door $2$, he must open door $3$: $P(A\mid E_2)=1$. If it is behind door $3$, he cannot open it: $P(A\mid E_3)=0$.
Total $P(A)=\tfrac13\cdot\tfrac12+\tfrac13\cdot1+\tfrac13\cdot0=\tfrac12$.
Bayes $P(E_1\mid A)=\dfrac{1/6}{1/2}=\dfrac13$ and $P(E_2\mid A)=\dfrac{1/3}{1/2}=\dfrac23$. Switching to door $2$ doubles your chance โ€” just as the simulation in the chapter introduction showed. The host's choice is evidence because it depends on where the prize is.
Interactive 2 โ€” Bayes Lab: 1000 People and a Test

A screening test (all numbers illustrative). Set the prior (how common the condition is), the test's sensitivity $P(+\mid\text{condition})$ and its false-positive rate $P(+\mid\text{no condition})$. Each square is one of $1000$ people: red = has the condition and tests positive, red outline = has it but is missed, amber = healthy but tests positive, grey = healthy and negative. The posterior $P(\text{condition}\mid +)$ is the red share of all the filled squares. Press Play to sweep the prior and watch the posterior follow.

priorโ€”
$P(+)$โ€”
posterior $P(\text{cond.}\mid +)$โ€”
$P(\text{no cond.}\mid -)$โ€”
โš ๏ธ Common mistakes when studying alone

1. Reading the condition the wrong way round. "The test detects $98\%$ of cases" is $P(+\mid\text{condition})$, not $P(\text{condition}\mid +)$. Confusing the two is so common in courtrooms that it has a name: the prosecutor's fallacy.

2. Ignoring the prior (the base rate). A very accurate test for a very rare condition still produces mostly false positives. Always ask "how common was the cause to begin with?"

3. Causes that are not a partition. The $E_i$ must not overlap and must cover every possibility; check that the priors add up to $1$.

4. Forgetting $P(A\mid E_i)=0$ branches. A cause that cannot produce the evidence gets posterior $0$, but it still belongs in the partition.

5. Mixing percentages and decimals. Convert everything to decimals or fractions before multiplying.

Exercises

I
Partitions and total probability.
  • 1 A die is thrown. Which of these form a partition of $S=\{1,2,\dots,6\}$? (a) $\{1,2\},\{3,4,5\},\{6\}$; (b) $\{1,2,3\},\{3,4\},\{5,6\}$; (c) $\{1,2\},\{4,5,6\}$.
  • 2 $E_1$, $E_2$ form a partition with $P(E_1)=0.3$. If $P(A\mid E_1)=0.2$ and $P(A\mid E_2)=0.5$, find $P(A)$.
  • 3 Bag I has $2$ red and $3$ black balls; Bag II has $4$ red and $1$ black ball. A bag is chosen at random and a ball is drawn. Find the probability that it is red.
  • 4 Urn $U_1$ has $1$ white and $2$ black balls, $U_2$ has $2$ white and $1$ black, $U_3$ has $3$ white and $3$ black. An urn is chosen at random and a ball drawn. Find $P(\text{white})$.
  • 5 Bag A has $4$ white and $3$ black balls; Bag B has $2$ white and $5$ black. One ball is moved at random from A to B, and then a ball is drawn from B. Find the probability that it is white.
  • 6 Bag X has $3$ white and $2$ black balls; Bag Y has $1$ white and $3$ black. Two balls are moved at random from X to Y, and then one ball is drawn from Y. Find the probability that it is white.
  • 7 On a rainy day a bus is late with probability $0.4$; on a dry day, with probability $0.1$. If it rains on $30\%$ of days (illustrative), find the probability that the bus is late on a given day.
1 (a) Yes: disjoint, union $S$, each non-empty. (b) No: $3$ is in two sets. (c) No: $3$ is in none.
2 $P(E_2)=0.7$; $P(A)=0.3(0.2)+0.7(0.5)$ $=0.06+0.35=0.41$.
3 $\tfrac12\cdot\tfrac25+\tfrac12\cdot\tfrac45=\tfrac35$.
4 $\tfrac13\left(\tfrac13+\tfrac23+\tfrac12\right)=\tfrac13\cdot\tfrac32=\tfrac12$.
5 White moved ($\tfrac47$): B has $3$ W, $5$ B. Black moved ($\tfrac37$): B has $2$ W, $6$ B. $P(W)=\tfrac47\cdot\tfrac38+\tfrac37\cdot\tfrac28=\tfrac{12+6}{56}=\tfrac9{28}$.
6 Moved pair: $2$ white with probability $\tfrac{^3C_2}{^5C_2}=\tfrac3{10}$ (then Y has $3$ W of $6$); one of each, $\tfrac{3\cdot2}{10}=\tfrac6{10}$ ($2$ W of $6$); $2$ black, $\tfrac1{10}$ ($1$ W of $6$). $P(W)=\tfrac3{10}\cdot\tfrac36+\tfrac6{10}\cdot\tfrac26+\tfrac1{10}\cdot\tfrac16$ $=\tfrac{9+12+1}{60}=\tfrac{11}{30}$.
7 $0.3(0.4)+0.7(0.1)=0.12+0.07=0.19$.
II
Bayes' theorem.
  • 1 In Exercise I.2, find $P(E_1\mid A)$.
  • 2 In Exercise I.3, the ball drawn is red. Find the probability that it came from Bag I.
  • 3 In Exercise I.4, the ball drawn is white. Find the probabilities that it came from $U_1$ and from $U_3$.
  • 4 In Exercise I.5, the ball drawn from B is white. Find the probability that the ball moved from A was white.
  • 5 A man tells the truth $4$ times out of $5$. He throws a die and reports that it shows a six. Find the probability that it really is a six.
  • 6 A box has three coins: one fair, one with two heads, and one biased so that a head appears with probability $\tfrac34$. A coin is chosen at random and tossed; it shows a head. Find the probability that it is the two-headed coin.
  • 7 The same chosen coin is tossed a second time and again shows a head. Now find the probability that it is the two-headed coin.
  • 8 An insurer classes drivers as high, medium or low risk: $20\%$, $30\%$ and $50\%$ of its drivers, with yearly accident probabilities $0.15$, $0.05$ and $0.01$ (illustrative). Find the probability that a driver has an accident in a year, and the probability that a driver who had an accident is high risk.
  • 9 In a multiple-choice test with $4$ options per question, a student knows the answer with probability $\tfrac34$ and otherwise guesses at random. Given that the student answered a question correctly, find the probability that the student knew the answer.
1 $\tfrac{0.06}{0.41}=\tfrac6{41}$.
2 $\dfrac{\tfrac12\cdot\tfrac25}{3/5}=\dfrac{1/5}{3/5}=\dfrac13$.
3 $P(U_1\mid W)=\dfrac{\tfrac13\cdot\tfrac13}{1/2}=\dfrac29$; $P(U_3\mid W)=\dfrac{\tfrac13\cdot\tfrac12}{1/2}=\dfrac13$ (and $P(U_2\mid W)=\tfrac49$; the three add up to $1$ โœ“).
4 $\dfrac{12/56}{18/56}=\dfrac23$.
5 Causes: six ($\tfrac16$) or not ($\tfrac56$). Evidence "reports a six": probability $\tfrac45$ if it is a six, $\tfrac15$ if not (he lies). $\dfrac{\tfrac16\cdot\tfrac45}{\tfrac16\cdot\tfrac45+\tfrac56\cdot\tfrac15}=\dfrac{4/30}{9/30}=\dfrac49$.
6 $P(H)=\tfrac13\left(\tfrac12+1+\tfrac34\right)=\tfrac34$. $P(\text{two-headed}\mid H)=\dfrac{1/3}{3/4}=\dfrac49$.
7 Two heads have probabilities $\tfrac14$, $1$, $\tfrac9{16}$ for the three coins. $P=\dfrac{\tfrac13\cdot1}{\tfrac13\left(\tfrac14+1+\tfrac9{16}\right)}=\dfrac{1}{29/16}=\dfrac{16}{29}$. The second head strengthens the evidence.
8 $P(\text{acc})=0.2(0.15)+0.3(0.05)+0.5(0.01)$ $=0.03+0.015+0.005=0.05$; $P(\text{high}\mid\text{acc})=\tfrac{0.03}{0.05}=0.6$.
9 $P(\text{correct})=\tfrac34\cdot1+\tfrac14\cdot\tfrac14=\tfrac{13}{16}$; $P(\text{knew}\mid\text{correct})=\dfrac{3/4}{13/16}=\dfrac{12}{13}$.
III
Applications (all data illustrative).
  • 1 A condition affects $2\%$ of people. A test is positive for $90\%$ of those with it and for $5\%$ of those without it. Find $P(\text{condition}\mid +)$ and $P(\text{condition}\mid -)$.
  • 2 $40\%$ of the email reaching an inbox is spam. The word "prize" appears in $30\%$ of spam emails and $2\%$ of genuine ones. An email contains "prize". Find the probability that it is spam.
  • 3 A shop buys a component from two suppliers: $60\%$ from $S_1$ and $40\%$ from $S_2$, with defect rates $1\%$ and $3\%$. Find the probability that a component is defective, and the probability that a defective component came from $S_2$.
  • 4 A team wins the toss in half its matches. It wins $70\%$ of the matches in which it wins the toss and $45\%$ of the others. Find the probability that it wins a match, and the probability that it won the toss given that it won the match.
  • 5 Show that if $P(A\mid E_1)=P(A\mid E_2)$ $=\cdots=P(A\mid E_n)=p$ for a partition $E_1,\dots,E_n$ and $p\gt0$, then $P(A)=p$ and $P(E_i\mid A)=P(E_i)$ for every $i$. Explain in words.
1 $P(+)=0.02(0.9)+0.98(0.05)$ $=0.018+0.049=0.067$; $P(\text{cond}\mid +)=\tfrac{18}{67}\approx0.269$. $P(-)=0.933$ and $P(\text{cond}\cap -)=0.02(0.1)=0.002$, so $P(\text{cond}\mid -)=\tfrac{2}{933}\approx0.0021$.
2 $\dfrac{0.4(0.3)}{0.4(0.3)+0.6(0.02)}=\dfrac{0.12}{0.132}=\dfrac{10}{11}\approx0.91$.
3 $P(D)=0.006+0.012=0.018$; $P(S_2\mid D)=\tfrac{0.012}{0.018}=\tfrac23$.
4 $P(\text{win})=0.5(0.7)+0.5(0.45)=0.575$; $P(\text{toss}\mid\text{win})=\tfrac{0.35}{0.575}=\tfrac{14}{23}\approx0.61$.
5 $P(A)=\sum P(E_j)\,p=p\sum P(E_j)=p$, and $P(E_i\mid A)=\tfrac{P(E_i)\,p}{p}=P(E_i)$. If every cause makes the evidence equally likely, the evidence cannot tell the causes apart: the posteriors equal the priors.
IV
Reasoning.
  • 1 Explain, using Bayes' theorem, why $P(E_1\mid A)+P(E_2\mid A)$ $+\cdots+P(E_n\mid A)=1$.
  • 2 For an event $E$ with $0\lt P(E)\lt1$, $P(A\mid E)=0.8$ and $P(A\mid E')=0.2$. If $P(E\mid A)=0.5$, find $P(E)$.
  • 3 In Exercise III.1, a person who tested positive takes a second test of the same kind, whose result is independent of the first given the person's true condition. It is positive again. Find the new probability that the person has the condition.
  • 4 A bag contains $3$ balls, and the number of white balls in it is equally likely to be $0$, $1$, $2$ or $3$. One ball is drawn and is white. Find the probability that all three balls are white.
1 All the posteriors have the same denominator $P(A)=\sum_j P(E_j)P(A\mid E_j)$, and their numerators are exactly the terms of that sum, so they add up to $\tfrac{P(A)}{P(A)}=1$.
2 Let $P(E)=x$: $\dfrac{0.8x}{0.8x+0.2(1-x)}=0.5$ gives $0.8x=0.4x+0.1-0.1x$, so $0.5x=0.1$ and $P(E)=0.2$. Check: $\tfrac{0.16}{0.16+0.16}=0.5$ โœ“.
3 Use the posterior from the first test as the new prior: $p=\tfrac{18}{67}$. Then $\dfrac{p(0.9)}{p(0.9)+(1-p)(0.05)}$ $=\dfrac{16.2}{16.2+2.45}$ $=\dfrac{324}{373}\approx0.87$.
4 $P(W\mid k\text{ white})=\tfrac k3$, so $P(W)=\tfrac14\left(0+\tfrac13+\tfrac23+1\right)=\tfrac12$ and $P(3\text{ white}\mid W)=\dfrac{\tfrac14\cdot1}{1/2}=\dfrac12$.
๐ŸŽฏ Exam corner Board ยท 1 markBoard ยท 5 marksBoard ยท Case studyJEE MainJEE Advanced

How this is examined: Bayes' theorem is a favourite 5-mark Board question (bags, machines, tests, a person who may lie) and a regular case study; the theorem of total probability appears in 1-mark MCQs and as the first part of every Bayes problem. JEE problems combine Bayes with counting, transfers between bags and repeated evidence.

E1. Board ยท 1 mark $E_1$, $E_2$ form a partition of $S$ with $P(E_1)=0.4$. If $P(A\mid E_1)=0.5$ and $P(A\mid E_2)=0.25$, then $P(A)$ is  (A) $0.35$  (B) $0.75$  (C) $0.125$  (D) $0.375$

Idea Theorem 13.4: $P(A)=0.4(0.5)+0.6(0.25)$ $=0.2+0.15=0.35$.
Answer (A). Trap (B) adds the conditional probabilities; (D) averages them as if $P(E_1)=P(E_2)=\tfrac12$; (C) multiplies them.

E2. Board ยท 1 mark Assertionโ€“Reason. $E_1,E_2,E_3$ form a partition of $S$ and $P(A)\gt0$. Assertion (A): $P(E_1\mid A)+P(E_2\mid A)+P(E_3\mid A)=1$. Reason (R): $P(E_1)+P(E_2)+P(E_3)=1$.  (A) Both A and R are true and R is the correct explanation of A  (B) Both A and R are true but R is not the correct explanation of A  (C) A is true but R is false  (D) A is false but R is true

Idea Both statements are true. But A does not follow from R: it follows because the posteriors share the denominator $P(A)$ and their numerators add up to $P(A)$ (Exercise IV.1) โ€” equivalently, because $P(\,\cdot\mid A)$ is itself a probability (Theorem 13.1). R is about the priors.
Answer (B).

E3. Board ยท 5 marks A coaching centre runs three batches (illustrative data): morning ($50\%$ of its students), afternoon ($30\%$) and evening ($20\%$). The pass rates in a qualifying test are $80\%$, $70\%$ and $60\%$. (a) Find the probability that a student chosen at random passes. (b) A student chosen at random has failed. Find the probability that the student is from each batch, and say which batch is the most likely.

Set-up Partition $E_1,E_2,E_3$ (morning, afternoon, evening), priors $0.5,0.3,0.2$. $A$: "passes", $P(A\mid E_i)=0.8,0.7,0.6$; so $P(A'\mid E_i)=0.2,0.3,0.4$. (1 mark)
(a) $P(A)=0.5(0.8)+0.3(0.7)+0.2(0.6)$ $=0.40+0.21+0.12=0.73$. (1 mark)
(b) Total $P(A')=0.5(0.2)+0.3(0.3)+0.2(0.4)$ $=0.10+0.09+0.08=0.27$ $(=1-0.73$ โœ“$)$. (1 mark)
(b) Bayes $P(E_1\mid A')=\tfrac{0.10}{0.27}=\tfrac{10}{27}$, $P(E_2\mid A')=\tfrac9{27}=\tfrac13$, $P(E_3\mid A')=\tfrac8{27}$. (1ยฝ marks)
Answer The morning batch is the most likely, $\tfrac{10}{27}$: it has the best pass rate but is so large that it still supplies the most failures. (ยฝ mark)

E4. Board ยท Case study A clinic screens visitors for a condition that affects $4\%$ of them. The test is positive for $95\%$ of people with the condition and for $10\%$ of people without it (illustrative data). (i) Find the probability that a visitor tests positive. (2 marks) (ii) A visitor tests positive. Find the probability that the visitor has the condition. (1 mark) (iii) A visitor tests negative. Find the probability that the visitor does not have the condition. (1 mark)

(i) $P(+)=0.04(0.95)+0.96(0.10)$ $=0.038+0.096=0.134$.
(ii) $P(C\mid +)=\tfrac{0.038}{0.134}=\tfrac{19}{67}\approx0.284$.
(iii) $P(-)=1-0.134=0.866$, and $P(C'\cap -)=0.96(0.90)=0.864$. So $P(C'\mid -)=\tfrac{0.864}{0.866}=\tfrac{432}{433}\approx0.998$: a negative result is very reassuring, a positive one much less conclusive.

E5. JEE Main A die is thrown. If it shows $1$, $2$, $3$ or $4$, a ball is drawn from urn A ($3$ red, $2$ blue); otherwise from urn B ($1$ red, $4$ blue). The ball is red. The probability that it came from urn A is  (A) $\tfrac67$  (B) $\tfrac35$  (C) $\tfrac23$  (D) $\tfrac7{15}$

Method Priors $\tfrac23$, $\tfrac13$. $P(R)=\tfrac23\cdot\tfrac35+\tfrac13\cdot\tfrac15=\tfrac6{15}+\tfrac1{15}=\tfrac7{15}$. $P(A\mid R)=\dfrac{6/15}{7/15}=\dfrac67$.
Answer (A). Trap (B) is $P(R\mid A)$, the condition reversed; (C) is the prior; (D) is $P(R)$, where the calculation stops one step short.
โฑ Fast route Compare the two branch weights: $\tfrac23\cdot\tfrac35:\tfrac13\cdot\tfrac15=6:1$, so the answer is $\tfrac6{6+1}$.

E6. JEE Advanced (One or more options correct.) Box 1 contains two gold coins, Box 2 one gold and one silver coin, Box 3 two silver coins. A box is chosen at random and one coin is taken from it at random; it is gold. Then  (A) the probability that a gold coin is drawn is $\tfrac12$  (B) $P(\text{Box 1}\mid\text{gold})=\tfrac23$  (C) the probability that the other coin in the chosen box is also gold is $\tfrac23$  (D) $P(\text{Box 2}\mid\text{gold})=\tfrac12$

(A) $P(G)=\tfrac13(1)+\tfrac13\cdot\tfrac12+\tfrac13(0)=\tfrac12$ โœ“.
(B) $P(\text{Box 1}\mid G)=\dfrac{1/3}{1/2}=\dfrac23$ โœ“.
(C) The other coin is gold exactly when the box is Box 1, so this is again $\tfrac23$ โœ“.
(D) $P(\text{Box 2}\mid G)=\dfrac{1/6}{1/2}=\dfrac13$ โœ—. The tempting "two boxes left, so $\tfrac12$ each" ignores that Box 1 is twice as likely to produce a gold coin.
Answer (A), (B), (C).
๐Ÿ”ฌ Researchโ€“Teaching NexusMini project ยท about 60 minutes

Research question. How much should a single positive result from a screening test worry someone โ€” and how does the answer depend on how common the condition is in the group being screened?

Why it matters. Health services worldwide screen large populations: newborn screening, tuberculosis checks, cancer screening, blood-donor testing. Studies have repeatedly found that many people โ€” including some health professionals โ€” overestimate what a positive result means, because they forget the base rate. Public-health planners use exactly the calculation of Example 5 to decide whom to screen and how to explain results to patients.

What to do.

  1. Choose a real screening test and look up typical published values of its sensitivity and false-positive rate (a health agency website or a review article). Note your source; if you cannot find values, use sensitivity $90\%$ and false-positive rate $5\%$ and say that they are illustrative.
  2. In a spreadsheet, make a column of prevalences $0.1\%,0.2\%,0.5\%,1\%,2\%,$ $5\%,10\%,20\%,50\%$ and compute $P(\text{condition}\mid +)$ for each with Bayes' theorem.
  3. Plot the posterior against the prevalence. At which prevalence does a positive result first mean "more likely than not"?
  4. For one prevalence, draw an icon array of $1000$ people (like Interactive 2) by hand or in the spreadsheet.
  5. Use Exercise IV.3 to find the posterior after two independent positive tests at each prevalence, and add it to your graph.

Tools: Spreadsheet; the Bayes lab on this page to check individual values.

Hand in: The table and graph, your icon array, and a short leaflet (half a page) explaining to a patient what a positive screening result does and does not mean.

Going further. Why do doctors often screen only higher-risk groups (for example by age) instead of everyone? Use your graph to explain.

Instructor note: with sensitivity $s$, false-positive rate $f$ and prevalence $p$, the posterior is $\dfrac{ps}{ps+(1-p)f}$, which exceeds $\tfrac12$ exactly when $ps\gt(1-p)f$, i.e. $p\gt\dfrac{f}{s+f}$; for $s=0.9$, $f=0.05$ that is $p\gt\tfrac1{19}\approx5.3\%$. After two positives the posterior is $\dfrac{ps^2}{ps^2+(1-p)f^2}$. Insist that students cite their data source or label numbers as illustrative.

๐Ÿงช Self-check quiz

0/5 correct

Q1. Which of these is a partition of $S=\{1,2,3,4,5,6\}$?

Q2. $E_1$, $E_2$ form a partition with $P(E_1)=P(E_2)=\tfrac12$, $P(A\mid E_1)=0.2$ and $P(A\mid E_2)=0.6$. Then $P(A)$ is

Q3. In Q2, $A$ is observed. Then $P(E_2\mid A)$ is

Q4. In Bayes' theorem, $P(E_i)$ is called the

Q5. A test for a rare condition is $99\%$ accurate for both sick and healthy people, yet most people who test positive are healthy. The main reason is that