Sunday 13 August 2017

Probability of consecutive dice rolls



This is probably quite a simple question but here I go..
Suppose you are going to roll a six-sided (fair) die N times, what is the probability that you will get at least one set of three consecutive numbers in a row?
Hopefully that's clear enough but as an example, in nine rolls you may get:
1, 4, 2, 6, 4, 4, 4, 4, 3
With the 4s making two sets of consecutive rolls.
Thanks!


Answer



Let $T$ denote the first time when this happens and, for every $|s|\leqslant1$ and $k$ in $\{0,1,2\}$, $u_k(s)=E_k[s^T]$ where $k$ is the number of identical results just produced. One is asking for $P_0[T\leqslant N]$. A one-step Markov conditioning yields the usual linear system $u_0=su_1$, $u_1=s\left(\frac16u_2+\frac56u_1\right)$ and $u_2=s\left(\frac16+\frac56u_1\right)$.



Solving this yields $u_0(s)=\frac{s^3}{36-30s-5s^2}$. There exists two positive real numbers $a$ and $b$ such that $36-30s-5s^2=36(1-as)(1+bs)$, thus $u_0(s)=\frac1{36}\frac1{a+b}s^3\left(\frac{a}{1-as}+\frac{b}{1+bs}\right)$ and, for every $n\geqslant1$, $P_0[T=n+2]=\frac1{36}\frac1{a+b}(a^{n}-(-1)^nb^{n})$. The value of $P_0[T\leqslant N]$ follows.




Numerically, $a=\frac1{12}(5+3\sqrt5)=0.97568$, $b=\frac1{12}(-5+3\sqrt5)=0.14235$, for every $n\geqslant1$, $P_0[T=n+2]=\frac1{18\sqrt{5}}(a^{n}-(-1)^nb^{n})$, and, when $n\to\infty$,
$$
P_0[T=n]\sim\frac{7-3\sqrt5}{5\sqrt5}a^n,\qquad P_0[T\geqslant n]\sim\frac{12}{5\sqrt5}a^n.
$$


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...