# Expected number of rolls for fair die to get same number appear twice in a row?

We repeatedly roll a fair die until any number appear twice in a row. I want to find the expected number of rolls until we stop. I am thinking this is a geometric distribution, but how would I apply the distribution formula here, would the probability of throwing two numbers in a row be $\frac{1}{36}$?

• The probability that two fair dice throws gives identical results is $\frac16$. This is also the probability that a die throw matches the previous throw. This is almost a geometric distribution, but you cannot succeed on the first throw Commented Apr 17, 2016 at 20:57

Let X be the number of rolls.
$P(X=2) = \frac{1}{6}$
$P(X=3) = (\frac{5}{6})^1\frac{1}{6}$
$P(X=4) = (\frac{5}{6})^2\frac{1}{6}$
So, $P(X=k) = (\frac{5}{6})^{k-2}\frac{1}{6}$
Let $q=\frac{5}{6}$ and $p = \frac{1}{6}$

$E(X) = \sum_{k=2}^{\infty}kP(X=k)$
$\quad\quad\;\;= \sum_{k=2}^{\infty}kq^{k-2}p$
$\quad\quad\;\;= \frac{p}{q}\sum_{k=2}^{\infty}kq^{k-1}$
$\quad\quad\;\;= \frac{p}{q}(\sum_{k=0}^{\infty}kq^{k-1} - \sum_{k=0}^{1}kq^{k-1})$
$\quad\quad\;\;= \frac{p}{q}(\sum_{k=0}^{\infty}kq^{k-1}) - p$
$\quad\quad\;\;= \frac{p}{q}(\frac{1}{1-q})^2 - \frac{p}{q}$