<s>[INST] Expected number of die rolls - conditional probability The aim here is to roll a fair die until a 3 is rolled twice in a row, where the number of rolls that this takes (including the final two where threes are consecutive) is given by the random variable X. We are also told of the random variable Y, and this is the number of rolls of this die until anything other than a three occurs.
We need to find the mean and variance of X, and I realise we can set up E[X]=E[E[X|Y]], and the corresponding equation for the variance. I'm having trouble setting up E[X|Y] and E[X^2|Y], all we know is that E[X] is finite, but no more. Y itself I think is a geometric random variable with parameter 5/6, but am confused as to how to proceed. 
 [/INST] In fact, you may compute the entire distribution of $X$. Let's denote $a_n = \mathbb{P}(X = n)$, where $n=1,2,...$ . We have $a_1 = 0$ and $a_2 = 1/6^2$.
Let also $X_1$ and $X_2$ be the first and the second rolls of the die.
Then, using the law of total probability, for $n>2$ we have
$$
a_n = \frac 56 \mathbb{P}(X = n |X_1 \neq 3) + \frac 16 \mathbb{P}(X = n |X_1 = 3) = \\
\frac 56 \mathbb{P}(X = n-1) + \frac {1}{6} \frac{5}{6} \mathbb{P}(X = n | X_1 = 3, X_2 \neq 3) + \frac {1}{6} \frac{1}{6} \mathbb{P}(X = n | X_1 = 3, X_2 = 3) = \\
\frac 56 a_{n-1} + \frac{5}{6^2} a_{n-2} + \frac{1}{6^2} \chi_{n=2}.
$$
The idea is that if you miss 3 on the first step and need to wait for exactly $n$ steps to complete $3,3$ then you are now waiting for $3,3$ in exactly $n-1$ steps .
We thus have
$$
a_1 = 0, a_2 = \frac{1}{6^2}, \ \ a_n = \frac 56 a_{n-1} + \frac{5}{6^2} a_{n-2}, \text{ for } n >2.
$$
From this
$$
\mathbb{E} X = \sum_{1}^\infty n a_n = \frac{2}{6^2} + \sum_{3}^\infty n a_n = 
\frac{2}{6^2} + \frac{5}{6}\sum_{2}^\infty (n+1)a_n + \frac{5}{6^2} \sum_{1}^\infty ( n + 2 ) a_n = \\
\frac{2}{6^2} + \frac 56 + \frac{10}{6^2} + \frac 56 \mathbb{E}X + \frac{5}{6^2} \mathbb{E} X,
$$
where we used the fact that $\sum a_n = 1$. Hence, 
$$
\mathbb{E} X = 42.
$$
You may also compute the variance easily, using the recurrence relation for $a_n$, and playing with the corresponding sum.
</s>