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?

Given: let E_{1} be the event that item is produced by A, E_{2} be the event that item is produced by B and X be the event that produced product is found to be defective.

Then

and

Also P(X|E_{1}) = P (item is defective given that it is produced by machine A)

And P(X|E_{2}) = P (item is defective given that it is produced by machine B)

Now the probability that item is produced by B, being given that item is defective, is P(E_{2}|A).

By using bayes’ theorem, we have:

8