# Expected number of rolls until a number appears $k$ times

Let $N$ be the number of rolls until the same number appears $k$ consecutive times. Show the expected value $E[N]=\dfrac{6^k-1}{5}$. I've tried conditioning this on the first occurrence of the expected number, but I'm having a hard time generalizing further than 2 consecutive times. I think I need to use the conditional expectation formula, $E[N]=E[E[N|Y]]$ where $Y$ is another random variable which I've previously taken to be the first appearance of the number.

-
What is the probability that the second roll yields a different number than the first one ? This should help you compute the probability that no number appears two consecutive times up until the $N^{\textrm{th}}$ roll. –  Joel Cohen Oct 2 '11 at 23:19

## 2 Answers

You can prove this by induction. Let $a_k$ be the expected number of rolls until the same number appears $k$ consecutive times. Clearly $a_1=1=(6^1-1)/5$. Now assume $a_{k-1}=(6^{k-1}-1)/5$.

To get $k$ consecutive rolls with the same number, you first need to get $k-1$, and this is expected to take $a_{k-1}$ rolls. On the next roll, you have a $1$ in $6$ chance to finish and a $5$ in $6$ chance to go back to square one. Thus

$$a_k=a_{k-1}+\frac16\cdot1+\frac56\cdot a_k\;,$$

or

$$a_k=6a_{k-1}+1\;.$$

Substituting $a_{k-1}=(6^{k-1}-1)/5$ yields $a_k=(6^k-1)/5$.

-

Well, for k=1, the value is trivially 1.

For k=2, you can find the probability of your event happenning in 2,3,4,.... throws.

The probability of N=2 , is the probability of the first two throws having the same outcome. So the expected number of throws needed for N=2 is:

P(Outcome aa).2+ [P(Outcome aba)+ P(Outcome baa)].3+....+[P( same number appears twice after j rolls].j+......

But, notice that every six rolls, you necessarily get at least one repetition.

-
While the last sentence is correct, it is not applicable as OP asked about repetitions on successive rolls. –  Ross Millikan Oct 2 '11 at 23:49