Solution (source code)

= Solution

The event $Y_n\leq z$ occurs precisely when every one of the first $n$ levels is at most $z$. Their <independence> gives the <cumulative distribution function>
$$
\boxed{P(Y_n\leq z)=F(z)^n,\qquad z\geq0.}
$$
For any nonnegative <random variable>, the pointwise identity $Y_n=\int_0^\infty\mathbf1_{\{Y_n>z\}}\,dz$ and the <Tonelli theorem> allow interchange of <expectation> and integral. Hence
$$
\boxed{EY_n=\int_0^\infty P(Y_n>z)\,dz
=\int_0^\infty[1-F(z)^n]\,dz.}
$$
This identity holds as an extended nonnegative integral; finiteness of the mean is not guaranteed by continuity of $F$.