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. Futher, 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?