Expected value of die rolls - roll $n$, keep $1$ I know how to calculate expected value for a single roll, and I read several other answers about expected value with rerolls, but how does the calculation change if you can make your reroll before choosing which die to keep?
For instance, what is the expected value of rolling $2$ fair $6$-sided dice and keeping the higher value?  And can you please generalize to $n$ $x$-sided dice?
 A: A start: Let $X$ be the "larger" number when you roll two fair $n$-sided dice. Then
$$\Pr(X=k)=\Pr(X\le k)-\Pr(X\le k-1).$$
But the probability that $X$ is $\le a$ is the probability both dice are $\le a$. This is $\frac{a^2}{n^2}$.
Remark: There are easier (and arguably better) ways to show that $\Pr(X\le k)=\frac{2k-1}{n^2}$. But the above trick is a useful one.
The same idea works for tossing $d$ $n$-sided dice. The probability that the maximum $X$ is $k$ is $\frac{k^d}{n^d}-\frac{(k-)^d}{n^d}$.
A: So to calculate this one in particular isn't all that difficult, but it's a special case of order statistics, that is, generating statistics about multiple events when they're ordered. You'd need to use that for the middle. 
In this case where we take the one highest die, consider that to be less than or equal any given value, we must have both dice no greater than that value. So, it's the intersection of the probabilities that each individual die is no greater than than the value. If we have a cumulative distribution function for a die, then it describes the probability that the die will roll at most some value.
In the case of s-sided dice, we have that $P(X \le a) = \{\frac{a}{s}, a \in [1,s]\}$. 
To find out what the intersection of multiple dice is, we take the intersection of their probabilities, so noting that that intersection of a number of distinct events is $\prod(P)$ we can get that our new $P(X \le a)$ is $\frac{a^n}{s^n}$ or similar equivalent expressions for the intersection of n s-sided dice
Now in order to get the expected value, we need to get the probability distribution function, that is $P(X = a)$. To do this we'll take the discrete difference. We can't really simplify this, so we'll just take $ P(X = a) = \frac{(a)^n}{s^n} - \frac{(a - 1)^n}{s^n}$ Then we can take the summation of each of these for all $a \in [1,s]$
Then the expected value is the sum $\sum_{a=1}^s{a({\frac{(a)^n}{s^n} - \frac{(a - 1)^n}{s^n})}}$
A: To start with two dices. You can make a table and insert the maximum values of the two dices.
$ \begin{array}{|c|c|c|c|c|c|}  \hline \text{dice 1 / dice 2 }  & 1 &2 &3 &4 &5 &6  \\ \hline\hline \hline 1 & &2 & &4 &5 & \\  \hline 2 & 2 &2 & &4 &&6  \\ \hline 3&3 &3 &3 &4 &5&6 \\ \hline 4 & & &&4&5&6  \\ \hline  5 &5 &5&5&5&5&  \\ \hline 6 &6&&&6&6&6  \\ \hline \end{array} $
I left out some values to leave some work to do for you.
The probability for each combination is $p_{ij}=\frac{1}{36}$
The expected value then is $E(x)=\sum_{i=1}^6\sum_{j=1}^6 p_{ij} \cdot max(x_i,x_j)$
