Drawing with Replacement Say I have a bag of n marbles, red and blue, and every time I pull out a red marble I colour it blue and replace it.  What is P(# of trials until all blue marbles = k)?  What kind of distribution would this follow if draws are completely random?
 A: In analogy with the coupon collector's problem the easy thing to calculate is the expected number of draws.  If you start with $r$ red marbles and $b$ blue ones, the expected time to color the first marble blue is $\frac {r+b}r$, the time to color the second one after coloring the first is $\frac {r+b}{r-1}$ and so on.  The expected time from start to color $k$ marbles is then $(r+b)(H_r-H_{r-k})$ where $H_i$ are the harmonic numbers
The distribution is much more difficult.
A: Label the red balls $1,\ldots,r$.  For any fixed $k$, let $p_1$ be the probability that ball $1$ is not selected in these $k$ draws, $p_{1,2}$ the probability that neither ball $1$ nor ball $2$ is selected, and so on.  Using inclusion/exclusion, the probability that all red balls are selected within the first $k$ draws is
$$P_k=1-p_1-p_2-\cdots+p_{1,2}+\cdots-p_{1,2,3}-\cdots+(-1)^rp_{1,\ldots,r}\ .$$
But
$$p_1=p_2=\cdots=\Bigl(\frac{n-1}{n}\Bigr)^k$$
and
$$p_{1,2}=\cdots=\Bigl(\frac{n-2}{n}\Bigr)^k$$
and so on.  Therefore
$$P_k=\sum_{j=0}^r (-1)^j\Bigl({r\atop j}\Bigr)\Bigl(\frac{n-j}{n}\Bigr)^k$$
and the probability you want is $P_k-P_{k-1}$.
