Rolling dice until each has taken a specific value I'm facing the following problem.
Let's say I have $N$ dice in hand. I need to calculate how much time I should roll my dice to make all of them equal to some selected (pre-defined) number. Each time I roll the selected number with some dice, I remove these dice from my hand and keep rolling the rest.
Example:
I have $2$ dice and I want to roll sixes. When I get one, I will remove this die and will roll one die instead of two. How many times do I need to roll my dice in order to get sixes in all (to make my hand empty)?
I suppose that the correct answer is (for two dice) ${1\over6} +{1\over6} + {1\over6}\times{1\over6}$, but it seems to be wrong because I tried to implement an algorithm to calculate the probability, in which I ran 1M continuous rolls to calculate the average amount of required rolls.
Any help is appreciated.
 A: I will try to interpret the question in a more formal way. Let $X_1, \ldots, X_n$ be i.i.d. geometric random variables with rate of success $p$ (which is $1/6$ in this case). Find $E[\max\{X_1, \ldots, X_n\}]$.
My approach is to first compute the distribution of $Y = \max\{X_1, \ldots, X_n\}$. Suppose $y \in \mathbb N$ is given.
\begin{align*}
P(Y \le y) & =
\prod_{i=1}^n P(X_i \le y) \\
& = \prod_{i=1}^n \left(1 - P(X_i > y)\right) \\
& = \left(1 - (1 - p)^y\right)^n \\
\therefore P(Y = y) & = (1 - (1 - p)^y)^n - (1 - (1 - p)^{y-1})^n.
\end{align*}
(Note that $P(Y = 1) = p^n$.)
For ease of writing, let $q = 1 - p$.
The expected value of $Y$ is
\begin{align*}
\sum_{y=1}^\infty yP(Y = y) & =
\sum_{y=1}^\infty y\left((1 - q^y)^n - (1 - q^{y-1})^n\right).
\end{align*}
This is the simplest expression I can find. There might be simpler ones, but I haven't found any.
A: Let $\alpha$ be an $n$-tuple of integers. Using the Binomial Distribution on each die, we get the expected duration to be
$$
\begin{align}
&\sum_{k=1}^\infty k\sum_{\max(\alpha)=k-1}\left(\frac56\right)^\alpha\left(\frac16\right)^n\tag1\\
&=\sum_{k=1}^\infty k\left(\,\left[\frac{1-\left(\frac56\right)^k}{1-\frac56}\right]^{\,n}-\left[\frac{1-\left(\frac56\right)^{k-1}}{1-\frac56}\right]^{\,n}\,\right)\left(\frac16\right)^n\tag2\\
&=\sum_{k=1}^\infty k\left(\,\left[1-\left(\frac56\right)^k\right]^n-\left[1-\left(\frac56\right)^{k-1}\right]^n\,\right)\tag3\\
&=\lim_{N\to\infty}\sum_{k=1}^Nk\left(\,\left[1-\left(\frac56\right)^k\right]^n-\left[1-\left(\frac56\right)^{k-1}\right]^n\,\right)\tag4\\
&=\lim_{N\to\infty}\left(\sum_{k=1}^Nk\,\left[1-\left(\frac56\right)^k\right]^n-\sum_{k=0}^{N-1}(k+1)\left[1-\left(\frac56\right)^k\right]^n\,\right)\tag5\\
&=\lim_{N\to\infty}\left(N\,\left[1-\left(\frac56\right)^N\right]^n-\sum_{k=0}^{N-1}\left[1-\left(\frac56\right)^k\right]^n\,\right)\tag6\\
&=\sum_{k=0}^\infty\left(1-\left[1-\left(\frac56\right)^k\right]^n\right)\tag7\\
&=\sum_{j=1}^n(-1)^{j-1}\binom{n}{j}\sum_{k=0}^\infty\left(\frac56\right)^{jk}\tag8\\
&=\bbox[5px,border:2px solid #C0A000]{\sum_{j=1}^n\frac{(-1)^{j-1}\binom{n}{j}}{1-\left(\frac56\right)^j}}\tag9
\end{align}
$$
Explanation:
$(1)$: expected maximum duration of $n$ Binomial variables
$\phantom{(1)\text{:}}$ with termination probability $\frac16$
$(2)$: $\sum\limits_{\max(\alpha)\lt k}\left(\frac56\right)^\alpha=\left[\frac{1-\left(\frac56\right)^k}{1-\frac56}\right]^n$ and $\sum\limits_{\max(\alpha)=k-1}=\sum\limits_{\max(\alpha)\lt k}-\sum\limits_{\max(\alpha)\lt k-1}$
$(3)$: arithmetic
$(4)$: write infinite sum as a limit
$(5)$: prepare to telescope
$(6)$: cancel the telescoping terms
$(7)$: simplify and evaluate the limit
$(8)$: apply the Binomial Theorem
$(9)$: evaluate the geometric series
