I am looking at the following questions on rolling 3 dice at the same time:
- Probability of getting 4, 5, 6 without particular order;
- If get a result different from 4, 5, 6, then roll again. What is the expectation of number of rolls;
- If get a result different from 4, 5, 6, then roll the dice which is not in the set {4, 5, 6} again, e.g. first roll gives 4, 5, 1, then roll the third dice only until get a 6. What is the expectation of number of rolls.
I am stuck with the third part and do not know how to approach to such question. For the first one, I get the probability $= \left( \frac{1}{6} \right)^3 \times 3\,! = \frac{1}{36}$. And the second question, I use the mean of a geometric distribution and get the expectation $=36$.
The model is a Markov chain with four states, $0,1,2,3$. The state $0$ is the initial state. The final state is $3$. (The state $k$ means roughly "$k$ matched positions".)
We associate the following constellations to the three states:
(Set delimiters are not really precise, because the roll $1,2,1$ may lead to interpretations when written as $\{1,2,1\}$, but something like $4,*,*$ between set delimiters means a four in some place, then further two no longer useful values (including a possible further occurence of the four, which became useless).)
The passage from one state to the other is given by the scheme:
Let $N_k$ the expected number of rolls needed to pass from the state $k$ to the final state $3$. Then $N_3=0$. Else, $N_k>0$, so we make one step, and get a new state $n$ with the specified passing probabilities, from there we expect $N_n$ steps.
The system is: $$ \left\{ \begin{aligned} N_0 &= 1 + \frac 18N_0+\frac {37}{72}N_1+\frac 13N_2+\frac 1{36}N_3\ ,\\ N_1 &= 1 + \frac 49N_1+\frac 12N_2+\frac 1{18}N_3\ ,\\ N_2 &= 1 + \frac 56N_2+\frac 16N_3\ ,\\ N_3 &=0\ . \end{aligned} \right. $$ We solve this system, the solution is:
$N_3=0$, clear,
$N_2=6$, of course,
$N_1=36/5=7.2$,
$\color{red}{N_0=268/35\approx 7.6571428571428\dots}$ , which is the number asked in the OP.
Some words on the computed passage probabilities $p_{kn}$ from the state $k$ to the state $n$.
Let us simulate. This is the best test. (Sage code is following.)
And this time i've got:
which is not far away from the obtained value $268/35\approx 7.65714285714286\dots$
OK, two more time the same simulation, since i do not like the deviation:
(One may compute the variance using similar methods.)