# 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?

• If you wish to find distribution of $\max$ of $n$ i.i.d. random variables, then $P(\max\{X_1,..,X_n\}<x) = P(X_1<x,...,X_n<x)=$/*they are independent*/$=\prod_{i=1}^n P(X_i<x)=$/*probabilities are equal*/$=(P(X_1<x))^n$ – Slowpoke Aug 20 '15 at 14:29
• The expectation of the sum without rerolling is (for $k$ $n-sided$ dices) : $\frac{k(n+1)}{2}$ – Peter Aug 20 '15 at 14:34
• @hcl14, thank you for the response. Could you please show an example? I don't understand some of the notation you are using. – Catherine Aug 20 '15 at 14:39
• @Catherine The notation means, that if you have maximum of a few variables be less or equal than some value, then every variable is less or equal than that value. That allows you to easily write the distribution function $F_{max}(x)=P(\max\{...\}\leq x)$ of the maximum as a product of distribution functions of the variables. Then expectation can be easily computed: as long as for one m-sided dice $P(X_1\leq x) = x/m$, then $F_{max}(x)=(x/m)^n$ and $P(\max \{..\}=x) = F_{max}(x)-F_{max}(x-1)$. $E[\max]=\sum_{x=1}^m x*P(\max \{..\}=x)$ which will lead to the result in Jason Carr's answer. – Slowpoke Aug 20 '15 at 15:00

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})}}$

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)$

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}$.