2

I’ve seen this question a lot; you roll a fair six-sided die, what’s the expected number of rolls to get a consecutive 5-6?

You can solve the problem with some simple total expectation; one method is outlined in the middle of this doc. The answer turns out to be 36.

It can’t be a coincidence that it’s 6^2, no? What’s the reason as to why?

APerson
  • 85

3 Answers3

3

You already have a formal proof, so I will permit myself to be hand-wavey here.

After any die throw (apart from the first), the probability that you have just finished a consecutive 5-6 is $\frac1{36}$. So it is not strange that you expect to throw 36 times before you get your first one.

There is some dependence between the different throws that makes this approach a bit cumbersome to actually do properly (e.g. if you just finished a 5-6, then you can't also finish a 5-6 on your next throw). But expectation often doesn't care about dependence, and it turns out that this is no exception. We can remove this dependence entirely by only considering non-overlapping pairs of throws, and then it is obvious even with the direct approach that you expect it to take 36 attempts (although these attempts will now represent 72 actual die throws).

To try to intuit why it should take longer for 5-5 than for 5-6, consider that in a given range of throws you expect equally many appearances of both. However, the 5-5 rolls can cluster together (you can get two of them in three throws and four of them in three throws), and this means that the runs between these clusters should be expected to be longer than the runs between two 5-6 throws. This includes the run from the start until you encounter the first one. Although, with only this intuition to go on, it is not easy to see which of them actually expects 36 throws before you encounter it for the first time, just as it is difficult to see that either one actually expects exactly 36.

Arthur
  • 199,419
  • Yes, it's this dependence between the different throws which had me stumped. Can you expand a bit more on how to do the expectation calculation here to get 36? The one you outline here: "But expectation often doesn't care about dependence, and it turns out that this is no exception." Thank you! – APerson Jun 16 '23 at 16:00
3

I think intuition is tough here. Is it obvious that it should take longer to see $55$ than to see $56$? Well, at least that can be made intuitive:

Conway's Algorithm is very useful here.

The idea is to track the places where the desired string restarts. For $56$, there is no restart. For $55$, it starts twice (so to speak). For $563563563$ it starts $3$ times These place represent the various points at which partial successes might overlap.

The idea is that it takes longer to see a string that repeats the first entry. Why? Well, consider $56$ versus $55$. If you are trying to see the latter then, having just tossed a single $5$, your only hope is to toss another immediately, else you start at the beginning. With $56$ then, having thrown a $5$, you have two possibilities for a favorable next throw. Either you throw the $6$ and win, or you throw another $5$ and remain in the active state.

Conway directs us to compute expected sample sizes accordingly. $56$ has expected sample size $6^2$, as you have found. $66$ has expected sample size $6^2+6=42$. and $563563563$ would be $4^9+4^6+4^3$

This quick algorithm can be demonstrated using the Markov methods described in the post you link to.

Not sure I'd call this "intuitive" but it does give a very fast way to compute the desired expectation. I wouldn't want to work that out for $563563563$ by solving a $9\times 9$ linear system.

lulu
  • 70,402
  • Hi! I read through the article you sent. It makes sense, but I don't believe it mentions expectations anywhere. You mention that "Conway directs us to compute expected sample sizes accordingly." Where is this? Thank you! – APerson Jun 18 '23 at 00:20
  • I searched for, but didn't find, a good reference for the algorithm in exactly this form. here is a duplicate question that goes through various ideas. One of the answers discusses Conway's algorithm (and I note that they link to the same article I mentioned, but they link to others as well). – lulu Jun 18 '23 at 00:28
  • Will take a look into this, thanks. Also, I believe there's an error in your solution. I believe for 5651253, it would just be 6^7, because not just the first term has to match for a substring, every term has to match. The article you cite also seems to support that. Am I correct? – APerson Jun 18 '23 at 03:32
  • 1
    Absolutely right, sorry about that. The issue is overlaps. $565656$ overlaps, my example doesn't. I'll edit accordingly. – lulu Jun 18 '23 at 05:01
1

Let $X,Y$ be instances of a $6$-sided dice.

In the $56$ case, the throws are independent, so we can apply $E(XY)=E(X)E(Y)$. This can be interpreted as a geometric distribution with $p=\frac1{36}$ (and so an expectation of $36$) on the LHS, and the RHS as throw a $5$ six times and you expect to get a $6$. As throwing the second dice in a pair has no further meaning, it can be re-used for the next pair, hence proving independence.

With $66$, if the second throw in a pair isn't a six, we need to throw again, so in this case $E(XY)=E(X)\big(1+E(Y)\big)$. Again this is throw a $6$ six times, however in this case, if the next die is not a six, we must throw again.

JMP
  • 21,771
  • Hi, can you expand on what you're doing here. What exactly are $X$ and $Y$ here? And how come getting a 5-6 corresponds to $XY$ exactly? Thank you! – APerson Jun 16 '23 at 15:59
  • @APerson; I've added a better explanation. – JMP Jun 16 '23 at 16:57
  • 1
    I haven't seen this approach. Can you elaborate? What exactly are $X,Y$? Can you re-derive Conway's solution this way? – lulu Jun 16 '23 at 17:27