I've got a problem, with a solution, in my introduction to mathematical statistics book and I just don't get how they got there. There are follow up questions so I'd like to get insight at how they got to the answer.
The problem: Let $X_1,\ldots,X_n$ be independent random variables with the uniform distribution on the interval $[0,1]$. Determine the expectation and variance of $Y=\max(X_1,\ldots,X_n)$. Hint: Deduce the density of Y from the distriution function $P(Y \leq y)$ of $Y$, which can be determined using the distribution functions of $X_1, \ldots, X_n$.
The solution: $\operatorname E[Y]=\frac{n}{n+1}$, $\operatorname{var}[Y]=\frac{n}{n+2}+\left(\frac{n}{n+1}\right)^2$.
Now I know that a uniformly distributed random variable on $[0,1]$ has the following probability distribution, expectation and variance;
$F(x)=x$ for $x \in [0,1]$, $\operatorname E[X]=\frac{1}{2}$ and $\operatorname{var}[X]=\frac{1}{12}$.