This may be a bit of a stupid question, but I genuinely don't understand.
I have the following question:
Two factories produce devices. Factory X produces 500 devices, 50 of which are defective. Factory Y produces 1000 devices, 150 of which are defective.
A device is selected at random and found to be defective; what is the probability that it came from factory X?
So I thought I could define the following events:
Event A - the device came from factory X Event B - the device is defective
And use the formula:
$P(A|B) = \frac{P(A\cap B)}{P(B)}$
However the solutioins decide to use:
$P(A|B) = \frac{P(B|A)*P(A)}{P(B)}$
When do you know which formula to use?
Because $$P(A\cap B) = P(B|A) \cdot P(A)$$