# 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)]$.

-
What do you know? What did you try? Why did it fail? – Did Nov 17 '11 at 6:20
It's getting started that is causing the problem for me. In the previous problem I calculated E[x] and E[sum/difference of different number of die]. I found E[x] to be (k+1)/2. The expected value of the sums/differences I was able to calculate using the linearity property; but I don't know how to go about dealing with max/min functions inside the E[]. – jamesio Nov 17 '11 at 6:32

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_1) \mathbb{P}(X_2=n_2-n_1) n_1 \end{eqnarray}$$