# Sum of best X dice in Y dice rolled (or roll X pick best Y) odds/calculation

Background: In many pen and paper RPGs there is often an option or bonus/penalty to rolls that incorporates rolling multiples of the required die and taking the best or worst of those rolls for your roll.

Example: Advantage/Disadvantage in D&D 5e is best/worst die in 2 twenty-sided die rolls. This generally alters the average roll (of 1d20 or one twenty-sided die equaling 10.5) by 3.325 total (average of 13.825 with Advantage, 7.175 with Disadvantage).

Example 2: Best two dice of three six-sided dice rolled. This usually improves the average roll (of 2d6 or two six-sided dice summed, 7) by 1.45833 (8.4583 3-repeating if best, 5.5416 6-repeating if worst) total.

Example 3: Best two of four six-sided dice rolled. This usually improves the average roll (of 2d6 or two six-sided dice summed, 7) by about 2.344136 (9.344136 if best, 4.655864 if worst) total.

Questions: I was wondering what the specific means of calculating certain total rolls (such as rolls totaling a specific number, or that number and higher) and averages would be? Or if that was more easy to calculate than simply finding all the possible combinations and totaling them.

Part A: Given X best of Y dice with Z number of sides, is there a simple expression one can write to calculate this easier than just summing all the combinations?

Part B: Given the above scenario, is there a simple expression one can write to calculate the number of rolls at/equaling a specific number?

Part C: Given the above scenarios, is there a simple expression one can write to calculate the number of rolls at/equaling or above a specific number?

Other notes: I imagine that this will include a lot of factorial math and the Permutation/Combination functions, but I'm not sure how to proceed.

• This is a very natural question, but don't be ashamed about not knowing how to proceed. Most of the techniques used to address questions like this, such as generating functions and recurrence relations, don't seem to work well, because they cannot easily track the "smallest summand" in any given roll of the dice. I am almost positive there is no "simple expression" for any of these quantities. I would love to see someone else's good idea! – Jeremy Dover Sep 18 '17 at 0:30
• I doubt very much that there’s a simple expression for any of these things that you’re asking about since even the formula for the probabilities for the sums of $X$ $Z$-sided dice isn’t really all that simple and itself effectively involves summing combinations. Computing the probabilities that you’re interested in will almost certainly involve what are called order statistics, which will let you compute the probability that the lowest die roll is a particular value. – amd Sep 18 '17 at 0:36