Exercise 13.3 · Q8: Two machines: defective item made by B,
A factory has two machines A and B. Past record shows that machine A produced 60% of the items of output and machine B produced 40% of the items. Further, 2% of the items produced by machine A and 1% produced by machine B were defective. All the items are put into one stockpile and then one item is chosen at random from this and is found to be defective. What is the probability that it was produced by machine B?
Let : the item is produced by machine A, : the item is produced by machine B, and : the item is defective.
and form a partition of the sample space (each item is produced by exactly one machine).
and
and
By the theorem of total probability,
By Bayes' theorem,
The probability that it was produced by machine B is .
Want the reason behind every step, the basics and the checks?
A defective item comes either from machine A or from machine B. Machine A makes more items and has twice the defect rate, so most defective items are A's. Bayes' theorem gives machine B's share of the defective items: B's route to a defective item divided by both routes together.
- Given
- Machine A makes 60% of the items and machine B makes 40%. Of A's items 2% are defective; of B's items 1% are defective. One item is picked at random from the whole stockpile and it is defective.
- To find
- The probability that this item was produced by machine B: .
- Plan
- (1) Name the two causes and the result; check the partition. (2) Turn the percentages into fractions. (3) Total probability for . (4) Bayes' theorem.
Basics you need
and . Exact fractions keep every later step exact. Basics: classical probability
"2% of the items produced by machine A were defective" is about A's items only: it is , not . Lesson: conditional probability
For a partition : and . Lesson: Bayes' theorem
Solution
Name the events
Let
- : the item is produced by machine A;
- : the item is produced by machine B;
- : the item is defective.
and form a partition of the sample space (all the items in the stockpile): no item is made by both machines, every item is made by one of them, and each machine makes some items.
The machine is the cause; "defective" is the result we observe. We use the letter for the result, because the letters A and B already name the machines.Partition: pairwise disjoint, exhaustive, nonzero probabilities (Section 13.5.1). Lesson: Bayes' theoremThe four probabilities as fractions
An item picked at random from the stockpile was made by A with probability 60% and by B with probability 40%:
The defect rates of the two machines are
"Chosen at random" from the stockpile means every item is equally likely, so a machine's share of the output is the probability that the item came from it. The defect rates are measured inside each machine's own output, so they are conditional probabilities.; a rate inside one group is a conditional probability. Lesson: conditional probabilityThe chance of a defective item
Since and form a partition, by the theorem of total probability
The tree for Question 8. The rose path (machine B, then defective) has product ; the green path (machine A, then defective) has . Together, . A defective item comes from exactly one machine, so the two path probabilities add. Here . Keeping unsimplified (it equals ) makes the next step easy, because the 250 cancels.Multiply along a path, add the paths. Basics: tree diagramsMade by B, given defective: Bayes' theorem
By Bayes' theorem,
The top is machine B's path to a defective item; the bottom is both paths. Out of every 4 parts of defect probability, 1 belongs to machine B and 3 to machine A.Dividing by a fraction is multiplying by its flip. Basics: dividing by a fractionA quick sense check
For machine A, , and .
Machine B makes of all items but only of the defective ones, because its defect rate is half of A's.
A defective item was made by exactly one machine, so the two updated probabilities must add to 1. Learning that the item is defective lowers B's chance from to .The posterior probabilities of a partition add to 1. Lesson: Bayes' theorem
The probability that the defective item was produced by machine B is . (Textbook answer: .)
Picture a stockpile of 10000 items. Machine A made 6000 of them and are defective; machine B made 4000 and are defective. So items are defective, and 40 of them came from B: , the same as .
- Answering . That is B's share of all items, before we know the item is defective.
- Answering 1%. That is , the chance that an item from B is defective. The question asks the reverse, .
- Adding 2% and 1%. The defect rates must first be weighted by each machine's share of the output.
- Writing for "defective". A and B already name the machines; use another letter, such as , for the result.
- Shares of the output give the first-stage probabilities; defect rates give the second-stage (conditional) probabilities.
- A machine with a low defect rate gets a smaller share of the defective items than of all the items.
- The same question with three machines is book Example 19 (Examples 15 to 21) and Question 11.
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| Partition of a sample space | Step 1 | Section 13.5.1 (Lesson: Bayes' theorem) |
| Percentages as probabilities; equally likely items | Step 2 | Classical probability, Class XI (Basics: classical probability) |
| Conditional probability | Step 2 | Section 13.2 (Lesson: conditional probability) |
| Theorem of total probability | Step 3 | Section 13.5.2 (Lesson: Bayes' theorem) |
| Bayes' theorem | Steps 4, 5 | Section 13.5; Example 19 has three machines (Examples 15 to 21) |
| Dividing by a fraction | Step 4 | Arithmetic (Basics: dividing by a fraction) |
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 →