What is the expected value of the number $X$ of rolling a die until we obtain 4 different results (for example, $X=6$ in case of the event $(1,4,4,1,5,2)$)?
I'm not only interested in technical details of a solution---I can solve it to some extent, see below---but even more in the following:
- Is it a known problem, does it have a name?
- Does there exist a closed-form expression? (See below for a series expansion)
- Does there exist a feasible algorithm/formula to compute it if the die is not "fair" and each face has possibly a different probability?
My attempt: $EX=\sum_{j=4}^\infty j\, P(X=j)$. Clearly, $P(X=j)$ is $1/6^j$ multiplied by the number of ways to obtain $X=j$. The number of ways is $6\choose 3$ (the choice of 3 elements that occur within the first $j-1$ rolls) multiplied by $3$ (the last roll) multiplied by the number of surjective functions from $j-1$ to 3 (the number of ways what can happen in the first $j-1$ rolls, if the three outputs are given). Further, the number of surjective functions can be expressed via Stirling numbers of the second kind: so in this way, I can get a series expression, although not a very nice one.