Expected values of a sorted sequence If I have $n$ random variables uniformly distributed on [0,1]. What is
the expectance value kth highest value? In other words, what is the
expected value of sorting the random variables?
For $n=2$ the expectance for the highest value is $2/3$ while the second highest is $1/3$.

Let $X_{(1)}\le X_{(2)} \le \cdots \le X_{(n)}$ be the order statistics of the sample $X_1,X_2,\ldots,X_n$. You can calculate $E(X_{(k)})$ using the formula 
$$E(Y)=\int_0^\infty P(Y>y)\,dy,$$
which is valid for nonnegative $Y$. Applying this to $Y=X_{(k)}$ requires us to find $P(X_{(k)}>y)$. Notice that the event of interest ($X_{(k)}$ exceeds $y$) occurs exactly when at most $k-1$ of the $X$'s are $\le y$. In our case the number of $X$'s that are $\le$ $y$ is a binomial random variable with success probability $y$, since each $X$ is uniform $[0,1]$, so we have for $y\in(0,1)$
$$P(X_{(k)}>y)=\sum_{i=0}^{k-1}{n\choose i}y^i(1-y)^{n-i}$$
and
$$
E(X_{(k)})=\int_0^1\sum_{i=0}^{k-1}{n\choose i}y^i(1-y)^{n-i}\,dy
$$
Interchanging integration and summation, this equals
$$
\sum_{i=0}^{k-1}\int_0^1{n\choose i}y^i(1-y)^{n-i}\,dy = 
\sum_{i=0}^{k-1}\frac1{n+1}
=\frac k{n+1}.
$$
