# What is the Average Result of 2d20, Drop the Lowest.



## DM_Matt (May 17, 2007)

What is the average result of 2d20, drop the lowest? 

Thanks.


----------



## Henry (May 17, 2007)

I don't have the formula, but after a few dozen practice rolls on a dice rolling program, I'm guessing somewhere around 14 or 15.


----------



## TwoSix (May 17, 2007)

13.825


----------



## kenmarable (May 17, 2007)

TwoSix said:
			
		

> 13.825



That's what I got, too. 

I made up the math as I went along (but tested the method for 2d4 drop lowest and it worked), but I'm glad someone came up with the same answer.


----------



## Henry (May 17, 2007)

What WOULD be the formula, out of curiosity?


----------



## TwoSix (May 17, 2007)

TwoSix said:
			
		

> 13.825




It's pretty easy to compute exactly...there's only 400 combinations, so I just did it in Excel.


----------



## pawsplay (May 18, 2007)

Henry said:
			
		

> What WOULD be the formula, out of curiosity?




It's an algorithm.


----------



## Henry (May 18, 2007)

pawsplay said:
			
		

> It's an algorithm.




_And it is... ?_


----------



## MrFilthyIke (May 18, 2007)

Henry said:
			
		

> _And it is... ?_




a SECRET, Mr. Moderator Man...


----------



## punkorange (May 18, 2007)

lol, this thread's funny.


----------



## Henry (May 18, 2007)

punkorange said:
			
		

> lol, this thread's funny.




I know I've seen a kit on TV before similar to this exchange, somewhere...


----------



## pawsplay (May 18, 2007)

Henry said:
			
		

> _And it is... ?_




Somwhat complicated.

For each result of die A, determine the odds that the other die is lower. If so, add the result of die A. For instance, for 1, you don't add anything. For a 5, you add 5 four times, for 1, 2, 3, and 4.

Repeat for die B.

Add all the results where the two rolls are the same. 

Divide by the number of permutations (number of sides times number of sides)


----------



## gizmo33 (May 18, 2007)

(as best as I can figure):

Expected value is the sum of the probabilities (a number less than one) times the value matched with that probability.  For example, if I have coin with a 5 on one side and a 10 on the other, assuming 50/50, then the expected value is 5*.5 + 10*.5 = 7.5.  In this case "expected value" is a bad term since you can't actually get this value.  But neither can you roll a 13.825 (or whatever) on a d20.  I don't remember the right term, maybe I'll just call it "average value".

So in the case of the 2d20 throw away the lowest, you could do the same thing.  The chance of getting a 1 is .0025 (1 in 400).

The chance of getting a 2 is the chance of rolling 2-2, 2-1, or 1-2.  That's .0075.

The chance of getting a 3 is the chance of rolling 3-1, 3-2, 3-3, 2-3, 1-3.  That's .0125.

Maybe there's a pattern here, I don't know right now.  When you're done, you could add them up:

1*.0025 + 2*.0075 + 3*.0125 + ... (and so on)

The sum would be the average/expected value.

For any given result, X, the chance of producing that result using the 2d20 scheme described seems to me to be a combinatorics question - but I'd have to think more about it.

It probably would be faster just to write a random number generator program, run it 10,000 times, add up the results, and divide by 10,000 to get a good approximation.


----------



## AntiStateQuixote (May 18, 2007)

OK, it's actually a reasonably simple formula, but I can't express it here because I don't know how to do mathematical symbols on the PC.  What I need is a capital sigma with series expressions.

So, here it is in words:

where x is the number of sides on your die:

fn(x): sum over the series 1 . . . x mulitplying each number by 2 and subtract one then divide the summation result by the square of x.

So, you will have [(1 * 1) + (2 * 3) + (3 * 5)  + (4 * 7) + . . . + (x * (2x-2))] / (x^2).

That will give you the average of the rolls of two dice with x sides when you drop the lowest result.


----------



## orsal (May 18, 2007)

*a formula*

for "higher of two dn":

The possible results are 1,2,3,...,n

The probability of getting 1 is 1/n^2
The probability of getting 2 is 3/n^2
The probability of getting 3 is 5/n^2
The probability of getting k is (2k-1)/n^2
The probability of getting n is (2n-1)/n^2

Now the expected value (mathematical jargon for mean average in this context) is
the sum from k=1 to k=n of k(2k-1)/n^2
Distribute the 1/n^2 and focus on the sum of k(2k-1). This is the sum of 2k^2-k.

The sum of k, k=1 to k=n, is n(n+1)/2
The sum of k^2, k=1 to k=n, is n(n+1)(2n+1)/6
So the sum of 2k^2-k is 
2n(n+1)(2n+1)/6 - n(n+1)/2
= [n(n+1)/2][(4n+2)/3 - 1]
= [n(n+1)/2][(8n-2)/6]
= n(n+1)(8n-2)/12

