This is a slightly more advanced example of this question, but instead of having 6 tails or heads resulting from six consecutive coin throws we want to hit all the different 4 sides of D4 tetrahedron dice. We can assume each side has equal $p=1/4$ probability of coming up and that result of consecutive throws are independent.
How many times do we need to throw the D4 to say with 50% probability that all 4 sides has come up in sequence after each other (in any order) at least once?
I am interested in both theoretical approaches and practical methods.
Examples of allowed orders:
- 1,1,2,1,2,3,4,3,2,...
- 1,2,1,4,3,2,1,3,3,...
- 4,3,3,3,2,4,1,2,1,...
The system is in state $S_k$, $1\leq k\leq4$, if there are $k$ useful last digits. After the first throw we are with probability $1$ in state $S_1$. State $S_4$ is the terminal state. The Markov matrix for this system is $$A=\left[\matrix{{1\over4}&{1\over4}&{1\over4}&0\cr {3\over4}&{1\over4}&{1\over4}&0\cr 0&{1\over2}&{1\over4}&0\cr 0&0&{1\over4}&1\cr}\right]\ .$$ This should be read as follows: When we are in state $S_1$, with probability ${1\over4}$ the next throw leaves us in $S_1$, and with probability ${3\over4}$ the next throw brings us to $S_2$. When we are in state $S_2$, with probability ${1\over4}$ the next throw brings us back to $S_1$, with probability ${1\over4}$ the next throw leaves us in $S_2$, and with probability ${1\over2}$ the next throw brings us to $S_3$. Etcetera.
We now have to compute the sequence $$x^{(n)}:=A^{n-1}\left[\matrix{1\cr0\cr0\cr0\cr}\right]\qquad(n\geq1)\ ,$$ and find the first $n$ for which $x^{(n)}_4\geq50\%$. The computation shows that this is the case for $n=12$.