TITLE: Throwing a fair die until most recent roll is smaller than previous one
QUESTION [12 upvotes]: I roll a fair die with $n>1$ sides until the most recent roll is smaller than the previous one. Let $E_n$ be the expected number of rolls. Do we have $\lim_{n\to\infty} E_n < \infty$? If not, what about $\lim_{n\to\infty} E_n/n$ and $\lim_{n\to\infty} E_n/\log(n)$?

REPLY [9 votes]: Yet another derivation of the formula $E_n=\left(\frac{n}{n-1}\right)^n$ given by Kasper Andersen.
Write $[m]=\{1,2,\dots, m\}$.
There are ${n+k-1 \choose k}$ non-decreasing functions from $[k]$ to $[n]$.
( Why? The number of such functions $f$ is the same as the number of strictly increasing functions $g$ from $[k]$ to $[n+k-1]$ -- there is a bijection given by $g(i)=f(i)+i-1$. The number of those is ${n+k-1 \choose k}$, since for every subset of $[n+k-1]$ of size $k$, there is precisely one strictly increasing function from $[k]$ to $[n+k-1]$ with that image set. )
Let $X$ be the number of rolls before the first descent is observed. Then $X\geq k$ if and only if the first $k$ rolls give a non-decreasing function from $[k]$ to $[n]$. The total number of possibilities for the first $k$ rolls is $n^k$, and they are all equally likely, so the
probability that $X\geq k$ is
$\frac{1}{n^k}{n+k-1 \choose k}$.
Then
\begin{align*}
E_n &= \mathbb{E}(1+X)\\
&=1+\mathbb{E}(X)\\
&=1+\sum_{k=1}^\infty \mathbb{P}(X\geq k)\\
&=1+\sum_{k=1}^\infty \frac{1}{n^k}{n+k-1 \choose k}\\
&=1+\frac{1}{n}{n\choose 1} + \frac{1}{n^2}{n+1\choose 2}
+\frac{1}{n^3}{n+2\choose 3} +\dots\\
&=\left(1-\frac{1}{n}\right)^{-n}
\end{align*}
by the binomial theorem.