I am stuck on one of the questions for my class home work. I did the first question
A toy factory produces its toys with three machines A, B, and C. From the total production, 50% are produced by machine A, 30% by machine B, and 20% by machine C. Past statistics show that 4% of the toys produced by machine A are defective, 2% produced by machine B are defective, and 4% of the toys produced by machine C are defective.
(a) What is the probability that a randomly selected toy is defective?
(b) If a randomly selected toy was found to be defective, what is the probability that this toy was produced by machine A?
Let D be the event that the selected product is defective.
Then, Pr(A) = 0.5, Pr(B) = 0.3, Pr(C) = 0.2, Pr(D|A) = 0.04, Pr(D|B) = 0.02, Pr(D|C) = 0.04. We have Pr(D) =Pr(D|A)Pr(A) + Pr(D|B)Pr(B) + Pr(D|C)Pr(C) =(0.04)(0.50) + (0.02)(0.30) + (0.04)(0.20) = 0.034
(b) By Bayes’ theorem, we find
Pr(A|D) = Pr(D|A)Pr(A) Pr(D)= (0.04)(0.50) 0.034 ≈ 0.5882
The second question is sort of the same but does not give me how much each company makes
A company is buying certain machine pieces from three different vendors. Vendor A’s machine you get are broken 15% of times vendor B’s 20% and vendor C 30% of time. Overall the company receives broken machines 20% of time. An inspector randomly chooses one of the machines. What is a probability that the machine is broken and from vendor A?
so what i did was use 20% overall as the P(D) so
Pr(D|A)Pr(A)+ Pr(D|B)Pr(B)+ Pr(D|C)Pr(C) = (.15)(.20)+(.20)(.20)+(.30)(.20)=0.13
So Prob that the mchine is Brocken and from A is (Pr(D|A)Pr(A))/Pr(D)= (.15)(.20)/(0.13)≈ 0.23
IS THIS CORRECT OR AM I WRONG?