throwing a $k$-sided dice until you get every face the same number of times

Solution 1:

Answer concerning $k=2$. For $k\geq2$ see edit.

If $X_2$ denotes the number throws needed then $X_2$ only takes positive multiples of $2$ as value, and this with: $$P(X_2=2n)=2^{1-2n}C_{n-1}=2^{1-2n}\frac{(2n-2)!}{n!(n-1)!}$$for $n=1,2,\dots$, leading to:$$\mathbb EX_2=\sum_{n=1}^{\infty}2^{2-2n}\binom{2n-2}{n-1}=\sum_{n=0}^{\infty}2^{-2n}\binom{2n}{n}$$

Here $C_n$ stands for the $n$-th Catalan number.

In this case ($k=2$) we can do it with a fair coin.

Let $H_k$ stand for the number of throws with outcome heads and let $T_k$ for the number of throws with outcome tails by $k$ throws.

Then have a look at the path determined by $(k,H_k-T_k)$ for $k=0,1,\dots,2n$ under condition that $X_2=2n$.

Starting at $(0,0)$ and ending at $(2n,0)$ first WLOG we go to $(1,1)$.

Then with probability $2^{2-2n}C_{n-1}$ from there we go to $(2n-1,1)$ keeping a positive second coordinate.

And then with probability $2^{-1}$ we go to $(2n,0)$.

We have the asymptotic equality: $$2^{-2n}\binom{2n}{n}\sim\frac{1}{n^{\frac12}\sqrt\pi}$$and conclude that: $$\mathbb EX_2=+\infty$$


edit (to make the answer complete):

If $k>2$ let $U$ denote the outcome at first throw and let $V$ be (e.g.) the smallest element of $\left\{ 1,\dots,k\right\} $with $U\neq V$.

Now define $Y$ as the number of throws needed (inclusive the first) to come back again in the situation that outcome $U$ and outcome $V$ have appeared the same number of times.

Comparing $Y$ and $X_{2}$ we find easily that $P\left(Y>n\right)\geq P\left(X_{2}>n\right)$ for every nonnegative integer $n$ and consequently: $$\mathbb{E}Y=\sum_{n=0}^{\infty}P\left(Y>n\right)\geq\sum_{n=0}^{\infty}P\left(X_2>n\right)=\mathbb{E}X_{2}$$

Next to that it is evident that $X_{k}\geq Y$ so that $\mathbb{E}X_{k}\geq\mathbb{E}Y$.

Combining this with $\mathbb{E}X_{2}=+\infty$ we conclude that $\mathbb{E}X_{k}=+\infty$ for $k=2,3,\dots$

Solution 2:

Take a $2$-sided die and let $N$ be the number of rolls taken to get from a position where the numbers of 1s and 2s differ by $1$ to a point where they are equal. This has the same distribution as reducing a difference of $2$ to $1$.

Suppose $\mathbb E(N)<\infty$. Then we have $\mathbb E(N)=1+\frac12\times2\mathbb E(N)$, since after the first roll with probability $\frac12$ you succeeded and with probability $\frac12$ you have a difference of $2$, which you have to reduce twice. But this equation has no finite solution, contradiction.

It follows that the expectation is infinite for any number of sides, since after the first roll two sides have come up different numbers of times, and even waiting until those two are equal has infinite expectation.

As you say, for six or more sides there is a positive probability of never equalising. I suspect that six is not the smallest value for which this holds.