Now remember that 1/n^2 we put aside a little earlier. Then we have

(n+1)(8n-2)/12n

This is the formula. Checking it for n=20, to see if it agrees with the people who did that case by itself, we get
(21)(158)/240=13.825

which agrees with what two people got from calculating this specific case. So I believe my algebra is correct.


----------



## orsal (May 18, 2007)

gizmo33 said:
			
		

> It probably would be faster just to write a random number generator program, run it 10,000 times, add up the results, and divide by 10,000 to get a good approximation.




If you're going to take that approach, why use random numbers? It's no sweat to have the program (or spreadsheet -- it's not hard to implement) systematically generate all 400 possibilities. That's both more efficient than 10,000 random cases, and guaranteed to give you the correct answer instead of merely a good approximation.


----------



## Rabelais (May 19, 2007)

Just a question... is it a Troll to ask a Statistics question on a D&D board?


The grade for this thread is B+.  Extra Credit available for actually building the formula in MiniTab and posting it


----------



## the Jester (May 19, 2007)

This thread is both fascinating and silly.


----------



## Ry (May 19, 2007)

Anybody have the shape of the curve?


----------



## Ry (May 19, 2007)

Who am I fooling?  I know how to use Excel.  

The formula for each result is the number squared minus one less squared, over 400 total possibilities.  So 20 is the most likely number (200-161=39/400), followed by 19, 18, 17, and so forth until we get down to 1 (1/400).


----------



## Dirigible (May 19, 2007)

> 13.825




I'm not buying that answer until Hong says it.


----------



## orsal (May 19, 2007)

rycanada said:
			
		

> Anybody have the shape of the curve?




Linear, increasing. The probability of k (on the better of two dn) is (2k-1)/n, which is an increasing linear function.


----------



## hong (May 19, 2007)

Dirigible said:
			
		

> I'm not buying that answer until Hong says it.



 It.


----------



## hong (May 19, 2007)

Rabelais said:
			
		

> Just a question... is it a Troll to ask a Statistics question on a D&D board?
> 
> 
> The grade for this thread is B+.  Extra Credit available for actually building the formula in MiniTab and posting it



 Good heavens, do people still use MiniTab?


----------



## QuaziquestGM (May 19, 2007)

Given real world circumstances, I'll go with an average result of 11. 

As a quazi mathematical justification:  the long term average roll of a D20 is 10.  The result of any two die rolls, even if made at the same time with separate dice, are statistically independent, so the average overall roll of each die is 10. As you are selecting the better result of 2 independent simultaneous events with identical long term averages,  and the result can only be a whole number, the new "average result" should be the next whole number better than the average of one set alone. 

In short, I'm going with Murphy's Law.

And as Murphy sets a pretty step curve, I'm arbitrarily setting the accepted average roll of "20 d20s keep the best" at 15.


----------



## Nifft (May 19, 2007)

QuaziquestGM said:
			
		

> the long term average roll of a D20 is 10.




This statment is not good for your math cred...

- - -

What's really awesome about max(2d20) is what it does for critical threat generation. The chance to threaten on a 20 goes from 5% to 9.75%; if you threaten on a 19, the chance goes from 10% to 19%; if you threaten on an 18, the chance goes from 15% to 27.75%.

Cheers, -- N


----------



## orsal (May 19, 2007)

QuaziquestGM said:
			
		

> As a quazi mathematical justification:  the long term average roll of a D20 is 10.




10.5, actually.



			
				QUaziquestGM said:
			
		

> As you are selecting the better result of 2 independent simultaneous events with identical long term averages,  and the result can only be a whole number,




An individual result can only be a whole number; the same is not true for the average.



			
				QuaziquestGM said:
			
		

> the new "average result" should be the next whole number better than the average of one set alone.




Why the next? Even if the average had to be an integer (which it clearly doesn't), why smallest one greater than the simple average of a single die?

Look at it this way: You roll a die, then get to increase your result by rolling again, but with no loss if your reroll is less than your original roll. Suppose instead you were doing this with d1000s. Do you really think the reroll, which has approximately 50% chance of increasing your result, but if it does could increase it by up to 999, would on average increase it by less than 1?



			
				Quaziquest said:
			
		

> In short, I'm going with Murphy's Law.




Captain Murphy would have the average as significantly less than 10. For example, any time you make an important roll that needs 5 or higher to succeed, Murphy would guarantee you a result no higher than 4. Unless you only make rolls with relatively low probabilties of success, there's no way Murphy's Law can be consistent with such results.[/QUOTE]


----------



## Roman (May 19, 2007)

orsal said:
			
		

> for "higher of two dn":
> 
> The possible results are 1,2,3,...,n
> 
> ...





Thanks! This is indeed useful.  

Just to expand on the question: How did you obtain the (2k-1) part of the formula? 

Also, is can this be generalized for multiple (more than two) rolls keep the highest, multiple rolls drop the lowest or even multiple rolls drop X rolls?


----------



## pawsplay (May 19, 2007)

orsal said:
			
		

> If you're going to take that approach, why use random numbers? It's no sweat to have the program (or spreadsheet -- it's not hard to implement) systematically generate all 400 possibilities. That's both more efficient than 10,000 random cases, and guaranteed to give you the correct answer instead of merely a good approximation.




Because it's easier.


----------



## drothgery (May 19, 2007)

pawsplay said:
			
		

> Because it's easier.




Easier here meaning that you don't really have to think about how the problem works to do a Monte Carlo approach to solving it.


----------



## pawsplay (May 19, 2007)

drothgery said:
			
		

> Easier here meaning that you don't really have to think about how the problem works to do a Monte Carlo approach to solving it.




Correct, and the "approximation" can be easily done to a degree of precision as to be nearly indistinguishable from a formal answer.


----------



## Torm (May 19, 2007)

Just trying a quick little experiment in my head, sans calculator, and I have a question for the people who said they did 2d4, drop lowest:

Is the average 2.7?

And if anyone knows right off, is the average of 2d6, drop lowest, 4.05?

And 2d8, drop lowest, should be 5.4?

They probably aren't, but if these are even close, I'm using a method that is a LOT simpler than the other math I've seen in this thread so far.....

EDIT: Nevermind, back to the drawing board.


----------



## Ry (May 19, 2007)

Roman said:
			
		

> Just to expand on the question: How did you obtain the (2k-1) part of the formula?




It has to do with the difference between squares.  Take a look at the breakdown in Excel.  See how the 20s fill the far right and bottom rows?  Then the 19s are the box inside that, and the 18s are the box inside that, all the way down to 1? 

Think about the size of those row/columns.  

There are 20 20s across the bottom, and 19 more 20s on the far right.  (i.e. 2 * 20, minus 1 because of the overlap in the bottom right corner).

Now we're done with the 20s, imagine they're gone and look at the 19s.  There's 19 19s across the bottom, and 18 more of them along the far right.  (i.e. 2 * 19, minus 1 because of the overlap in the bottom right corner).  

The pattern repeats all the way to 1.


----------



## orsal (May 19, 2007)

Roman said:
			
		

> Thanks! This is indeed useful.
> 
> Just to expand on the question: How did you obtain the (2k-1) part of the formula?




How many ways can you get less than or equal to k? Since both dice must independently be less than or equal to k, there are k^2 ways that can happen.

How many ways can you get strictly less than k? That means less than or equal to k-1, so there are (k-1)^2 ways.

How many ways to get exactly k? That means less than or equal to k but not less than or equal to k-1. So subtract:
k^2 - (k-1)^2 = k^2 - (k^2-2k+1) = 2k-1.



			
				Roman said:
			
		

> Also, is can this be generalized for multiple (more than two) rolls keep the highest,




Sort of. You can apply similar reasoning, but the formulas become more complicated.

For three dice, the number of ways (out of n^3) to get exactly k will be

k^3 - (k-1)^3
= k^3 - (k^3 - 3k^2 + 3k -1)
= 3k^2 - 3k + 1

Likewise, at this stage, if you have m dice, and want to keep only the best single die roll, you'll have a polynomial of degree (m-1) to deal with.

Now, with two dice, notice that I needed to know the formulas for sums from k=1 to k=n
sum(k) = n(n+1)/2
sum(k^2)=n(n+1)(2n+1)/6

Well, with three dice, I'm also going to need to know
sum(k^3)=[n(n+1)/2]^2
and with four dice I'm going to to know the formula for sum(k^4), which I'd have to look up. One of the Bernoulli brothers figured out all of these sums back in the 17th century, but apart from sum(k) (which the ancient Greeks knew), they aren't easy. (The formula for sum(k) was famously rediscovered by an 8-year-old Carl Gauss; most 8-year-olds aren't up to rediscovering it themselves, but you can show Gauss' reasoning to any mathematically competent middle school student and they'll at least be able to follow it. Not so with any proof I know of sum(k^2) or higher.)

Actually, for a specific die, if you don't want the general formula, you can do it without the algebra. Just calculate the 20 (or however many sides on the die) probabilities independently, and then add. For a big die it's a lot of numbers, but you don't need to know the Bernoulli formulas. If you want to do as I did, give a formula for n-sided dice without specifying a particular value of n, you'll need the Bernoulli formulas.



			
				Roman said:
			
		

> multiple rolls drop the lowest or even multiple rolls drop X rolls?




That's a lot trickier. I can't think of an elegant way to compute all the probabilities you need systematically. When I wanted to figure out the distribution for best 3 out of 4 d6, I set up a spreadsheet to enumerate all 6^4=1296 possibilities and calculate the sum for each.


----------



## hong (May 20, 2007)

pawsplay said:
			
		

> Because it's easier.



 No it's not.


----------



## pawsplay (May 20, 2007)

hong said:
			
		

> No it's not.




One requires 400 permutations. The other requires five lines of code in the scripting language of your choice. *shrug*


----------



## orsal (May 20, 2007)

orsal said:
			
		

> Roman said:
> 
> 
> 
> ...




After I wrote that, it occurred to me there is a nifty way.

The sum of the best three out of four dice is the best die plus the sum of the middle two. The average result for the sum of the middle two dice is easy: it's 7. The reason is symmetry: since as many dice (one) are dropped from the top as from the bottom, the distribution will not be skewed toward either the high or low end of its range. So the mean is the same as the middle possible value, which is 7. The distribution is somewhat different than just rolling two dice and adding them -- more often close to 7, fewer extremely high or extremely low results -- but the average is the same.

So, by the method described above, you might be able to calculate that the average result for the top die out of 4 d6 is about 5.24. (I didn't actually calculate it, but I know the answer I'm going to get from the aforementioned spreadsheet, so I worked backwards.) The average of the sum is the sum of the averages, so 7+5.24=12.24. This is the average ability score generated by the standard method.


----------



## hong (May 20, 2007)

pawsplay said:
			
		

> One requires 400 permutations.




No, one requires 2 formulas and 1 application of copy-and-paste in the spreadsheet of your choice.


----------



## orsal (May 20, 2007)

pawsplay said:
			
		

> One requires 400 permutations. The other requires five lines of code in the scripting language of your choice. *shrug*




But five lines of code or fewer can generate all 400 permutations. Just nest one loop inside another.

Or, four columns of a 400-row spreadsheet can do the trick -- the first column is a series of 400 consecutive numbers (any decent spreadsheet can do that automatically), the next two extract the individual die results coded by the numbers in the first column, and the last adds them.


----------



## pawsplay (May 20, 2007)

hong said:
			
		

> No, one requires 2 formulas and 1 application of copy-and-paste in the spreadsheet of your choice.




True enough, but the monte carlo method is easily adaptable to different die types.


----------



## hong (May 20, 2007)

pawsplay said:
			
		

> True enough, but the monte carlo method is easily adaptable to different die types.



 So is the enumeration method.

Now if you were talking about different NUMBERS of dice, that would be different.


----------



## pawsplay (May 20, 2007)

In any case, the tools of modern technology offer two relatively simple methods of determining the number.


----------



## Rabelais (May 20, 2007)

```
Just a question... is it a Troll to ask a Statistics question on a D&D board?
```

Yes... yes it is.

QED


----------



## Darkness (May 20, 2007)

Torm said:
			
		

> Just trying a quick little experiment in my head, sans calculator, and I have a question for the people who said they did 2d4, drop lowest:



 Possible combinations for 2d4, drop lowest:
Die 1/Die 2 = Result
1/1 = 1
1/2 = 2
1/3 = 3
1/4 = 4
2/1-2 = 2 (note that this is 2 combinations)
2/3 = 3
2/4 = 4
3/1-3 = 3 (note that this is 3 combinations)
3/4 =4 
4/any =4 (note that this is 4 combinations)

(1+2+3+4+2*2+3+4+3*3+4+4*4)/16 = (10+4+7+9+4+16)/16 = 50/16 = *3.125*


----------



## orsal (May 21, 2007)

hong said:
			
		

> So is the enumeration method.
> 
> Now if you were talking about different NUMBERS of dice, that would be different.




Ah, I see. You set up your spreadsheet by using rows for one die and columns for the other. Works very well, and more efficient than my way for two dice, but can't be applied to more dice.

My method, however, works for any number of dice, as long as you have enough rows on your spreadsheet. For m dice of n sides each, you need m^n rows. In the first column put the numbers from 0 up to m^n-1; use the next m columns to give the base-n representation of the number in the first column. You then get every possible dice combination with dice labelled from 0 to n-1. Add one to each die, and you have standard dice.


----------



## kromelizard (May 21, 2007)

pawsplay said:
			
		

> It's an algorithm.



Is it also an equation?


----------



## pawsplay (May 21, 2007)

kromelizard said:
			
		

> Is it also an equation?




You could equate it to something, yes. It is not, however, algebraic, unless you first melt down the average results with probabilities (the other method mentioned above, not the one I suggested).


----------

