How to evaluate $\mathbb{E}(|X_1-X_2|)?$ I am trying to solve the question in this post using an alternative. For completeness, I will retype the question in my post.

What is the average result of rolling two dice, and only taking the value of the higher dice roll? For example: I roll two dice and one comes up as a four and the other a six, the result would just be six.

My attempt: Let $X_1,X_2$ be the score by dice $1$ and $2$ respectively. Since we have 
$$\max(X_1,X_2)=\frac{|X_1+X_2| + |X_1-X_2|}{2},$$
it follows that 
\begin{align*}
\mathbb{E}[\max(X_1,X_2)] & = \frac{1}{2}\left[\mathbb{E}(|X_1+X_2|) + \mathbb{E}(|X_1-X_2|)\right] \\
& = \frac{1}{2}\left[ \mathbb{E} (X_1) + \mathbb{E}(X_2) + \mathbb{E}(|X_1-X_2|) \right] \\
& = \frac{1}{2}\left[ 7 + \mathbb{E}(|X_1-X_2|) \right].
\end{align*}
where I apply the fact that $X_1,X_2>0$ at second equality.
I got stuck at evaluating 
$$\mathbb{E}(|X_1-X_2|).$$
Any hint is appreciated. 
Just for record purpose, the answer is
$$\mathbb{E}[\max(X_1,X_2)] = \frac{161}{36}.$$

This is an interview question. So, I expect that there is an easy way to calculate the expectation. 
 A: The definition seems more helpful here.
Denote our sample space here with $\Omega = \{(i,j):1\leq i,j \leq 6\}$ where the first coordinate gives the value first dice and the second coordinate gives the value of the second dice.
Let $X_1, X_2$ as you defined and put $X= \max\{X_1, X_2\}$. Then $X$ attains the values $1,2,3,4,5,6$ and you must calculate
$$\mathbb{E}[X] = \sum_{i=1}^6 i\mathbb{P}(X = i)$$
Thus
 $$\mathbb{P}(X=1) = \mathbb{P}(\{(1,1)\}) =1/36$$
$$\mathbb{P}(X = 2) = \mathbb{P}(\{(1,2),(2,2),(1,2)\}=3/36$$
$$\mathbb{P}(X = 3) = \mathbb{P}(\{(1,3),(1,3),(2,3), (3,2), (3,3)\}=5/36$$
$$\mathbb{P}(X = 4) = \mathbb{P}(\{(1,4),(4,1),(2,4), (4,2), (3,4), (4,3), (4,4)\}=7/36$$
$$\mathbb{P}(X=5) = \dots = 9/36$$
$$\mathbb{P}(X=6) = \dots =11/36$$
and we get
$$\mathbb{E}[X]= 1/36 + 2.3/36 + 3.5/36 + 4.7/36 + 5.9/36 + 6. 11/36 = 161/36$$
Of course, you can still evaluate $\mathbb{E}[|X_1-X_2|]$ but calculating explicit probabilities cannot be avoided here.
A: We can easily use conditioning (that's the golden rule of using expectation, whenever stuck in a deadend, use conditioning)
 $$\mathbb{E}[|X_1-X_2|]=\mathbb{E}[X_1-X_2 \mid X_1 \ge X_2] + \mathbb{E}[X_2-X_1 \mid X_2 > X_1]$$
Now notice that if $X_1 \ge X_2$ then $X_1-X_2 =0,1,2,3,4,5$ with probabiilities $\frac{6}{36},\frac{5}{36},\frac{4}{36},\frac{3}{36},\frac{2}{36},\frac{1}{36}$, respectively.
If $X_2 \ge X_1$ then $X_2-X_1 =1,2,3,4,5$ with probabiilities $\frac{5}{36},\frac{4}{36},\frac{3}{36},\frac{2}{36},\frac{1}{36}$, respectively.
Thus we have 
$$\mathbb{E}[X_1-X_2 \mid X_1 \ge X_2]= \frac{6}{36}(0)+\frac{5}{36}(1)+\frac{4}{36}(2)+\frac{3}{36}(3)+\frac{4}{36}(2)+\frac{1}{36}(5) = \frac{35}{36}$$
$$\mathbb{E}[X_2-X_1 \mid X_2 > X_1]=\frac{5}{36}(1)+\frac{4}{36}(2)+\frac{3}{36}(3)+\frac{4}{36}(2)+\frac{1}{36}(5) = \frac{35}{36}$$
Alongside your own part of answer we have $\frac{1}{2}[7+\frac{70}{36}]=\frac{161}{36}$
Another way is to evaluate the $\mathbb{E}[|X_1-X_2|]$ directly. We know that $\mathbb{E}[|X_1-X_2|] = 0,1,2,3,4,5$ with probabilities $\frac{6}{36},\frac{10}{36},\frac{8}{36},\frac{6}{36},\frac{4}{36},\frac{2}{36}$, respectively. Thereforewe have
$$\mathbb{E}[|X_1-X_2|]= \frac{6}{36}(0)+\frac{10}{36}(1)+\frac{8}{36}(2)+\frac{6}{36}(3)+\frac{4}{36}(4)+\frac{2}{36}(5) = \frac{70}{36}$$
A: Your argument is correct. Indeed
$$
\mathbb{E}[| X_1 - X_2| ] =\frac{1}{36} \sum_{x_1=1}^6 \sum_{x_2=1}^6 |x_1-x_2| = \frac{35}{18}
$$
And
$$
\frac{1}{2} \left (  7 + \frac{35}{18} \right )  = \frac{161}{36}
$$
A: The most simple calculation  I can imagine is
$$\mathbb{E}(|X_1-X_2|)=\frac{2}{36}\cdot \sum_{i=1}^5 \sum_{j=i+1}^6 (j-i)$$
I used the symmetry here.
The sigma sign term can be easily written down:
$\color{blue}{\text{i  1  2  3  4  5}}$ 
$\ \text{    1  1  1  1  1}$ 
$\ \text{ 2  2  2  2}$
$\ \text{ 3  3  3}$ 
$\ \text{ 4  4}$ 
$\ \text{    5}$
The sums of the columns are just the sums of $n$ consecutive numbers, which is $\frac{n\cdot (n+1)}{2}$. Or you just write down the sums , starting with most right column: $1+3+6+...$
A: Actually, computing $\mathbb E\max(X_1,X_2)$ and $\mathbb E|X_1-X_2|$ are equally difficult, so I find it clearest to just compute $\mathbb E\max(X_1,X_2)$ directly as follows, and for $n$-sided die instead of $6$:
$$
\mathbb E\max(X_1,X_2)=\frac{1}{n^2}\sum_{i=1}^n\sum_{j=1}^n\max(i,j).
$$
Now we can split the sum into three parts: terms with $i<j$, terms with $i=j$, and terms with $i>j$. By symmetry the first and last are the same, so we get
$$
\mathbb E\max(X_1,X_2)=\frac{1}{n^2}\left(2\sum_{i=1}^ni(i-1)+\sum_{i=1}^ni\right).
$$
Fortunately both sums have simple closed forms:
$$
\sum_{i=1}^ni=\frac{n^2+n}{2},\qquad \sum_{i=1}^ni(i-1)=\frac{n^3-n}{3},
$$
both of which can be verified by induction (or in other slicker ways...)
Plugging in gives the result
$$
\mathbb E\max(X_1,X_2)=\frac{4n^2+3n-1}{6n}.
$$
