Question: Roll a fair dice until the game stops. The game stops when you get a 4, 5, or 6. For every 1, 2, or 3 your score increases by +1. If the game stops with a 4 or 5, you get paid the accumulated score. If the game stops with a 6 you get nothing. What is the expected payoff of this game?
I encounter this question from this post. Answer is $\frac{2}{3}.$
While reading André Nicolas's solution at that post, I do not understand one step.
Let $E$ be the expected score. We condition on the result of the first toss. If that toss is $4$, $5$, or $6$, then the amount we get, and therefore the expectation, is $0$.
Given that the first toss is a $1$, $2$, or $3$, our expectation is not $E+1$. For the $1$ is not a sure thing. With probability $\frac{1}{3}$ it will not be credited to you, because the game will end with a $6$. It follows that $$E=\frac{1}{2}\left(E+\frac{2}{3}\right).$$ That yields $E=\frac{2}{3}$.
I do not understand why would we obtain the $\frac{2}{3}$ in the equation $$E=\frac{1}{2}\left(E+\frac{2}{3}\right).$$
Is it due to the law of total expectation?
With probability $1/2$, you get nothing (because your first roll is a $4$, $5$, or $6$).
The rest of the time, also with probability $1/2$, you get something, which we'll call $F$. Your score from the second roll on is also $E$, because it is essentially the game starting from scratch. However, $F$ equals $E$ plus whatever you keep of the $1$ point you earned from the first roll. When the game ends with a $6$ (with probability $1/3$), you don't get to keep any of that $1$ point; however, when the game ends with a $4$ or $5$ (with probability $2/3$), you get to keep that $1$ point. On average, then, you get to keep $2/3$ of that point.
So $F = E + 2/3$, and your overall expectation is $F/2 = (E+2/3)/2$. By equating this with $E$, the expectation from the beginning of the game, we get $E = 2/3$.