# Calculating Joint Probability from Conditional Probability

I have come across a question on joint and conditional probability. In a shipment of 20 packages, 7 packages are damaged. The packages are randomly inspected, one at a time, without replacement, until the fourth damaged package is discovered. Calculate the probability that exactly 12 packages are inspected.

Part of Solution: The requested probability can be determined as P(3 of first 11 damaged)P(12th is damaged | 3 of first 11 damaged).

I don't know how they came up with this part of the solution shown above, can someone explain how they got that?

## 1 Answer

You need to inspect exactly 12 packages out of 20. The only way this is possible is if you hit 4 damaged packages, with the 4'th one occuring on the 12'th inspection (which would cause you to stop).

So

$$P(\mbox{stop on package 12}) = P(\mbox{3 of first 11 damaged and 12'th is damaged})=P(\mbox{12'th is damaged|3 of first 11 damaged})P(\mbox{3 of first 11 damaged}).$$