Often the probability you know runs the “wrong way”. A factory knows how often each machine makes a faulty item, but when a customer returns a faulty item, the question is which machine probably made it. A doctor knows how accurate a test is for people who have a disease, but the patient wants to know the chance they have the disease given a positive result. Bayes’ theorem turns P(B∣A) into P(A∣B). It’s one formula, but it changes how you think about evidence.
P(A) is sometimes called the prior probability (before you know about B), and P(A∣B) the updated (posterior) probability. If new evidence arrives, the updated probability can become the prior for the next step. This only works if the pieces of evidence are independent of each other once you know whether A happened.
On any school day, the probability of rain is 0.3. If it rains, the probability that Maya is late is 0.25; if it doesn’t rain, it’s 0.08. Given that Maya is late, find the probability that it was raining.
Solution. Let R = rain and L = late. The two paths that end in “late”:
P(R∩L)=0.3×0.25=0.075
P(R′∩L)=0.7×0.08=0.056
So P(L)=0.075+0.056=0.131 and
P(R∣L)=0.1310.075=0.5725…≈0.573 (3 s.f.)
Knowing Maya is late raises the probability of rain from 0.3 to about 0.573.
A factory has three machines. Machine A makes 50% of the items, machine B makes 30% and machine C makes 20%. The proportions of defective items are 2% for A, 3% for B and 5% for C. An item is chosen at random and is defective. Find the probability that it was made by each machine.
Multiply along each branch that ends in D. The three products add to P(D)=0.029.
Machine C makes only 20% of the items, but it’s just as likely as machine A to be the source of a defective one, because its defect rate is so much higher.
A disease affects 1% of a population. A test gives a positive result for 98% of people who have the disease and for 4% of people who don’t.
(a) A person tests positive. Find the probability that they have the disease.
(b) The person takes the test again and again tests positive. Assuming the two results are independent given whether the person has the disease, find the new probability that they have the disease.
A bag holds three coins: a fair coin, a coin with heads on both sides, and a biased coin with P(head)=41. A coin is chosen at random and tossed, and it lands heads. Find the probability that it was the two-headed coin.
Solution. Each coin is chosen with probability 31. The paths ending in heads:
Mixing up P(A∣B) and P(B∣A). ”98% of people with the disease test positive” is P(+∣D)=0.98. It does not mean that 98% of positive results have the disease; Example 3 shows that’s only about 20%. Write each given probability in P(…∣…) notation before you start.
Forgetting a path in the denominator.P(B) is the sum of all the paths that end in B. With three causes, there are three paths. Leaving one out makes the answer too big.
Using the wrong second-branch probability. On the “not defective” branches you need 1−0.02=0.98, and so on. If the question is about a negative test or a non-defective item, use those complementary branches in both the numerator and the denominator.
Ignoring the base rate. A very accurate test for a rare condition can still produce mostly false positives. The prior probability P(A) matters as much as the test accuracy.
Rounding the updated probability before reusing it. In Example 3(b), using 0.2 instead of 0.19838 changes the answer to 0.860. Keep full accuracy until the end.
2. (Warm-up)P(A)=0.3, P(B)=0.2 and P(A∣B)=0.6. Find P(B∣A).
Solution
P(A∩B)=P(B)P(A∣B)=0.2(0.6)=0.12. Then
P(B∣A)=P(A)P(A∩B)=0.30.12=0.4
3. (Core) A phone maker buys a part from three suppliers: 45% from supplier 1, 35% from supplier 2 and 20% from supplier 3. The parts are faulty 1%, 2% and 4% of the time. A part is found to be faulty.
(a) Find the probability that it came from supplier 3.
(b) Which supplier is it most likely to have come from?
Solution
(a) The faulty paths: 0.45(0.01)=0.0045, 0.35(0.02)=0.007, 0.2(0.04)=0.008. So P(F)=0.0195.
P(S3∣F)=0.01950.008=0.410 (3 s.f.)
(b) P(S1∣F)=0.01950.0045=0.231 and P(S2∣F)=0.01950.007=0.359 (3 s.f.). Supplier 3 is the most likely source, even though it supplies the fewest parts.
4. (Core)30% of the emails a company receives are spam. A filter flags 95% of spam emails and 2% of genuine emails.
(a) An email is flagged. Find the probability that it is spam.
(b) An email is not flagged. Find the probability that it is spam.
5. (Core) Students at a school travel by bus (50%), by car (30%) or on foot (20%). The probabilities of being late are 0.1 by bus, 0.05 by car and 0.15 on foot. A student chosen at random arrived on time. Find the probability that they walked.
6. (Core) A fair six-sided die is rolled. If it shows 1 or 2, a ball is taken from box A, which holds 4 green and 2 yellow balls. Otherwise, a ball is taken from box B, which holds 1 green and 5 yellow balls. Given that the ball is green, find the exact probability that it came from box A.
Solution
P(A)=62=31 and P(B)=32. P(G∣A)=64=32 and P(G∣B)=61.
7. (Core) For the factory in Example 2, an item is chosen at random and is not defective. Find the probability that it was made by machine C.
Solution
P(D′)=1−0.029=0.971. The path through C is 0.2(0.95)=0.19.
P(C∣D′)=0.9710.19=0.196 (3 s.f.)
That’s slightly less than C’s share of 0.2, since C’s items are more likely to be defective.
8. (Challenge) A test for a condition gives a positive result for 90% of people who have it and for 10% of people who don’t. In a certain population, half of the people who test positive actually have the condition. Find the proportion of the population that has the condition.
9. (Challenge) In a multiple-choice quiz, each question has 4 options. A student knows the answer to a question with probability p; otherwise she guesses at random. If she knows the answer, she gets it right.
(a) Show that the probability she knew the answer, given that she got it right, is 3p+14p.
(b) Find this probability when p=0.6.
(c) Find p if this probability is 0.9.
Solution
(a) Let K = knows and R = right. P(R∣K)=1 and P(R∣K′)=41.