I come across a problem that interests me a lot: Select numbers uniformly distributed between 0 and 1, one after one, as long as they keep decreasing: stop selecting when you obtain a number that is greater than the previous one you selected.
Q: What is the average value of the smallest number you have selected?
It is not that hard to show that the average number to select is e, but what is the average smallest value when stopping?
Suppose after some number of steps the current number is $x \in [0,1]$. Let $f(x)$ be the expected final value. The next number is $>x$ with probability $1-x$, in which case the final value is $x$, and otherwise the next value is some $y$ distributed uniformly between $0$ and $x$, in which case the expected final value is $f(y)$. Therefore we have the rule $$f(x) = (1 - x)x + \int_0^x f(y)\, dy.$$ Differentiating gives $f'(x) = 1 - 2x + f(x)$, and we have an initial condition $f(0) = 0$, so we get the solution $f(x) = 1 + 2x - e^x$. So the answer is $f(1) = 3 - e$.