Markku M. answered 03/18/22
PhD in Biostatistics
The question is asking if we pick a computer and we find it to be defective, we want to know for this defective computer what is the probability it came from Factory A. Let Event D be that a computer is defective, Event A is that the computer came from Factory A and Event B is the computer came from Factory B. Thus mathematically the question is P(A | D) = ?
Since Factory A produced 3 times as many computers as Factory B that means if we had 4 computers to pick from 3 would be from A and 1 would be from B. Thus the probability a computer comes from Factory A is 3/4 = .75 and the probability a computer comes from Factory B is 1/4 = 0.25
We would write that mathematically as follows:
P(A) = .75 and P(B) = .25
The question tells us the probability a computer from Factory A being defective is 0.038 and the probability a computer is defective from Factory B is 0.034
We would write that mathematically as follows:
P(D | A) = 0.038 and P(D | B) = 0.034; these are conditional probabilities where if we already know where a computer came from it is the probability it is defective with respect to each factory.
With these 4 pieces of information we can answer the question P(A | D) = ?
P(A | D) = P(A N D) / P(D)
P(A N D) = probability of the intersection of Factory A and Defective, meaning what is the probability we randomly select a computer and it will both be defective and be from factory A
P(D) = probability of a randomly selected computer being defective
According to Bayes Rule: P( Event 1 | Event 2) = P( Event 1 N Event 2) / P( Event 2)
you can see that using algebra we can rewrite this to be:
P(Event 2)*P(Event 1 | Event 2) = P(Event 1 N Event 2)
Thus P(A N D) = P(D | A)*P(A) = 0.038*.75 = 0.0285, Now we have our numerator, now we just need our denominator which is P(D)
well P(D) = P(A N D) + P(B N D), because there are only two ways a computer can be defective it has to come from either Factory A or Factory B, so if we add up the intersections of defective from all the places that can produce defective computers we get the probability of being defective. So we need P(B N D) which we can find in the same manner as we found P(A N D).
P(B N D) = P(D | B)*P(B) = 0.034*0.25 = 0.0085
P(D) = P(A N D)+P(B N D) = 0.0285+0.0085 = 0.037
Now we can answer our question P(A | D) = P(A N D) / P(D) = 0.0285 / 0.037 = 0.7703
Thus the probability a computer which is found to be defective came from Factory A is 0.7703