# What is the expected value of the sum of the $k$ (out of a set of $n$) smallest uniform random variables?

I know that the expected value of the sum of $n$ random variables is the sum of the expectation of each one.

The expected value of a uniformly distributed random variable $U(a,b)$ is also well known

$$\frac{b-a}{2}$$

I can also calculate the expected value of the min/max random variable in a set of $n$ random variables [1].

Is there a way to calculate the expected value of the sum of the $k$ (out of a set of $n$) smallest uniform random variables?

If $X_1,\dotsc,X_n\overset{iid}{\sim}\text{unif}(a,b)$, then $X_{(k)}$ is the $k$th order statistic and it follows a scaled beta distribution. Then if $X = X_{(1)}+\dotsb+X_{(k)}$, then $$E[X] = E[X_{(1)}]+\dotsb+E[X_{(k)}].$$

Using the transformation$~X_{(i)} = (b-a)U_{(i)}+a~$ we have \begin{align*}E[X] &= E[(b-a)U_{(1)}+a]+\dotsb+E[(b-a)U_{(k)}+a]\\ &=(b-a)\big[E[U_{(1)}]+\cdots+E[U_{(k)}]\big]+ka\\ &=(b-a)\left[\frac{1}{1+(n+1-1)}+\dotsb+\frac{k}{k+(n+1-k)}\right]+ka\\ &=(b-a)\left[\frac{1}{n+1}+\dotsb+\frac{k}{n+1}\right]+ka\\ &=\frac{b-a}{n+1}\cdot\frac{k(k+1)}{2}+ka &= \end{align*}

If $X \sim U[0,1]$ then $X_{(j)}$ follows a Beta distribution $B(j,n+1-j)$ (ref). Then $$E[X_{(j)}]=\frac{j}{n+1}$$

The sum of the $k$ smallest elements is then

$$\sum_{j=1}^k \frac{j}{n+1}=\frac{1}{n+1} \frac{k (k+1)}{2}$$

(We can verify that when $k=n$ we get $n/2$ as expected)

If $X$ is uniform in $[a,b]$, then it's just a trivial linear transformation.