A die is throw until 5 followed by 3 appears A die is thrown until 5 followed by 3 appears. Like 156234753
What is the expected number of throws?
I've been trying to solve this problem but can't find anything similar.
Any help?

My solution:
Let $\displaystyle X$ be the random variable of the qustion (number of throws until 53).
Let the event $\displaystyle A=$after the first $\displaystyle 5$, you get a $\displaystyle 3$.
From the total law of expectation:
$\displaystyle E[ X] =E[ X|A] \cdotp P( A) +E[ W|\overline{A}] \cdotp P(\overline{A}) =E[ X|A] \cdotp \frac{1}{6} +E[ W|\overline{A}] \cdotp \frac{5}{6}$.
$\displaystyle E[ X|A] :$
We have gotten a $\displaystyle 5$ and then a $\displaystyle 3$. So we stop here. The expected number is the expected until $\displaystyle 5$ plus $\displaystyle 1$ for the $\displaystyle 3$: $\displaystyle 6+1=7$.
$\displaystyle E[ X|\overline{A}]$:
We have gotten a $\displaystyle 5$, but now not a $\displaystyle 3$ (assume we got some $\displaystyle x$).
We don't care about all the outputs before $\displaystyle x$, since they're not relevant to question anymore.
We can "pretend" then that we have just started with the output of $\displaystyle x$, and act as if that was our first result. I will count $\displaystyle 6$ for the results until the $\displaystyle 5$, and continue with same expectation.
$\displaystyle E[ X] =7\cdotp \frac{1}{6} +( 6+E[ X]) \cdotp \frac{5}{6}$
$\displaystyle  \begin{array}{{>{\displaystyle}l}}
E[ X] =\frac{7}{6} +5+\frac{5}{6} E[ X]\\
\frac{1}{6} E[ X] =\frac{37}{6}
\end{array}$
$\displaystyle E[ X] =37$.
I do see something wrong with my answer, the thing is the $\displaystyle x$ could be a $\displaystyle 5$ itself. This means I don't think it's very correct to say $\displaystyle E[ X|\overline{A}] =6+E[ X]$.
Because if the $\displaystyle x$ was a $\displaystyle 5$, then the possibility of ending the game next round is $\displaystyle \frac{1}{6}$ (with a $\displaystyle 3$), which of course doens't happen in $\displaystyle E[ X]$.
I believe that's my mistake, agreed?
Is the fact that my result is close to the actual result a pure casuality? Or does this mean my answer is close? I have given this answer on a test, trying to understand if it's completely wrong, or instead slighly wrong.
 A: Let $x$ be the expected additional waiting time if we have not just tossed a $5$. At the beginning, we certainly have not just tossed a $5$, so $x$ is the required expectation. Let $y$ be the expected additional waiting time if we have just tossed a $3$.
If we have not just tossed a $5$, then with probability $5/6$ we toss a non-$5$ (takes us $1$ toss) and our expected additional waiting time is still $x$. With probability $1/6$ we toss a $5$ (takes us $1$ toss) and our expected additional waiting time is $y$. Thus
$$x=1+\frac{5}{6}x+\frac{1}{6}y$$
If we have just tossed a $5$, then with probability $4/6$ we toss a non-$3$ and a non-$5$, and then our expected additional waiting time is $x$, with probability $1/6$, we toss a $5$ again and the additional waiting time is $y$ and with probability $1/6$ the game is over. Thus
$$y=1+\frac{4}{6}x+\frac{1}{6}y$$
We get $x=36$ and $y=30$
A: As already suggested in a comment the system has two states: either we just have thrown a $5$ (and waiting for a 3) or any other number ($X$). The expected number of throws till the consecutive '53' is therefore:
$$\begin{align}
t_x&=1+\frac56t_x+\frac16t_5\\
t_5&=1+\frac46t_x+\frac16t_5
\end{align}$$
Solving the system we find $t_x=36$, $t_5=30$. Since at first throw we can obtain  both states the final result reads:
$$
t=1+\frac56t_x+\frac16t_5=36.
$$
A: It seems as though this question has been answered well by those above me, however I decided to still post an answer as there is a really cool way of doing this problem for anyone who comes to visit this question in the future.
Imagine we have a Casino and each day the Casino rolls one dice. The question you ask is what is the expected value of days until 5,3 is rolled.
Let us now say we have a sequence of gamblers who bet on the outcome of the dice. The first gambler comes in and bets \$1 that the Dice will be a 5, the second gambler comes in on the second day and bets \$1 that the dice will be a 6 and so on.
Assume the casino offers fair bets, that is the payout if correct for the \$1 bet is $6.
Each gambler works as follows: If they loose their bet that's it, they go home never to return. However if they win their bet then they come back tomorrow and stake the $6 they now have on the next days dice being a 3.
Example: Casino rolls: $4,5,5,1,2,3,5,3$ then Gambler 1 looses his money on day 1 , Gambler 2 wins \$6 on day 2 and then looses it on day 3, Gambler 3 wins \$6 on day 3 but looses it on day 4. Gamblers 4,5,6, all loose instantly but gambler 7 leaves with $36
Let $ \{M_{n} \}_{n \geq 1}$ be the Martingale that is the casinos wealth. It is clear that this is a Martingale as they only offer fair ($0$ expected value) bets. Let us assume they start with wealth $0$, that is $M_0 = 0 $
Let $\tau$ be the stopping time of the event that the sequence $5,3$ is tossed for the first time. We are after $\mathbb{E}[\tau]$
Via the Optimal Stopping Theorem as $\tau$ is almost surely finite and the increments of $M_n$ are bounded we have that:
$\mathbb{E}[M_{\tau}] = \mathbb{E}[M_0] = 0 $
However at time $\tau$ we have that the first $\tau -2$ gamblers have all lost there money so the casino has made $\$+1$ of each of them and also that the (lucky) $(\tau-1)^{th}$ gambler has made $35$ dollars of them, the $36$ in return minus the initial stake of \$$1$ And that the $\tau^{th}$ gambler bet on a $5$ but saw a 3 so he also lost.
Hence $M_{\tau} = 35 - (\tau-2) -1  = 36 - \tau$
Hence $0 = \mathbb{E}[M_{\tau}] = \mathbb{E}[36-\tau] \implies \mathbb{E}[\tau] = 36$
This method can be expanded very nicely to any sequence of tosses. But particular care must be made for the winnings of the final few gamblers. For example if the sequence was $535353$ then the $(\tau -5 )^{th}$ gambler wins his $6^6$ the $(\tau -3 )^{th}$ gambler wins his $6^4$ as he correctly predicted $5353$ and the $(\tau - 2)^{th}$ gambler wins $6^2$ as he correctly predicted the last $53$. In this case $\mathbb{E}[\tau] = 6^6 +6^4 +6^2$
