Find the expected value of the sum of $m$ randomly numbers in the set $\{0,1,2,...,n\}$ If you choose randomly $m$ numbers without replace in the set $\{0,1,2,\ldots,n\}$. Calculate the average of the sum of the $m$ chosen numbers.
I was thinking the if $S$ is the random value that have distinct values, where the minimum value is $0+1+2+\cdots +m-1=\frac{m(m-1)}{2}$ and the maximum value is $(n-m+1)+(n-m+2)+ \cdots + n =\frac{n(n+1)}{2}-\frac{(n-m)(n-m+1)}{2} $.
Then
$$E(S) = \sum_{s} sP(S=s)$$
But I don't know if am I doing this right?
 A: Average of an arithmetic progression is the average of the first and last terms, which in this case is $~ \displaystyle \frac {n}{2}$. As we randomly choose $m$ terms, the average sum of $m$ terms should be $\displaystyle \frac{mn}{2}$.
A: In other words we want to calculate the expectation of $\sum_{i=0}^{n}{i\cdot a_{i}}$ where $m$ of the $a_{i}$s are $1$ and the rest are $0$.
$$
\begin{align}
E\left(\sum_{i=0}^{n}{i\cdot a_{i}}\right)&=\sum_{i=0}^{n}{i\cdot E\left(a_{i}\right)}\\
\\
&=\sum_{i=0}^{n}{i\cdot\frac{m}{n+1}}\\
\\
&=\frac{n(n+1)}{2}\cdot\frac{m}{n+1}\\
\\
&=\frac{mn}{2}
\end{align}
$$
A: HINT:
$$E(a_1+ \cdots + a_m) = E((n-a_1) + \cdots + (n-a_m)) = nm - E(a_1+\cdots + a_m)$$
A: We can use indicator like variables here. We take advantage of the linearity of expectation.
Let $S = \sum\limits_{i=1}^m X_i$ where each $X_i$ denotes the $i^{th}$ value you pulled.
$\mathbb{E}[S] = \mathbb{E}[ \sum\limits_{i=1}^m X_i] = \sum\limits_{i=1}^m\mathbb{E}[X_i]$.
Even though the $X_i$ are not independent and it might be the case that even one of them is completely determined. (For example if $m=n$ and you pulled $2,3,...,n-1,n $ then you know that $X_n=1$ for certainty)
Despite all of this the expected value of each $X_i$ is the same. It should be clear that prior to seeing anything all $X_i$ have the same distribution. The fourth number you pull is just as likely to be a $7$ as the first number before you do anything.
Hence $\mathbb{E}[X_i] = \mathbb{E}[X_1] = \frac{n}{2}$
And so $\mathbb{E}[S] = \mathbb{E}[ \sum\limits_{i=1}^m X_i] = \sum\limits_{i=1}^m\mathbb{E}[X_i] =\sum\limits_{i=1}^m \frac{n}{2} = \frac{nm}{2}$.
