Probability question rolling dice I got the following quiz asked at the interview:
a fair dice is rolled infinitelly; what is the expectation of the rolling iteration I, at which one gets two sixs in a row?
 A: Interpretation:
Let $K$ denote the iteration at which the second six is obtained. Determine $E[K]$.
Answer:
Let $K_0$ denote the time when we reach the first six.
Then $E[K_0]$ is $\frac{1}{1/6}=6$ since it follows a geometric distribution.
When we arrive at the first six, there is a 1 in six probability that we will arrive at the second in the next roll. If we fail to do so, the game starts over. That is,
$E[K] = E[K_0] + 1 + \frac{5}{6}E[K]$
Simplifying gives $E[K] = 6 E[K_0] + 6 = 42$.
Other versions:
Standard probability theory:
First by the tower-property, $E[K] = E[E[K\mid K_0]]$. Computing the inner expectation gives
\begin{align}
E[K\mid K_0] &= \sum_{k=K_0 + 1}^\infty k P(K = k)
 =
\sum_{k=K_0 + 1}^\infty k\big( P(K = k\mid K = K_0+1)P(K = K_0 + 1)\\ &+
P(K = k\mid K \neq K_0+1)P(K \neq K_0 + 1)\big) \\
&=\frac{K_0 + 1}{6} + 
\frac{5}{6}\sum_{k=K_0 + 2}^\infty k P(K = k\mid K \neq K_0+1) \\
&=\frac{K_0 + 1}{6} + \frac{5}{6}E[K].
\end{align}
The last equality follows from that we can put $s=K_0+2$ to obtain
\begin{align}
E[K] &= \sum_{s=1}^\infty k P(K = s) =  \sum_{s=1}^\infty k P(K = s\mid K \neq s-1)
\\&=\sum_{k=K_0 + 2}^\infty k P(K = k\mid K \neq K_0+1),
\end{align}
and the one before from
$P(K = K_0 + 1) = \frac{1}{6}$.
Markov theory:
This is a Markov chain with three states, $K$, $K_6$ and the absorbing state $K^*$.
The states are for the last two dice-throws. Let $x$ be any integer $1\ldots 5$ and $y$ any integer $1\ldots 6$. Then the three states represent $(y,x)$, and $(x,6)$ and $(6,6)$ respectively.
There is a theorem which states that the time to absorption is given as the solution to the equation system:
\begin{align}
K &= 1 + \frac{1}{6}K_6 + \frac{5}{6}K\\
K_6 &= 1 +  \frac{5}{6}K.
\end{align}
Solving for $K$ gives the solution $K_6 + 6 = 42$. That is, once we are in state $(x, 6)$ we expect $36$ additional rolls. To get the total we have to add six rolls to reach state $(x, 6)$.
