Expected Length of a Zigzag Prefix

Expectation · Hard · Free problem
Numbers $U_1, U_2, U_3, \ldots$ are drawn i.i.d. from $\text{Unif}(0,1)$. Starting from $U_1$, you keep going as long as the sequence alternates in strict inequalities: $U_1 > U_2 < U_3 > U_4 < U_5 > \cdots$ The moment an inequality is violated, you stop. Let $L$ be the length of this maximal alternating prefix. 1. Set up a Markov chain or system of integral equations that characterizes $E[L]$. 2. Solve the system and evaluate $E[L]$ to at least three decimal places.

Open the full interactive solver, hints, and worked solution →