First ascent in independent continuous observations (source code)

= First ascent in independent continuous observations
{title2=$P(N=r)=(r-1)/r!,\quad \mathbb EN=e$}

For <independent and identically distributed random variables> with a <continuous probability distribution>, let $N\geq2$ be the index of the first increase. The event $N\geq n$ requires the first $n-1$ observations to be decreasing; symmetry among their $(n-1)!$ possible strict orders gives probability $1/(n-1)!$ for $n\geq2$. Subtracting successive tails gives the displayed mass function for $r\geq2$. The tails tend to zero, so $N$ is finite almost surely. The <tail-sum formula for expectation> gives $\mathbb EN=1+\sum_{j\geq1}1/j!=e$, independently of the continuous sampling law.