Artificial intelligent assistant

Defective component probability A lot of components contain 5% defectives. Each component is subjected to a test that correctly identifies a defective, but given a component is good, there is a 2% chance that these components are also indicated defective. Given a randomly chosen component is declared defective by the tester, compute the probability that it is actually defective.

Use Bayes' formula: $$ P(A|B)=\frac{P(A)P(B|A)}{P(B)} $$ Define $A$ as defective, $B$ as shown defective by test. So we have $$ P(A|B) = \frac{0.05*1}{0.95*0.02+0.05} $$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ce10bdabf7329611831de1b2f28bdd96