Negative binomial distribution.Calculate the probability that exactly 12 packages are inspected. 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.
I used negative binomial distribution, with $p=$ $\frac{7}{20}$,$r=4$ and $x=8$, where $r$ is the number of successes, $x$ is the number of failures before $r^{th}$ success and $p$ is the probability of success of a particular trial.
$p(x)  = 
\binom {r+x-1}{x}p^r(1-p)^x
$
$p(x=8)  = 
\binom {11}{8}(\frac{7}{20})^4(1-\frac{7}{20})^8=0.079
$
However the answer is 0.119. What have I done wrong?
 A: The distribution is not negative binomial, for in the negative binomial the trials are independent. Here we are not replacing after inspecting. The resulting distribution is sometimes called negative hypergeometric, but the term is little used.
We can use an analysis close in spirit to the one that leads to the negative binomial "formula." We get the $4$-th "success" on the $12$-th trial if we have exactly $3$ successes in the first $11$, and then a success. 
There are $\binom{20}{11}$ equally likely ways to choose the first $11$ items. There are $\binom{7}{3}\binom{13}{8}$ ways to choose $3$ defective and $8$ good.
So the probability exactly $3$ of the first $11$ items are defective is $\dfrac{\binom{7}{3}\binom{13}{8}}{\binom{20}{11}}$.
Suppose we had $3$ defectives in the first $11$ trials. Then there are $9$ items left, of which $4$ are defective.  Thus the conditional probabilit that the $12$-th item is defective is $\frac{4}{9}$. Multiply.
A: Take all possibilities of arranging 7 defective packages amongst 20.
The ones with fourth package on position 12 can be calculated by placing 3 packages among the first 11 and 3 among the last 8:
${{11}\choose{3}} * {{8}\choose{3}} / {{20}\choose{7}}$
(11 choose 3) * (8 choose 3)/(20 choose 7) = 0.11919504644
