# Probability Question for Defective Machine Parts

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

Problem 2

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?

• It looks as if you did the right thing in the first question (I did not check the arithmetic). There are a couple of typos, we need to divide, not multiply, by $\Pr(D)$. But it looks as if you did actually divide. Sep 19 '15 at 2:34
• @AndréNicolas Okay so the first one is correct. The second one Problem 2 i am not to sure because it just give me the defectiveness of each company but does not tell me how much each company produces. And then it tells me that they receive 20% defective overall so i just multiplied that by Company A,B,C I am not sure if that is the correct way to do it? Sep 19 '15 at 2:37
• @NBera, No. Why are you claiming $\Pr(A)=\Pr(B)=\Pr(C)=0.20$ and $\Pr(D)=0.13$? $$\Pr(D)= 0.15\Pr(A)+ 0.20\Pr(B)+ 0.25\Pr(C) =0.20$$ Assume $\Pr(A)=\Pr(B)=\Pr(C)=\tfrac 13$, then find $\Pr(A\cap D)= \Pr(A)\Pr(D\mid A)$ Sep 19 '15 at 2:42
• Okay so... in other words it would be something like (.15)(1/3)+(.20)(1/3)+(.30)(1/3)= Pr(D) ?? Sep 19 '15 at 2:50
• @GrahamKemp: If the company buys in equal proportion from the three vendors, the overall defective rate cannot be $20\%$. Sep 19 '15 at 3:05

There is not enough information to solve the second problem. If it gets all its machine pieces from B, which is perfectly possible from the given numbers, then the probability the thing comes from A and is broken is $0$. But it also possible to arrange the buying pattern so that a non-zero proportion is bought from A, and there is a non-zero probability the machine piece is broken and comes from A.
• You are welcome. Note that we cannot assume that the company gets its machines in equal proportion from all the suppliers.. For if it did, the overall broken proportion would be greater than $20\%$. In fact it would be $(1/3)(0.15)+(1/3)(0.20)+(1/3)(0.30)$, about $21.66\%$. Sep 19 '15 at 3:04