Inkerval

Bayes' theorem practice problems

A factory has two machines. Each machine makes a known share of the parts and has a known defect rate. You find one defective part. In this topic you compute the chance that each machine made it. A problem belongs here when rates are given from cause to effect but the question asks from effect to cause. The cue is the question "given that the result happened, which source was it?" You will practice: Law of total probability. Bayes' theorem. Conditionally independent evidence. Update, then predict.

12 problems, each with a worked answer. Verified by an independent second solve. Work them on paper, in order; difficulty ramps gently.

1. Basic

A barista keeps two unlabeled jars of coffee beans. Jar A contains 75% arabica beans and 25% robusta; Jar B contains 25% arabica and 75% robusta. She flips a fair coin to pick a jar, then draws one bean at random from it. The bean turns out to be arabica. What is the probability she drew from Jar A?

Show answer

Answer:

Apply Bayes' theorem with equal priors for the two jars.

2. Basic

A factory produces phone chargers on two machines. Machine 1 makes 60% of the output and 2% of its chargers are defective; Machine 2 makes 40% of the output and 5% of its chargers are defective. A charger is picked at random from the day's output and found to be defective. What is the probability it came from Machine 2?

Show answer

Answer:

Find the total defect probability, then apply Bayes' theorem.

3. Basic

A clinic screens blood donors for a parasitic infection. 4% of donors are infected. The screening test comes back positive for 75% of infected donors, but it also comes back positive for 5% of uninfected donors. A donor's test comes back positive. What is the probability the donor is actually infected?

Show answer

Answer:

Weight each hypothesis by prior times likelihood. The posterior stays small despite the accurate test because infection is rare.

4. Basic

A regional airline flies a daily route with one of two aircraft: a turboprop on 65% of days and a jet on 35% of days. The turboprop arrives late with probability 0.12; the jet arrives late with probability 0.04. What is the probability that today's flight arrives late?

Show answer

Answer:

The two aircraft types partition the days, so apply the law of total probability. The result is a weighted average, not the plain average of the two rates.

5. Basic

A hiker takes the ridge trail with probability 0.6 and the forest trail with probability 0.4. On the ridge trail she spots a deer with probability 0.25; on the forest trail she spots a deer with probability 0.5. What is the probability she spots a deer? Give an exact fraction.

Show answer

Answer:

Condition on which trail she takes and apply the law of total probability.

6. Basic

In a city, 85% of taxis are green and 15% are blue. A witness to a night-time hit-and-run says the taxi was blue. Under the lighting conditions, the witness identifies a taxi's colour correctly 80% of the time (for either colour). What is the probability the taxi really was blue? Give an exact fraction.

Show answer

Answer:

Apply Bayes' theorem to the witness report.

7. Basic

A helpdesk routes each incoming call to one of two teams. Team A handles 60% of calls and resolves a call on the first try with probability 0.8. Team B handles 40% of calls and resolves on the first try with probability 0.5. A call comes in. What is the probability it is resolved on the first try?

Show answer

Answer:

Weight each team's resolve rate by its share of calls.

8. Basic

Half of the students in a course studied for the final exam. A student who studied passes with probability 0.8. A student who did not study passes with probability 0.4. A randomly chosen student passed. What is the probability that this student studied?

Show answer

Answer:

Apply Bayes with equal priors of 0.5.

9. Basic

At an airport checkpoint, 5% of carry-on bags contain a prohibited item. The scanner beeps for 80% of bags that contain a prohibited item. It also beeps for 10% of bags that do not. A bag makes the scanner beep. What is the probability it contains a prohibited item?

Show answer

Answer:

Bayes with prior 0.05.

10. Basic

In a mountain town it snows on 25% of winter days. The evening forecast predicts snow on 80% of the days on which it actually snows. It also predicts snow on 20% of the days on which it does not snow. Tonight the forecast predicts snow. What is the probability that it snows tomorrow?

Show answer

Answer:

Bayes with prior 0.25 for snow.

11. Basic

An online shop sends parcels with three couriers. Courier A carries 50% of parcels and delivers late with probability 0.1. Courier B carries 30% of parcels and is late with probability 0.2. Courier C carries 20% of parcels and is late with probability 0.4. A parcel arrives late. What is the probability it was sent with Courier C?

Show answer

Answer:

First get the total late probability, then apply Bayes.

12. Basic

A beekeeper knows that 20% of her hives are infested with mites. A quick inspection shows mites in 70% of infested hives. It also wrongly shows mites in 10% of clean hives. She inspects one hive and sees no mites. What is the probability that the hive is infested anyway?

Show answer

Answer:

The evidence is a clean reading, so use the complements 0.3 and 0.9.

Want these problems to schedule themselves? Inkerval brings handwritten practice and spaced repetition together on iPad.

Be first in when the doors open. No spam, ever.

More probability practice