In my statistics book I was encountered by the task to calculate the maximum and minimum of $n$ independent random variables, which are uniformly distributed over $(0,1)$. Knowing the definition of the density function I get that
$f_{\mathbb{X}}(x) = {1\over {b-a}}, a=0, b=1$
which gives
$f_{\mathbb{X}}(x) = {1\over {1-0}}, 1$
The distribution function then becomes, simply, $x$. To get the maximum of the $n$ variables (let's call this $\mathbb{Z}$) I get
$F_{\mathbb{Z}}(x) = \Pi_{i=1}^{n} F_{\mathbb{X}_i}(x) = x^n$
For the minimum ($\mathbb{Y}$) I get
$F_{\mathbb{Z}}(x) = 1-\Pi_{i=1}^{n} 1- F_{\mathbb{X}_i}(x) = 1-(1-x)^n$
So, to the get the expected values I have two choices (which are really the same thing); integrate the density functions over $(0,1)$, or just take $F(1)-F(0)$. Either way, I get that
$E(\mathbb{Z}) = F_{\mathbb{Z}}(1)-F_{\mathbb{Z}}(0) = 1^n - 0^n = 1$
$E(\mathbb{Y}) = F_{\mathbb{Y}}(1)-F_{\mathbb{Y}}(0) = (1-(1-1)^n) - (1-(1-0)^n) = (1-0)-(1-1) = 1$
My books disgree, claiming that the expected values are
$E(\mathbb{Z}) = {n \over {n+1}}$
$E(\mathbb{Y}) = {1\over n}$
Since I can't see how this is true, I'd simply like to know where I went wrong, and what I should've done?