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

Exercise 13.3 · Q8: Two machines: defective item made by B, P=14P = \frac14

Exercise 13.3Bayes' theorem · Section 13.5
The question

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?

Exam answer

Let E1E_1⁠: the item is produced by machine A, E2E_2⁠: the item is produced by machine B, and DD⁠: the item is defective.

E1E_1 and E2E_2 form a partition of the sample space (each item is produced by exactly one machine).

P(E1)=60%=35P(E_1) = 60\% = \frac35 and P(E2)=40%=25P(E_2) = 40\% = \frac25

P(D∣E1)=2%=150P(D|E_1) = 2\% = \frac{1}{50} and P(D∣E2)=1%=1100P(D|E_2) = 1\% = \frac{1}{100}

By the theorem of total probability,

P(D)=P(E1)P(D∣E1)+P(E2)P(D∣E2)=35⋅150+25⋅1100=3250+1250=4250\begin{aligned} P(D) &= P(E_1)P(D|E_1) \\ &\quad + P(E_2)P(D|E_2) \\ &= \frac35\cdot\frac{1}{50} + \frac25\cdot\frac{1}{100} \\ &= \frac{3}{250} + \frac{1}{250} = \frac{4}{250} \end{aligned}

By Bayes' theorem,

P(E2∣D)=P(E2)P(D∣E2)P(D)=1250÷4250=1250×2504\begin{aligned} P(E_2|D) &= \frac{P(E_2)P(D|E_2)}{P(D)} \\ &= \frac{1}{250} \div \frac{4}{250} \\ &= \frac{1}{250} \times \frac{250}{4} \end{aligned}

∴\therefore The probability that it was produced by machine B is 14\dfrac14⁠.

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

The one idea this problem is built on

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, to find, and the plan
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: P(E2∣D)P(E_2|D)⁠.
Plan
(1) Name the two causes and the result; check the partition. (2) Turn the percentages into fractions. (3) Total probability for P(D)P(D)⁠. (4) Bayes' theorem.

Basics you need

1Percentages as fractions

60%=60100=3560\% = \frac{60}{100} = \frac35 and 2%=2100=1502\% = \frac{2}{100} = \frac{1}{50}⁠. Exact fractions keep every later step exact. Basics: classical probability

2Conditional probability (Section 13.2)

"2% of the items produced by machine A were defective" is about A's items only: it is P(D∣E1)P(D|E_1)⁠, not P(D)P(D)⁠. Lesson: conditional probability

3Total probability and Bayes' theorem (Section 13.5)

For a partition E1,E2E_1, E_2⁠: P(D)=∑P(Ei)P(D∣Ei)P(D) = \sum P(E_i)P(D|E_i) and P(E2∣D)=P(E2)P(D∣E2)P(D)P(E_2|D) = \frac{P(E_2)P(D|E_2)}{P(D)}⁠. Lesson: Bayes' theorem

4Dividing by a fraction

1250÷4250=1250×2504=14\frac{1}{250} \div \frac{4}{250} = \frac{1}{250} \times \frac{250}{4} = \frac14⁠. Basics: dividing by a fraction

