Example 19: Defective bolt: made by machine B,
In a factory which manufactures bolts, machines A, B and C manufacture respectively 25%, 35% and 40% of the bolts. Of their outputs, 5, 4 and 2 percent are respectively defective bolts. A bolt is drawn at random from the product and is found to be defective. What is the probability that it is manufactured by the machine B?
Let , , : the bolt is manufactured by machine A, B, C, respectively, and : the bolt is defective.
, and form a partition of the sample space (each bolt is made by exactly one machine).
By the theorem of total probability,
By Bayes' theorem,
The probability that the defective bolt is manufactured by machine B is .
Want the reason behind every step, the basics and the checks?
Weigh each machine by how much it makes and how often it fails. A defective bolt comes from A, B or C. Machine B's share of the defective bolts is
and each "made by ... and defective" is a product: the machine's share of output times its defect rate. That is Bayes' theorem.
- Given
- Shares of output: A 25%, B 35%, C 40%. Defective: 5% of A's bolts, 4% of B's, 2% of C's. The bolt drawn is defective.
- To find
- The probability that it was made by machine B: .
- Plan
- (1) Name the events; check the partition. (2) Percentages as fractions. (3) Total probability for . (4) Bayes' theorem; simplify.
Basics you need
"Of their outputs, 4 percent (of B's) are defective" is . Lesson: conditional probability
over a partition. Lesson: total probability and Bayes' theorem
Solution
Name the events
Let
- : the bolt is manufactured by machine A;
- : the bolt is manufactured by machine B;
- : the bolt is manufactured by machine C;
- : the bolt is defective.
, , are mutually exclusive and exhaustive (each bolt is made by exactly one machine), and each has nonzero probability, so they form a partition of the sample space.
The machines are the causes; the defect is the effect we see. The book names these events , and we keep its names. Take care not to mix up the machine called B with the event names: the event "made by machine B" is .A partition: pairwise disjoint, exhaustive, nonzero probabilities. Lesson: Bayes' theoremEvery number as a fraction
A bolt drawn at random from the whole product comes from machine B with probability equal to B's share, 35%. "Of their outputs, 5, 4 and 2 percent are respectively defective" gives the defect rate of each machine, so these are . Keeping the denominator 100 (rather than , , ) makes every product below have the same denominator 10000. The three shares add to , as they must for a partition.The chance of a defective bolt: total probability
By the theorem of total probability,
The tree for Example 19. The defective paths have products (A), (B, rose) and (C); together . A defective bolt came from exactly one machine, so the three paths are mutually exclusive and their probabilities add. In decimals these are the book's numbers: and the B path is .Multiply along a path, add the paths. Basics: tree diagramsMade by B, given defective: Bayes' theorem
By Bayes' theorem,
The top is the B path, the bottom is all defective bolts; the common denominator 10000 cancels. Then divide 140 and 345 by their highest common factor 5: , . and share no factor. This is the book's .Bayes' theorem: one path over all the paths. Lesson: Bayes' theoremWhat the answer means
The other two machines get and , and .
Machine C makes the most bolts (40%) but has the lowest defect rate, so it is the least likely source of a defective bolt. Machine B makes 35% of the bolts but about 40.6% of the defective ones.
Each machine's chance is proportional to (share of output) × (defect rate): . Comparing these products tells you at once which cause is most likely.For a partition, the add to 1. Lesson: Bayes' theorem
The probability that the defective bolt was manufactured by machine B is .
(Textbook answer: .)
Picture 10000 bolts. Machine A makes 2500, of which 5%, 125, are defective; B makes 3500, of which 4%, 140, are defective; C makes 4000, of which 2%, 80, are defective. Of the defective bolts, 140 are from B: , the same as .
- Answering 0.04 or 0.35. 4% is and 35% is ; the question asks for , which needs both and the other machines too.
- Mixing up the event and machine B. In the book's notation machine B is , not .
- Adding the defect rates. is not ; each rate must be weighted by its machine's share.
- With several machines (or causes), is proportional to .
- Keeping a common denominator (here 10000) makes Bayes' theorem a ratio of whole numbers.
- Two-machine and three-operator versions: Exercise 13.3, Question 8 and Question 11.
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| Mutually exclusive and exhaustive events form a partition | Step 1 | Section 13.5.1 (Lesson: Bayes' theorem) |
| ; conditional probability | Step 2 | Section 13.2 (Lesson: conditional probability) |
| Theorem of total probability | Step 3 | Section 13.5.2 (Lesson: total probability) |
| Bayes' theorem | Steps 4, 5 | Section 13.5 (Examples 15 to 21) |
| Cancelling a common factor | Step 4 | Arithmetic (Basics: working with fractions) |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →