Four machines A, B, C, D produce 40%, 30%, 20%, and 10% of the total production of a factory. Percentages of defective items of these machines are 3%, 4%, 5%, and 7%, respectively. If an item selected at random is defective, find the probability that it was produced by machine B. Solution by Bayes theorem p( produced by machine B.)=(.3*.04)/(.4*.03+.3*.03+.2*.05+.1*.07)=.32.