Solution

  1. Name the events

    Let

    • E1E_1⁠: the item is produced by machine A;
    • E2E_2⁠: the item is produced by machine B;
    • DD⁠: the item is defective.

    E1E_1 and E2E_2 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 DD 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' theorem
  2. The 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%:

    P(E1)=60%=35,P(E2)=40%=25.\begin{aligned} P(E_1) &= 60\% = \frac35, \\ P(E_2) &= 40\% = \frac25. \end{aligned}

    The defect rates of the two machines are

    P(D∣E1)=2%=150,P(D∣E2)=1%=1100.\begin{aligned} P(D|E_1) &= 2\% = \frac{1}{50}, \\ P(D|E_2) &= 1\% = \frac{1}{100}. \end{aligned}
    "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%=a100a\% = \frac{a}{100}⁠; a rate inside one group is a conditional probability. Lesson: conditional probability
  3. The chance of a defective item

    Since E1E_1 and E2E_2 form a partition, by the theorem of total probability

    P(D)=P(E1)P(D∣E1)+P(E2)P(D∣E2)=35⋅150+25⋅1100=3250+1250=4250.\begin{aligned} P(D) &= P(E_1)P(D|E_1) \\ &\quad + P(E_2)P(D|E_2) \\ &= \frac35\cdot\frac{1}{50} + \frac25\cdot\frac{1}{100} \\ &= \frac{3}{250} + \frac{1}{250} = \frac{4}{250}. \end{aligned}
    start machine item multiply along the path item E₁: machine A D: defective 3/5 × 1/50 = 3/250 D′: good 3/5 × 49/50 E₂: machine B D: defective 2/5 × 1/100 = 1/250 D′: good 2/5 × 99/100 3/5 1/50 49/50 2/5 1/100 99/100
    The tree for Question 8. The rose path (machine B, then defective) has product 1250\frac{1}{250}⁠; the green path (machine A, then defective) has 3250\frac{3}{250}⁠. Together, P(D)=4250P(D) = \frac{4}{250}⁠.
    A defective item comes from exactly one machine, so the two path probabilities add. Here 25⋅1100=2500=1250\frac25\cdot\frac{1}{100} = \frac{2}{500} = \frac{1}{250}⁠. Keeping 4250\frac{4}{250} unsimplified (it equals 2125\frac{2}{125}⁠) makes the next step easy, because the 250 cancels.
    Multiply along a path, add the paths. Basics: tree diagrams
  4. Made by B, given defective: Bayes' theorem

    By Bayes' theorem,

    P(E2∣D)=P(E2)P(D∣E2)P(D)=1250÷4250=1250×2504=14.\begin{aligned} P(E_2|D) &= \frac{P(E_2)P(D|E_2)}{P(D)} \\ &= \frac{1}{250} \div \frac{4}{250} \\ &= \frac{1}{250} \times \frac{250}{4} = \frac14. \end{aligned}
    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 fraction
  5. A quick sense check

    For machine A, P(E1∣D)=3250÷4250=34P(E_1|D) = \frac{3}{250} \div \frac{4}{250} = \frac34⁠, and 14+34=1\frac14 + \frac34 = 1⁠.

    Machine B makes 25\frac25 of all items but only 14\frac14 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 25=0.4\frac25 = 0.4 to 14=0.25\frac14 = 0.25⁠.
    The posterior probabilities of a partition add to 1. Lesson: Bayes' theorem
Result

The probability that the defective item was produced by machine B is 14\frac14⁠. (Textbook answer: 14\frac14⁠.)

Check it with numbers

Picture a stockpile of 10000 items. Machine A made 6000 of them and 0.02×6000=1200.02 \times 6000 = 120 are defective; machine B made 4000 and 0.01×4000=400.01 \times 4000 = 40 are defective. So 120+40=160120 + 40 = 160 items are defective, and 40 of them came from B: 40160=0.25\frac{40}{160} = 0.25⁠, the same as 14=0.25\frac14 = 0.25⁠.

Common mistakes
  1. Answering 25\frac25⁠. That is B's share of all items, before we know the item is defective.
  2. Answering 1%. That is P(D∣E2)P(D|E_2)⁠, the chance that an item from B is defective. The question asks the reverse, P(E2∣D)P(E_2|D)⁠.
  3. Adding 2% and 1%. The defect rates must first be weighted by each machine's share of the output.
  4. Writing AA for "defective". A and B already name the machines; use another letter, such as DD⁠, for the result.
What to take away
  1. Shares of the output give the first-stage probabilities; defect rates give the second-stage (conditional) probabilities.
  2. A machine with a low defect rate gets a smaller share of the defective items than of all the items.
  3. 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

FactUsed inSource
Partition of a sample spaceStep 1Section 13.5.1 (Lesson: Bayes' theorem)
Percentages as probabilities; equally likely itemsStep 2Classical probability, Class XI (Basics: classical probability)
Conditional probability P(D∣E)P(D|E)Step 2Section 13.2 (Lesson: conditional probability)
Theorem of total probabilityStep 3Section 13.5.2 (Lesson: Bayes' theorem)
Bayes' theoremSteps 4, 5Section 13.5; Example 19 has three machines (Examples 15 to 21)
Dividing by a fractionStep 4Arithmetic (Basics: dividing by a fraction)
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 →