Calculating the expected values of the min/max of 2 random variables Consider two fair $k$-sided dice with the numbers 1 through $k$ on their faces, obtaining values $X_1$ and $X_2$. What is $\mathbb{E}[\max(X_1, X_2)]$ and what is $\mathbb{E}[\min(X_1, X_2)]$.
 A: HINT: $\min(x_1,x_2) + \max(x_1,x_2) = x_1 + x_2$, so it is enough to evaluate either expected value. Also $\max(x_1,x_2) - \min(x_1,x_2) = \vert x_2-x_1\vert$. Therefore, finding $\mathbb{E}(\vert X_2-X1 \vert)$ allows to determine expectations needed:
$$ \begin{eqnarray}
   \mathbb{E}\left( \vert X_2- X_1\vert \right) &=& \sum_{n_1=1}^k \sum_{n_2=1}^k \mathbb{P}(X_1=n_1) \mathbb{P}(X_2=n_2) \vert n_2 - n_1 \vert \\ &=& 
   2 \sum_{n_2=1}^k \sum_{n_1=1}^{n_2-1} \mathbb{P}(X_1=n_1) \mathbb{P}(X_2=n_2) (n_2 - n_1 ) \\ &=& 
   2 \sum_{n_2=1}^k \sum_{n_1=1}^{n_2-1} \mathbb{P}(X_1=n_2-n_1) \mathbb{P}(X_2=n_2) n_1
  \end{eqnarray}
$$
Can you finish this ?
A: It is a fairly standard fact that if $Y$ is a random variable that only takes on non-negative integer values, then
$$E(Y)=\sum_1^\infty \Pr(Y\ge i).$$
For example, please see this, towards the end. We calculate $E(\max(X_1,X_2))$, since once we have that the expectation of the min is straightforward.
The probability that the maximum is $\ge i$ is $1$ minus the probability $X_1$ and $X_2$  are both $\le i-1$. Thus for $i=1$ to $k$ we have
$$\Pr(\max(X_1,X_2)\ge i)= 1-\left(\frac{i-1}{k}\right)^2.$$ It follows that the  expectation of $\max(X_1,X_2)$ is 
$$\sum_1^k \left(1-\left(\frac{i-1}{k}\right)^2\right).$$
For a simpler expression, use the familiar closed form for the sum of the first $n$ squares. 
 
