Class 12 Maths, Worked in Full Past papersGet updates
Chapter 13 · Probability

Example 19: Defective bolt: made by machine B, P=2869P = \frac{28}{69}

ExamplesBayes' theorem · Section 13.5
The question

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?

Exam answer

Let B1B_1⁠, B2B_2⁠, B3B_3⁠: the bolt is manufactured by machine A, B, C, respectively, and EE⁠: the bolt is defective.

B1B_1⁠, B2B_2 and B3B_3 form a partition of the sample space (each bolt is made by exactly one machine).

P(B1)=25%=25100P(B_1) = 25\% = \frac{25}{100}

P(B2)=35%=35100P(B_2) = 35\% = \frac{35}{100}

P(B3)=40%=40100P(B_3) = 40\% = \frac{40}{100}

P(E∣B1)=5%=5100P(E|B_1) = 5\% = \frac{5}{100}

P(E∣B2)=4%=4100P(E|B_2) = 4\% = \frac{4}{100}

P(E∣B3)=2%=2100P(E|B_3) = 2\% = \frac{2}{100}

By the theorem of total probability,

P(E)=P(B1)P(E∣B1)+P(B2)P(E∣B2)+P(B3)P(E∣B3)=25100⋅5100+35100⋅4100+40100⋅2100=125+140+8010000=34510000\begin{aligned} P(E) &= P(B_1)P(E|B_1) \\ &\quad + P(B_2)P(E|B_2) \\ &\quad + P(B_3)P(E|B_3) \\ &= \frac{25}{100}\cdot\frac{5}{100} \\ &\quad + \frac{35}{100}\cdot\frac{4}{100} \\ &\quad + \frac{40}{100}\cdot\frac{2}{100} \\ &= \frac{125 + 140 + 80}{10000} \\ &= \frac{345}{10000} \end{aligned}

By Bayes' theorem,

P(B2∣E)=P(B2)P(E∣B2)P(E)=14010000÷34510000=140345\begin{aligned} P(B_2|E) &= \frac{P(B_2)P(E|B_2)}{P(E)} \\ &= \frac{140}{10000} \div \frac{345}{10000} \\ &= \frac{140}{345} \end{aligned}

∴\therefore The probability that the defective bolt is manufactured by machine B is 2869\dfrac{28}{69}⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

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

P(made by B and defective)P(defective),\frac{P(\text{made by B and defective})}{P(\text{defective})},

and each "made by ... and defective" is a product: the machine's share of output times its defect rate. That is Bayes' theorem.

Given, to find, and the plan
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: P(B2∣E)P(B_2|E)⁠.
Plan
(1) Name the events; check the partition. (2) Percentages as fractions. (3) Total probability for P(E)P(E)⁠. (4) Bayes' theorem; simplify.

Basics you need

1Percentages as fractions

x%=x100x\% = \frac{x}{100}⁠: 35%=3510035\% = \frac{35}{100}⁠. Basics: working with fractions

2Defect rates are conditional probabilities (Section 13.2)

"Of their outputs, 4 percent (of B's) are defective" is P(defective∣made by B)P(\text{defective} \mid \text{made by B})⁠. Lesson: conditional probability

3Theorem of total probability (Section 13.5.2)

P(E)=∑P(Bi)P(E∣Bi)P(E) = \sum P(B_i)P(E|B_i) over a partition. Lesson: total probability and Bayes' theorem

4Bayes' theorem (Section 13.5)

P(B2∣E)=P(B2)P(E∣B2)P(E)P(B_2|E) = \frac{P(B_2)P(E|B_2)}{P(E)}⁠. Lesson: Bayes' theorem

