Suppose we draw some k ~ Unif(0, 1). Then, we will draw some $u_1$ ~ Unif(0, 1). If $u_1 < k,$ we stop. Else, we will draw $u_2$ ~ Unif(0, $u_1$). We will continue drawing until $u_n < k.$ What is the expected value for $n$? (i.e. how many draws until we get a value < k?)
I'm not sure how to calculate these like "infinite integrals"/infinite recursion, because we can see that like $p_1=k, p_2=(1-k)*\frac{k}{u_1}, p_3=(1-k)*\frac{u_1-k}{u_1}*\frac{k}{u_2},$ but I'm not sure how to think about the pattern/find a recursive pattern.
Ignoring the stopping rule, we have $U_{n}=V_nU_{n-1}$ where $V_1,\ldots,V_n$ are independent amd uniform on $[0,1]$ and therefore $U_n=V_1\ldots V_n.$ If $N=\inf\{n;\ U_n<k\}$ we have $$E(N)=\sum_{n=1}^{ \infty}\Pr(U_n>k)=\Pr(-\log V_1-\cdots-\log V_n\leq -\log k)$$$$=\sum_{n=1}^{ \infty}\int_0^{-\log k}e^{-x}\frac{x^{n-1}}{(n-1)!}dx=-\log k.$$