I am reading "Mathematical Statistics with Applications", 7th edition from Wackerly, Mendelhall and Scheaffer.
On example 2.23 on page 71, it is unclear how they calculate P(A|B).
Example 2.23: An electronic fuse is produced by five production lines in a manufacturing operation. The fuses are costly, are quite reliable, and are shipped to suppliers in 100-unit lots. Because testing is destructive, most buyers of the fuses test only a small number of fuses before deciding to accept or reject lots of incoming fuses. All five production lines produce fuses at the same rate and normally produce only 2% defective fuses, which are dispersed randomly in the output. Unfortunately, production line 1 suffered mechanical difficulty and produced 5% defectives during the month of March. This situation became known to the manufacturer after the fuses had been shipped. A customer received a lot produced in March and tested three fuses. One failed. What is the probability that the lot was produced on line 1? What is the probability that the lot came from one of the four other lines?
Solution: Let B denote the event that a fuse was drawn from line 1 and let A denote the event that a fuse was defective. Then it follows directly that
$P(B) = 0.2$ and $P(A|B) = 3(.05)(.95)^2 = .135375$
$P(B)$ is clear, because it is one of the 5 production lines.
But I'm not sure how they arrive at this result with $P(A|B)$. Anyone can explain how this is computed?
Using your notation:
$P(B|A) = P(A,B) / P(A)$ $= P(A,B) / (P(A,B)+P(A,B’))$
where $B’$ is the event that the sample was not chosen from line 1.
One test failed while two succeeded. The failure might equally have been any one of the three tests. Therefore:
$P(A,B) = 0.2 * 3 * 0.05 * 0.95^2$ $P(A,B’) = 0.8 * 3 * 0.02 * 0.98^2$
$P(B|A) = (5 * 95^2) $ $/ (5 * 95^2 + 8 * 98^2)$
$= 45125 / 121957 = 0.37$ approximately
This value is higher than the prior chance of line 1 being selected $(0.2)$ but is still far from being convincing. It is a plausible result though so our arithmetic may be accurate!