Faulty machine? A Bayesian posterior from one defect
A machine on a line is either healthy or faulty. From experience, 20 percent of machines are faulty. A faulty machine produces a defective item with probability 0.4, while a healthy machine produces a defective item with probability 0.05. You inspect one item from a machine and it is defective.
Using Bayes' rule, what is the probability that the machine is faulty?