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!
 A: 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$.
A: A slightly different approach using the law of total probability:
\begin{align*}
E(X) ={} & E(X\mid(\text{$(i+1)$-th toss is same as $i$-th})\cdot P(\text{$(i+1)$-th is same}) \\ &{} + E(X\mid(\text{$(i+1)$-th toss is different})\cdot P(\text{$(i+1)$-th is different}) \\
= {} & (2)\cdot\frac{1}{6} + (E(X) + 1) \cdot \frac{5}{6} 
\end{align*}
Then solving for $E(X)$ we have 7. 
The important bit to note is that $E(X\mid(\text{$(i+1)$-th toss is different})$ is simply $E(X) + 1$, as you can think of our indicator $i$-th toss "resetting" when we have a different side rolled.  
A: From the second roll onwards, the probability that the roll is the same as the previous one is $1/6$. Therefore the number of rolls until two sides show up in a row is distributed $1+\mathrm{Geom}(1/6)$ (one plus a geometric random variable with success probability $1/6$), whose expectation is $1+6 = 7$.
A: The probability of one dice throw to be equal to the previous is constant 1/6, but one previous throw is required to "get started". We would expect to have won once after 6 such tries, but one extra throw is required to get "started".
If you want to calculate it using analysis:
https://en.wikipedia.org/wiki/Bernoulli_distribution
https://en.wikipedia.org/wiki/Geometric_distribution
Expected value of the Geometric distribution is 1/p, i.e. 1/(1/6) = 6 in this case and +1 is required to "get started".
