# Roll dice and ignore worst results

I am at my wits' end with my very basic statistics knowledge.

I roll $n$ dice with $k$ sides each (numbered $1$ thru $k$, laplace). I then add the numbers of the $m$ best dice (the higher the roll the better). This sum is the result.

What is the Expected Value of the result? (And how did you obtain it?)

What is the probability of getting the exact result of $x$ ($m \le x \le mk$)?

As you might have guessed, this question is about AD&D, and I got curious about the maths behind it.

EDIT: I think I found a partial solution, but this raises more questions. Please to check to see my answer.

-
For $n=2$, $k=6$, and $m=1$, the result is known to be $4$. cf. here. –  George V. Williams Jul 15 '13 at 18:08
Thank you, George. Most interesting for me is the special case of $n=4,k=6,m=3$, but I am also curious about a general solution. –  Hyperboreus Jul 15 '13 at 18:10
$n=4,k=6,m=3$ can be computed pretty easily by computer. I doubt there is a good general formula, but that's just a suspicion. –  Thomas Andrews Jul 15 '13 at 18:11

This is only the case $n=4,k=6,m=3$:

 X    Count     Probability
3        1     0.0008
4        4     0.0031
5       10     0.0077
6       21     0.0162
7       38     0.0293
8       62     0.0478
9       91     0.0702
10      122     0.0941
11      148     0.1142
12      167     0.1289
13      172     0.1327
14      160     0.1235
15      131     0.1011
16       94     0.0725
17       54     0.0417
18       21     0.0162


Simple Perl program.

-
Thank you. Is there also a closed expression for $E(n,k,m)$ or $P(n,k,m,x)$ without the need of actually summing up all the possible combinations? –  Hyperboreus Jul 15 '13 at 19:11

I think I have come to a solution for $m=n-1$, but it would be great if someone could check it.

We roll $n$ $k$-sided dice, ignore the least roll ($m=n-1$) and sum the rest.

Let $P_\ge(x)$ denote the probability that every single roll of the $n$ rolls is greater or equal to $x$.

$P_\ge(x) = \dfrac {(k - x + 1) ^ n} {k^n}$

Let $P_{\ge2}(x)$ denote the probability that every single roll of the $n$ rolls is greater or equal to $x$ and at least one roll equals $x$.

$$P_{\ge2}(x) = \dfrac {(k - x + 1) ^ n} {k^n} - \sum_{\nu=x + 1}^kP_\ge(\nu) \\ = \dfrac {(k - x + 1) ^ n - (k - x)^n} {k^n}$$ This $P_{\ge2}(x)$ is actually the probability that I have to rest $x$ from the sum of my rolls.

Its expected value is $E(P_{\ge2})$. $$E(P_{\ge2}) = \sum_{\nu=1}^k \nu P_{\ge2}(\nu) \\ = \sum_{\nu=1}^k \nu \dfrac {(k - \nu + 1) ^ n - (k - \nu)^n} {k^n}$$

So I expect to subtract $E(P_{\ge2})$ from every $n$ rolls I do. The expected value of rolling $n$ $k$-sided dice without ignoring any rolls is $E_0 (n,k)=\dfrac{k+1}{2}n$.

Hence the expected value for rolling $n$ dice and ignoring one is: $$E (n,k) = E_0 (n,k)- E(P_{\ge2}) \\ = \dfrac{k+1}{2}n - \sum_{\nu=1}^k \nu \dfrac {(k - \nu + 1) ^ n - (k - \nu)^n} {k^n}$$

Comparing the result of this formula with real results (little program doing the rolls) shows that it seems to hold.

Is my thinking correct or is this just an approximation (I am not sure about simply subtracting both expected values)?

How can this be expanded for $m \ne n-1$?

-