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?
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?

Solution:

Let E {1} represent the event that item A produces, E {2} represent the event that item B produces, and X represent the event that the generated product is discovered to be defective.

Then P\left(E_{1}\right)=60 \%=60 / 100=3 / 5

P\left(E_{1}\right)=40 \%=40 / 100=2 / 5

Also P\left(X \mid E_{1}\right)=P (item is defective given that it is produced by machine \left.A\right)=2 \%=2 / 100 =1 / 50

Likewise, P\left(X \mid E {2}\right)=P (thing is defective because it was made by a machine $left.B\right)=1 \%=1 / 100. Now, given that item is defective, the probability that item is created by\mathrm{B}is\mathrm{P}\left(\mathrm{E}_{2} \mid \mathrm{A}\right). <!-- /wp:paragraph -->  <!-- wp:paragraph --> We have used Bayes' theorem to arrive at our conclusion. <!-- /wp:paragraph -->  <!-- wp:paragraph --> \mathrm{P}\left(\mathrm{E}_{2} \mid \mathrm{A}\right)=\frac{\mathrm{P}\left(\mathrm{E}_{2}\right) \cdot \mathrm{P}\left(\mathrm{X} \mid \mathrm{E}_{2}\right)}{\mathrm{P}\left(\mathrm{E}_{1}\right) \cdot \mathrm{P}\left(\mathrm{X} \mid \mathrm{E}_{1}\right)+\mathrm{P}\left(\mathrm{E}_{2}\right) \cdot \mathrm{P}\left(\mathrm{X} \mid \mathrm{E}_{2}\right)} <!-- /wp:paragraph -->  <!-- wp:paragraph --> We get the result by swapping the values. <!-- /wp:paragraph -->  <!-- wp:paragraph --> =\frac{\frac{2}{5} \times \frac{1}{100}}{\frac{3}{5} \times \frac{2}{100}+\frac{2}{5} \times \frac{1}{100}} <!-- /wp:paragraph -->  <!-- wp:paragraph --> =\frac{\frac{2}{5} \times \frac{1}{100}}{\frac{1}{500}(6+2)}=\frac{2}{8}\Rightarrow \mathrm{P}\left(\mathrm{E}_{2} \mid \mathrm{A}\right)=\frac{1}{4}$