Rolling dice until each has taken a specific value

393 Views Asked by At

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.

1

There are 1 best solutions below

6
On BEST ANSWER

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.