In a bolt factory, machines 1, 2, and 3 respectively produce 20%, 30%, and 50% of the total output. Of their respective outputs, 5%, 3%, and 2% are defective. A bolt is selected at random.
(a) What is the probability that it is defective?
(b) Given that it is defective, what is the probability that it was made by machine 1?