19 balls in a bag: Expectation question In a bag, there is 1 black, 2 red, 2 blue, 2 green, 2 yellow, 2 orange, and 8 white balls. A "pull" refers to taking 1 ball out of the bag, noting its colour, then replacing it. 
What is the expected number of pulls needed so that you will have pulled at least one ball of each colour?
 A: One approach starts with finding the exponential generating function of the probability that we have a complete set of colors after $n$ draws.  If you are not familiar with generating functions, you might find it useful to read the answers to this question: How Can I Learn About Generating Functions?
Let's say that $p_n$ is the probability that we have a complete set of colors after $n$ draws (not necessarily the least such $n$).  Then the exponential generating function of $p_n$ is
$$g(x) = \left( \frac{1}{19} x + \frac{1}{2!} \frac{1}{19^2} x^2 + \frac{1}{3!} \frac{1}{19^3} x^3 + \dots \right) \cdot \\
\left( \frac{1}{19} 2x + \frac{1}{2!} \frac{2^2}{19^2} x^2 + \frac{1}{3!} \frac{2^3}{19^3}  x^3 + \dots \right)^5 \cdot \\
\left( \frac{1}{19} 8x + \frac{1}{2!} \frac{8^2}{19^2}  x^2 + \frac{1}{3!} \frac{8^3}{19^3}  x^3 + \dots \right)
$$
so
$$g(x) = (e^{x/19}-1)(e^{2x/19}-1)^5 (e^{8x/19}-1)$$
If we would like to know the exponential generating function of $q_n = 1 - p_n$, which is the probability that we do not have a complete set of colors after $n$ draws, its EGF is simply
$$h(x) = e^x - g(x)$$
Suppose $T$ is the number of the first draw when we have a complete set of colors.  Then 
$$E(T) = \sum_{n=0}^{\infty} P(T>n)$$
(an identity which is true for any discrete random variable $T$ which takes on only non-negative values), so
$$E(T) = \sum_{n=0}^{\infty} q_n$$
Now we can take advantage of $h(x) = \sum_{n=0}^{\infty} \frac{1}{n!} q_n x^n$ and the identity $n! = \int_{0}^{\infty} x^n e^{-x} \; dx$ to show
$$E(T) = \int_0^{\infty} e^{-x} h(x) \; dx$$
Evaluation of the integral results in $E(T) = \boxed{28.7176}$.