Solution

  1. Name the events

    Let

    • B1B_1⁠: the bolt is manufactured by machine A;
    • B2B_2⁠: the bolt is manufactured by machine B;
    • B3B_3⁠: the bolt is manufactured by machine C;
    • EE⁠: the bolt is defective.

    B1B_1⁠, B2B_2⁠, B3B_3 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 B1,B2,B3B_1, B_2, B_3⁠, 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 B2B_2⁠.
    A partition: pairwise disjoint, exhaustive, nonzero probabilities. Lesson: Bayes' theorem
  2. Every number as a fraction

    P(B1)=25%=25100,P(B2)=35%=35100,P(B3)=40%=40100,P(E∣B1)=5%=5100,P(E∣B2)=4%=4100,P(E∣B3)=2%=2100.\begin{aligned} P(B_1) &= 25\% = \frac{25}{100}, \\ P(B_2) &= 35\% = \frac{35}{100}, \\ P(B_3) &= 40\% = \frac{40}{100}, \\ P(E|B_1) &= 5\% = \frac{5}{100}, \\ P(E|B_2) &= 4\% = \frac{4}{100}, \\ P(E|B_3) &= 2\% = \frac{2}{100}. \end{aligned}
    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 P(E∣Bi)P(E|B_i)⁠. Keeping the denominator 100 (rather than 14\frac14⁠, 720\frac{7}{20}⁠, 25\frac25⁠) makes every product below have the same denominator 10000. The three shares add to 100100=1\frac{100}{100} = 1⁠, as they must for a partition.
    x%=x100x\% = \frac{x}{100}⁠. Basics: working with fractions
  3. The chance of a defective bolt: total probability

    By the theorem of total probability,

    P(E)=P(B1)P(E∣B1)+P(B2)P(E∣B2)+P(B3)P(E∣B3)=25100⋅5100+35100⋅4100+40100⋅2100=12510000+14010000+8010000=34510000.\begin{aligned} P(E) &= P(B_1)P(E|B_1) \\ &\quad + P(B_2)P(E|B_2) \\ &\quad + P(B_3)P(E|B_3) \\ &= \frac{25}{100}\cdot\frac{5}{100} + \frac{35}{100}\cdot\frac{4}{100} \\ &\quad + \frac{40}{100}\cdot\frac{2}{100} \\ &= \frac{125}{10000} + \frac{140}{10000} + \frac{80}{10000} \\ &= \frac{345}{10000}. \end{aligned}
    start machine bolt multiply along the path bolt B₁: machine A E: defective 25/100 × 5/100 E′: good 25/100 × 95/100 B₂: machine B E: defective 35/100 × 4/100 E′: good 35/100 × 96/100 B₃: machine C E: defective 40/100 × 2/100 E′: good 40/100 × 98/100 25/100 5/100 95/100 35/100 4/100 96/100 40/100 2/100 98/100
    The tree for Example 19. The defective paths have products 12510000\frac{125}{10000} (A), 14010000\frac{140}{10000} (B, rose) and 8010000\frac{80}{10000} (C); together 34510000\frac{345}{10000}⁠.
    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: P(E)=0.0345P(E) = 0.0345 and the B path is 0.01400.0140⁠.
    Multiply along a path, add the paths. Basics: tree diagrams
  4. Made by B, given defective: Bayes' theorem

    By Bayes' theorem,

    P(B2∣E)=P(B2)P(E∣B2)P(E)=14010000÷34510000=140345=2869.\begin{aligned} P(B_2|E) &= \frac{P(B_2)P(E|B_2)}{P(E)} \\ &= \frac{140}{10000} \div \frac{345}{10000} \\ &= \frac{140}{345} = \frac{28}{69}. \end{aligned}
    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: 140=5×28140 = 5 \times 28⁠, 345=5×69345 = 5 \times 69⁠. 28=22×728 = 2^2 \times 7 and 69=3×2369 = 3 \times 23 share no factor. This is the book's 0.01400.0345=2869\frac{0.0140}{0.0345} = \frac{28}{69}⁠.
    Bayes' theorem: one path over all the paths. Lesson: Bayes' theorem
  5. What the answer means

    The other two machines get P(B1∣E)=125345=2569P(B_1|E) = \frac{125}{345} = \frac{25}{69} and P(B3∣E)=80345=1669P(B_3|E) = \frac{80}{345} = \frac{16}{69}⁠, and 25+28+1669=1\frac{25 + 28 + 16}{69} = 1⁠.

    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): 125:140:80125 : 140 : 80⁠. Comparing these products tells you at once which cause is most likely.
    For a partition, the P(Bi∣E)P(B_i|E) add to 1. Lesson: Bayes' theorem
Result

The probability that the defective bolt was manufactured by machine B is 2869\frac{28}{69}⁠.

(Textbook answer: 2869\frac{28}{69}⁠.)

Check it with numbers

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 125+140+80=345125 + 140 + 80 = 345 defective bolts, 140 are from B: 140345≈0.4058\frac{140}{345} \approx 0.4058⁠, the same as 2869≈0.4058\frac{28}{69} \approx 0.4058⁠.

Common mistakes
  1. Answering 0.04 or 0.35. 4% is P(E∣B2)P(E|B_2) and 35% is P(B2)P(B_2)⁠; the question asks for P(B2∣E)P(B_2|E)⁠, which needs both and the other machines too.
  2. Mixing up the event B2B_2 and machine B. In the book's notation machine B is B2B_2⁠, not B1B_1⁠.
  3. Adding the defect rates. 5%+4%+2%5\% + 4\% + 2\% is not P(E)P(E)⁠; each rate must be weighted by its machine's share.
What to take away
  1. With several machines (or causes), P(cause∣effect)P(\text{cause} \mid \text{effect}) is proportional to P(cause)×P(effect∣cause)P(\text{cause}) \times P(\text{effect} \mid \text{cause})⁠.
  2. Keeping a common denominator (here 10000) makes Bayes' theorem a ratio of whole numbers.
  3. Two-machine and three-operator versions: Exercise 13.3, Question 8 and Question 11.

Every fact used, and where it comes from

FactUsed inSource
Mutually exclusive and exhaustive events form a partitionStep 1Section 13.5.1 (Lesson: Bayes' theorem)
x%=x100x\% = \frac{x}{100}⁠; conditional probabilityStep 2Section 13.2 (Lesson: conditional probability)
Theorem of total probabilityStep 3Section 13.5.2 (Lesson: total probability)
Bayes' theoremSteps 4, 5Section 13.5 (Examples 15 to 21)
Cancelling a common factorStep 4Arithmetic (Basics: working with fractions)
Found an error, or want more?

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 →