Let s be a positive integer. Do the following:
- Step 1: choose a random natural number $s_1 \in \{0, \ldots,s\}$ (uniformly distributed)
- If $s_1 = 0$, stop.
- Otherwise, step 2: choose a random number $s_2 \in \{0, \ldots, s_1\}$
- Continue until you get 0.
- Let $Y$ be the number of steps you have to make until you choose 0.
What is the expectation of $Y$?
My idea: Well, let $Y_{k}$ be the number you chose in step $k$. It is $ E[Y] = \sum_{k=1}^{\infty} k \cdot P(Y=k)$ and we get
- $P(Y=1) = \frac{1}{s+1}$
- $P(Y=2) = P(Y_{2} = 0 \mid Y_{1}>0)$ etc., but I‘m stuck here. This is actually a sum over all possible values of $Y_{1}$, but it seems to complicated.
I do not know how to solve this completely, but I think that the following is a step in the right direction: Let $E_s$ denote the expected number of steps when we start with $s$. Then $E_0 = 0$ (trivial) and $E_1 = 2$ (geometric distribution with parameter $1/2$). Furthermore, $E_s = 1 + \frac{1}{1+s} \cdot \sum_{i=0}^s E_i$. This is because you need one iteration, and after that your next number is one between $0$ and $s$, each with a probability of $\frac 1{1+s}$.
To give a rough estimate for $E_s$: With a probability of $1/2$, the value is halved in an iteration, which yields $E_s = O(\log s)$.
If you define $T_s = \sum_{i=0}^s E_i$, then we get the recursion $T_s = \frac{i+1}i \cdot (1 + T_{s-1})$, which might be easier solvable.