Bob rolls a fair six-sided die each morning. If Bob rolls a composite number, he eats sweetened cereal. If he rolls a prime number, he eats unsweetened cereal. If he rolls a 1, then he rolls again. In a non-leap year, what is the expected number of times Bob will roll his die?
solution: Let E be the expected number of rolls Bob makes in one day. We can write the equation$$E = \dfrac56 (1) + \dfrac16 (E+1)$$since at the beginning of the day, Bob has a 5/6 chance of not getting a 1 and only rolling once total and a 1/6 chance of rolling a 1 and having to roll another E times for a total of E+1 rolls. Solving the equation yields $E=6/5$, so the answer is $365E = \boxed{438}$.
That was a state solution, but I don't know how it works. Could anyone explain?
An alternative approach is as follows:
We know that on each day Bob throws zero or more $1$s followed by a $2-6$.
The probability of throwing a $1$ is $p=\frac 1 6$. The probability of throwing a $2-6$ is $1-p=\frac 5 6$. The probability of throwing $n$ throws i.e. $n-1$ $1$s followed by a $2-6$ is $p^{n-1}(1-p)= p^{n-1} - p^n$. So the expected value of $n$ is
$E = (1-p) + 2(p-p^2) + 3(p^2-p^3) + 4(p^3-p^4)+ \dots \\ = 1+p+p^2+p^3+p^4 + \dots\\ = \frac{1}{1-p}=\frac 6 5$