Consider the following inductively defined generative model:
\begin{align}
x_0 &= N \\
x_{n+1} \vert x_n &\sim \mathrm{Uniform}(0, x_{n - 1}).
\end{align}
We suppose that the sequence of random variables terminates when the sequence reaches zero for the first time. That is, we define the random variable $S = \inf \set{n : x_n = 0}$. As a function of $N$, what is the expected value of $S$?
Suppose $x_0=1$, then it follows immediately that $x_1 = 0$ and hence $\mathbb{E}\left[S \vert N=1\right] = 1$. Suppose that $N=2$. Then,
\begin{align}
\mathbb{E}\left[S \vert x_0=2\right] &= \sum_{k=0}^1 \mathrm{Pr}\set{x_1 = k} \left[1 + \mathbb{E}\left[S \vert N=k\right]\right] \\
&= \frac{1}{2} + \frac{2}{2} \\
&= \frac{1}{1} + \frac{1}{2}.
\end{align}
Similarly,
\begin{align}
\mathbb{E}\left[S \vert x_0=3\right] &= \sum_{k=0}^2 \mathrm{Pr}\set{x_1 = k} \left[1 + \mathbb{E}\left[S \vert N=k\right]\right] \\
&= \frac{1}{3} + \frac{2}{3} + \frac{5/2}{3} \\
&= \frac{1}{3} + \frac{2}{3} + \frac{5}{6} \\
&= \frac{11}{6} \\
&= \frac{1}{1} + \frac{1}{2} + \frac{1}{3}.
\end{align}
One can additionally check that
\begin{align}
\mathbb{E}\left[S \vert N=3\right] = \frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{4}.
\end{align}
These patterns lead us to speculate that the general solution of this problem is of the form \begin{align} \mathbb{E}\left[S \vert x_0=N\right] = H_N, \end{align} where $H_n$ is the $n$-th harmonic number. This fact can be established via induction. Before proceeding, however, we introduce a useful lemma pertaining to harmonic numbers.
With this lemma we may now establish the principle result: