Rolling a $6$-sided dice indefinitely until lower than the previous throw

Consider the expected number of points you will obtain after rolling a particular number.

e.g. Suppose we have just rolled a 6. We need to roll another 6 to keep playing, otherwise we stop. Using conditional expectation, we can compute the number of future points we expect to obtain, $E_6$: $$E_6 = \frac{1}{6}(E_6 + 6) + \frac{5}{6}\times 3.$$

The first term corresponds to rolling a 6, and we are back in the same position as before, just with 6 extra points. The second term gives expected number of points obtained, given that we roll a lower number and stop playing. We solve this to obtain $$E_6 = \frac{21}{5}.$$

Now suppose that, in a new game, we have just rolled a 5. What is the expected number of points from this point, $E_5$? Using the same conditional expectation rules as before: $$E_5 = \frac{1}{6}(E_5+5) + \frac{1}{6}(E_6+6) + \frac{4}{6} \times \frac{5}{2}.$$ Since we know $E_6$ from above, we can now solve for $E_5$.

Repeat this for $E_4, \dots, E_1$, and we know the expected number of future points given the most recent roll number.

Finally, the expected number of points, $E$, will be the conditional sum of these values, i.e.

\begin{equation} E = \sum_{n=1}^6 \frac{1}{6}(E_n + n). \tag{1} \end{equation}

Edit: following an observation by Taner, I thought I'd add a few more lines.

After some generalizing and rearranging, we obtain $$E_n = \frac{1}{5}\left(\sum_{m=n+1}^6 E_m + 21\right),$$ and we can set up a recurrence relation for $E_n$ so we don't have to do this sum every time to compute it. We have

\begin{align} E_{n+1} &= \frac{1}{5}\left(\sum_{m=n+2}^6 E_m + 21\right) \\ &= \frac{1}{5}\left(\sum_{m=n+1}^6 E_m + 21 - E_{n+1}\right) \\ &= E_n - \frac{1}{5}E_{n+1}, \end{align}

which we rearrange to obtain $$E_{n+1} = \frac{5}{6}E_n,$$ which has solution $$E_n = C \left(\frac{5}{6}\right)^n,$$ where $C$ is some constant, for which we can solve by setting $n=6$ and using our value of $E_6$. We obtain (allowing for possible arithmetic errors made by me) $$E_n = \frac{21}{5}\left(\frac{5}{6}\right)^{n-6}.$$

We can substitute this into Equation (1) and use geometric and arithmetic sum formulae to obtain the final answer.

Edit 2: as Alex Zorn pointed out, we don't even need to do this geometric and arithmetic sum stuff in Equation (1). Note that the game is the same before and after rolling a 1, so this tells us straight away that $$E = E_1 = \frac{21}{5}\left(\frac{5}{6}\right)^{-5} = \frac{163296}{15625} \approx 10.45.$$


Here is an answer using generating functions where we demonstrate a variety of relevant techniques. Suppose the die has $n$ sides and we classify by $q$, the last nondecreasing value seen before the decreasing value that ends the game, so $2\le q\le n.$ Using $x$ for the number of points and $z$ for the number of rolls we obtain

$$G_q(z, x) = \left(\prod_{p=1}^{q-1} (1 + x^p z + x^{2p} z^2 + \cdots)\right) \\ \times (x^q z + x^{2q} z^2 + \cdots) (x^{q-1} z + x^{q-2} z + \cdots + x z).$$

This is

$$G_q(z, x) = \left(\prod_{p=1}^{q-1} \frac{1}{1-x^p z}\right) \frac{x^q z}{1-x^q z} (x^{q-1}+\cdots+x) z \\ = z^2 \left(\prod_{p=1}^{q} \frac{1}{1-x^p z}\right) (x^{2q-1}+\cdots+x^{q+1}).$$

Introducing $$G(z, x) = \sum_{q=2}^n G_q(z, x)$$

the desired quantity is given by

$$\left. \frac{\partial}{\partial x} G(z, x) \right|_{x=1, \; z=1/n.}$$

Differentiate for the expected number of points:

$$z^2 \left(\prod_{p=1}^{q} \frac{1}{1-x^p z}\right) \left(\sum_{p=1}^q \frac{p x^{p-1} z}{1-x^pz} \right) (x^{2q-1}+\cdots+x^{q+1}) \\ + z^2 \left(\prod_{p=1}^{q} \frac{1}{1-x^p z}\right) ((2q-1) x^{2q-2}+\cdots+(q+1)x^{q}).$$

Set $x=1$ to find

$$z^2 \left(\prod_{p=1}^{q} \frac{1}{1-z}\right) \left(\sum_{p=1}^q \frac{pz}{1-z}\right) (q-1) \\ + z^2 \left(\prod_{p=1}^{q} \frac{1}{1-z}\right) \left(\frac{1}{2} (2q-1)(2q) - \frac{1}{2} q(q+1)\right).$$

Now

$$ \frac{1}{n^2} \prod_{p=1}^q \frac{1}{1-1/n} = \frac{1}{n^2} \prod_{p=1}^q \frac{n}{n-1} = \frac{n^{q-2}}{(n-1)^q}$$

and we obtain

$$\frac{n^{q-2}}{(n-1)^q} \left((q-1) \frac{1/n}{1-1/n} \frac{1}{2} q(q+1) + \frac{3}{2} q (q-1)\right).$$

Summing the contributions we get

$$\sum_{q=2}^n \frac{n^{q-2}}{(n-1)^q} \left(\frac{1}{2} \frac{1}{n-1} (q-1) q (q+1) + \frac{3}{2} q (q-1)\right).$$

The first of these is

$$\frac{3}{(n-1)^3} [w^{n-2}] \frac{1}{1-w} \sum_{q\ge 0} \frac{n^q}{(n-1)^q} w^q {q+3\choose 3} \\ = \frac{3}{(n-1)^3} [w^{n-2}] \frac{1}{1-w} \frac{1}{(1-wn/(n-1))^4}.$$

The second is

$$\frac{3}{(n-1)^2} [w^{n-2}] \frac{1}{1-w} \sum_{q\ge 0} \frac{n^q}{(n-1)^q} w^q {q+2\choose 2} \\ = \frac{3}{(n-1)^2} [w^{n-2}] \frac{1}{1-w} \frac{1}{(1-wn/(n-1))^3}.$$

Adding we find

$$\frac{3}{(n-1)^3} [w^{n-2}] \frac{1}{1-w} \frac{1+(n-1)(1-wn/(n-1))}{(1-wn/(n-1))^4} \\ = \frac{3}{(n-1)^3} [w^{n-2}] \frac{1}{1-w} \frac{1+(n-1)-wn}{(1-wn/(n-1))^4} \\ = \frac{3n}{(n-1)^3} [w^{n-2}] \frac{1}{(1-wn/(n-1))^4}.$$

Extracting the coefficient we obtain

$$\frac{3n}{(n-1)^3} {n-2+3\choose 3} \frac{n^{n-2}}{(n-1)^{n-2}} = \frac{1}{2} (n+1) n (n-1) \frac{n^{n-1}}{(n-1)^{n+1}}.$$

The result is the following closed form:

$$\bbox[5px,border:2px solid #00A000]{ \frac{1}{2} (n+1) \frac{n^n}{(n-1)^n}.}$$

This will produce

$${\frac {163296}{15625}}$$

for $n=6,$ confirming the accepted answer.

Observe that the above uses pen-and-paper type manipulations only.