# 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
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 20, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9290137887001038, "perplexity_flag": "head"}