# 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

## 2 Answers

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 ?

-
I don't see how you got to step 3 in this calculation can you explain – Brish Jun 22 at 22:06
Yes, simply change the summation index $n_1$ to $n_2-n_1$ – Sasha Jun 22 at 22:25
Can you be a little more elaborate please? – Brish Jun 22 at 22:30
I mean use Identity $\sum_{n=1}^{m-1}f(n)=\sum_{k=1}^{m-1}f(m-k)$, where we changed summation index as $n=m-k$. The identity is valid for any function $f$. – Sasha Jun 22 at 22:42
The last RHS should be modified. – Did Jun 22 at 22:46

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.

-