I have a problem where a shipment contains $K$ good and $N-K$ defective components. And we pick at random $ n\leq K$ components and test them. I am trying to show that the probability $p$ that $k$ of the tested components are good is equal to: $$p = \frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}$$
So I know the following:
- $\binom{N}{n}$ is the number of ways of picking $n$ element distinct subsets from the $N$ total components.
- $\binom{K}{k}$ is the number of ways of picking $k$ element distinct subsets from the good components.
- $\binom{N-K}{n-k}$ is the number of ways of picking $n-k$ element distinct subsets from the $N-k$ defective components.
Now, here is where I get confused.
We are trying to show that the probability $p$ that $k$ of the tested components are good is equal to the equation above. And I also know that the probability of an event consisted of $r$ elements equals $\frac{r}{N}$ (classical probability). I understand why we divided by $\binom{N}{n}$, but I do not understand why we multiplied by $\binom{N-K}{n-k}$ if we are trying to find the probability that $k$ are good.
Doesn't it defeat the purpose of multiplying by the probability of the defective components? And similarly, what if we were trying to find the probability $p$ that $k$ of the tested components were defective?