Roll a die until, for the first time, the same side shows up two times in a row. Let $X$ be the number of rolls needed. compute $\mathbb{E}(X)$. I'm having trouble with solving this problem:
Roll a die until, for the first time, the same side shows up two times in a row. Let $X$ be the number of rolls needed. compute $\mathbb{E}(X)$.
I know that the answer to this is $\mathbb{E}(X) = 7$, but I don't know why. Could you explain this to me?
Thanks in advance!

Let $Y$ denote the number of rolls that are still needed after the
first roll (so $X=1+Y$).
Then $\mathbb{E}\left(Y\mid Y>1\right)=1+\mathbb{E}Y$ (do you understand
why?) so that
$\mathbb{E}Y=\mathbb{E}\left(Y\mid Y=1\right)P\left(Y=1\right)+\mathbb{E}\left(Y\mid Y>1\right)P\left(Y>1\right)=1+\frac{5}{6}\mathbb{E}Y$
We conclude that $\mathbb{E}Y=6$ and $\mathbb{E}X=1+\mathbb{E}Y=7$.
