What is the average number of balls one should extract until all three colours have appeared? 
Suppose an urn contains a large number of balls. 50% of the balls are black, 30% are white and 20% are red. Balls are extracted randomly, one at a time, recorded and returned to the urn. What is the average number of balls one should extract until all three colours have appeared?

Should I use the geometric distribution for this?
 A: Consider the sequence of colours of extracted balls. When all three colours have been found for the first time, note that one colour must appear exactly once at the very end of the sequence; the other two colours must appear at least once before that, but can appear in any order.
Let $n\ge2$ be the number of balls drawn before the final ball. Suppose this final ball is black (probability 0.5), then the preceding balls are non-black ($0.5^n$) but not all red ($0.2^n$) or not all white ($0.3^n$). The probability that this kind of sequence occurs is
$$0.5(0.5^n-0.3^n-0.2^n)$$
Similar expressions arise if the final ball is red or white, so the probability that exactly $n$ balls are drawn before the final ball is
$$p(n)=0.5(0.5^n-0.3^n-0.2^n)+\\
0.3(0.7^n-0.5^n-0.2^n)+\\
0.2(0.8^n-0.5^n-0.3^n)$$
Since almost all sequences contain all three colours, $\sum_{n=2}^\infty p(n)=1$. The expected number of balls needed is thus
$$E=1+\sum_{n=2}^\infty np(n)$$
$$=1+\sum_{n=2}^\infty n(0.5(0.5^n-0.3^n-0.2^n)+0.3(0.7^n-0.5^n-0.2^n)+0.2(0.8^n-0.5^n-0.3^n))$$
$$=1+0.5\sum_{n=2}^\infty n(0.5^n-0.3^n-0.2^n)+0.3\sum_{n=2}^\infty n(0.7^n-0.5^n-0.2^n)+0.2\sum_{n=2}^\infty n(0.8^n-0.5^n-0.3^n)$$
$$=1+\frac12×\frac{843}{784}+\frac3{10}×\frac{787}{144}+\frac15×\frac{852}{49}$$
$$=\frac{559}{84}$$
A: I confess I don't see a short cut here.  Maybe someone will help.  The brute force approach is to consider the cases.
Case 1.  With probability $\frac12$, the first ball is black.  Now, suppose you took out all the black balls.  That leaves an urn that is $\frac35$ white balls and $\frac25$ red balls.  How long would it take to get both of those colors?  Again, we would break out the two possible cases—white ball first, or red ball first.  That analysis would yield an average count of
$$
\frac35\left(1+\frac52\right)+\frac25\left(1+\frac53\right)
    = 1+\frac32+\frac23 = \frac{19}{6}
$$
But of course, those black balls are really there, and because half of the balls are black, that count is actually doubled to $\frac{19}{3}$.  That plus that first black ball makes $\frac{22}{3}$.
Case 2. With probability $\frac{3}{10}$, the first ball is white.  Again, suppose you took out all the white balls, leaving an urn that is $\frac57$ black balls and $\frac27$ red balls.  Getting at least one black and one red ball would require an average count of
$$
1+\frac52+\frac25 = \frac{39}{10}
$$
Adding those white balls back in inflates that number by a ratio of $\frac{10}{7}$ to $\frac{39}{7}$, and then adding in that first white ball gives us $\frac{46}{7}$.
Case 3.  Finally, with probability $\frac15$, the first ball is red.  Taking out all of the red balls leaves an urn that is $\frac58$ black balls and $\frac38$ white balls.  Getting at least one of each requires an average count of
$$
1+\frac53+\frac35 = \frac{49}{15}
$$
Adding those red balls back in inflates that by a ratio of $\frac{5}{4}$ to $\frac{49}{12}$.  That plus that first white ball gives us $\frac{61}{12}$.
Putting the three cases together, we get an overall average count of
$$
\frac12 \times \frac{22}{3} + \frac{3}{10} \times \frac{46}{7}
                            + \frac15 \times \frac{61}{12}
    = \frac{11}{3} + \frac{138}{70} + \frac{61}{60}
    = \frac{559}{84} \doteq 6.65476
$$
That result is borne out by simulation, but as I say, I'm sorry I can't find an easier way to that answer.
