# What I do in my spare time (to prove to myself how huge of a nerd I am)

Ever get a problem in your head that you obsess over for days, or even weeks (or longer)? This is the one I’ve been working on for a while.

At some point, I started to wonder about dice rolling. Specifically, I wondered about the difference between rolling a single 12-sided die and two 6-sided dice. How do the two compare? Obviously, with a 12-sided die (which I will refer to as d12, in grand D&D tradition) every number on the die has an equal chance of being rolled (8.33%), ignoring variations in dice shape, weight, texture, etc.

But what about when you use a pair of six-sided die (d6)? Like a d12 (or any properly made dice) each number has the same chance of being rolled (16.67%). But when using them in a game, you add them up. How does that affect your odds of getting certain numbers?

First of all, the obvious: there’s no way to roll a 1 with 2d6 (that’s 2 six-sided die). Second, since rolling two of the same number is rare, that would mean that scoring a 2 or 12 (the lowest and highest scores you can get) would be equally rare. With that in mind, I assumed that I’d be looking at a Bell Curve of some sort.

Well, the idea kept gnawing at me, and finally I decided to run an experiment and collect the data myself. I created a program in Flash (which was a great opportunity for me to practice using Actionscript 3) that would roll the dice for me and display the result.

Each “loop” in the program represents a roll, in which both 1d12 and 2d6 are rolled at the same time. The program tallies up which number comes up for the d12, and it adds and then tallies the score for the 2d6. For something that’s based purely on random numbers, lots of tests (rolls) need to be done, so I set it to roll the dice 1,000 times. Fortunately, computers make tedious tasks easy (and easy tasks tedious). Eventually I upped the number of rolls to 10,000 and then 50,000. I consider that a very solid sample size.

Here’s the final result. When the number of rolls is low, the numbers are all over the place, but it eventually normalizes once you have a larger amount of data (which shows exactly why you need a large sample size when doing a scientific experiment). Go ahead and re-run the experiment a few times. It’ll automatically stop at 50,000.

As expected, the d12 is a straight line, and shows the predicted 8.3%. But the 2d6 results are much more interesting. The odds of rolling a 7 are double the odds of any roll on a d12. Also interesting is that 4 and 10 are equally likely to be rolled on 2d6 as on a d12.

It’s probably obvious to a lot of you by now that I don’t gamble. These results probably aren’t surprising to anyone with experience in rolling dice, or to anyone who’s familiar with basic Statistics. Oh well.

So, how do we apply these results to real life? Well, let’s say you’re playing Dungeons & Dragons, where the amount of damage your character does to an enemy per round depends on what you roll with your dice. Let’s say you have a choice between a greataxe that does 1d12 damage or a greatsword that does 2d6 damage (actual base properties used). You obviously want the one that does the most damage. But is there a difference? Clearly, with the greatsword, you’re most likely to roll between 5-9 and unlikely to roll 2, 3, or 11. It has much more predictable numbers, though you’re more likely to get higher (and lower) numbers with the greataxe.

But when you figure out the odds of each number being rolled, a clear difference emerges. The average damage done by the greataxe is 6.5. The average damage done by the greatsword is 7.

I could’ve gotten those results if I had just found the average of all possible rolls in the first place.

(1+2+3+4+5+6+7+8+9+10+11+12)/12 = 6.5
(2+3+4+5+6+7+8+9+10+11+12)/11 = 7

Argh. Whatever.

UPDATE (Dec 30, 2009): Ever since I posted this, I’ve been itching to add rollers for 3d4, 4d3, and 6d2 (aka \$1.50). So I did. And as expected, they show up as bell curves. So the more variables you have, the smoother the bell curve will be. Maybe someday I’ll do this with 1000d1000. I wonder if 50,000 rolls would be enough…

## 41 thoughts on “What I do in my spare time (to prove to myself how huge of a nerd I am)”

1. X = Number of dice Y = Max value for individual dice ((Y+1)/2)*X = Average dice roll
This comment was originally posted on Reddit

2. Yeah I gotta say, I never wondered what the difference was. Even without a full understanding of statistical distribution, I could see that 1d12 gave a range of 1-12, and 2d6 gave a range of 2-12.
This comment was originally posted on Reddit

3. For numerical probabilities, the probability distribution of the sum is the convolution integral of the probability distibution of the pieces. Though, sums are used instead of convolution integrals for discrete probabilities. Imagine you take a 6 sider. It has the following distribution: 1 2 3 4 5 6 1 1 1 1 1 1 2 6 siders is: 1 1 1 1 1 1 1 1 1 1 1 1 <-slide this one across, and sum up the results. Giving: 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 5 4 3 2 1 Divide by the total (36) and that is the probability of each result. This method is easy to set up on a spreadsheet, make a series of 1s in a column for the initial dice: e.g. 12 1’s in a row, going down. Space this starting on row X, where X is greater than the dice you want to add to it e.g. A10->A22. Make a column next to it, starting with =SUM(A1:A10) (for adding a 10 sided dice). Copy that cell going down, it should auto adjust, and make a moving window that adds the probabilities. Using this method, 2 6 siders + 1 12 sider is: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 3 6 10 15 21 26 30 33 35 36 36 35 33 30 26 21 15 10 6 3 1
This comment was originally posted on Reddit

4. Figured this out after playing Dungeons and Dragons for a while. d12 has an equal chance of hitting 1-12 and 2d6 averages at around 7. 2d6 = higher average d12 = slightly higher chance to hit a 12. It is the two handed sword vs. two handed ax debate.
This comment was originally posted on Reddit

5. You can make 2 6 sided dice have an equal probability of 1-12 however… Here’s how: First, we make one of them only have 2 sides, you do this by calling 1,2, and 3 a 1, and 4,5, and 6 a 2. If it’s a 2, add 6 to the result of the second die. If it’s a 1, dont. This gives an equal probability of any number from 1-12. It’s late where I’m at, so I can’t come up with a set of numbers from platonic solid dice that you could work to give a equal 2-12 distribution.
This comment was originally posted on Reddit

6. At the end of the article, he mentions rolling 4d3. I wonder how many 3-sided dice he has.
This comment was originally posted on Reddit

7. This is true. But you have a 1 in 12 chance to hit a 7 with a d12 and it is a 16 in 36 chance to roll a 6, 7, or 8. That’s half your chances on 3 numbers out of 12.
This comment was originally posted on Reddit

8. He might have just divided a D6 result by 2 and rounded up.
This comment was originally posted on Reddit

9. At first I thought this was a pretty silly question since it seemed wholly obvious why 2D6 != 1D12; however, I really enjoyed watching this app run and do exactly what I had hoped it would. In particular I loved watching the points for rolls that equal 4 or 10 to converge on each other since in either dice situation they happen to both have a 1/12 probability.
This comment was originally posted on Reddit

10. Yeah, I passed statistics in high school too. Cool app though.
This comment was originally posted on Reddit

11. I normally go for the 2d6. I would just prefer the security of average damage over possibly low damage.
This comment was originally posted on Reddit

12. A 12-sided die produces results that are evenly distributed between 1-12. The probability of rolling any number on the die is the same: 8.3% (ignoring any shape or material defects in the die). Rolling 2 6-sided dice produces results in the range of 2-12 that are are very approximately Gaussian distributed. This is due to the fact that there are 6 different combinations of rolls that result in 7, but only one that produces 2 or 12: Roll Comb. Prob 2, 12 1 2.27% 3, 11 2 5.56% 4, 10 3 8.33% 5, 9 4 11.11% 6, 8 5 13.89% 7, – 6 16.67% Therefore, rolls on 2×6-sided die will trend to the mean, whereas rolls on a 12-sided die will be evenly distributed across the entire range of values.
This comment was originally posted on Reddit

13. Fun Fact: There is exactly one other pair of six-sided dice with positive integer numbers on the sides that has the same distribution of numbers as a standard pair of 2d6’s. Try to figure out the numbers! [Answer:] (http://en.wikipedia.org/wiki/Sicherman_dice) [1,2,2,3,3,4 and 1,3,4,5,6,8](/spoiler)
This comment was originally posted on Reddit

14. But when you crit with that ax and that x3… oh mah goodness…
This comment was originally posted on Reddit

15. Did you know: The sum of all the dots on a pair of dice equals 42. Therefore the question of life the universe and everything is "What is pair a dice?"
This comment was originally posted on Reddit

16. The logic is flawed. d12 vs 2d6 is comparing apples and oranges. A rule must be created to map from 2d6 to d12. Although it might be simple or in some way make sense to just sum both d6, it’s obviously a bad method since it eliminates "1". The rule is arbitrary. Separate the 2 d6 and map the 36 possibilities 3 to 1 on the d12. Now you have the same odds! Please stop sucking at math.
This comment was originally posted on Reddit

17. Totally worth it. Because the look on a caster’s face when you out-damage them with a melee attack is beautiful.
This comment was originally posted on Reddit

18. d3s are rolled quite a bit; daggers and such are frequently used by small characters like gnomes and hobbits. Either you take a D6 and divide by two or get a barrel die (I think I’ve seen a barrel d3 before, a triangluar prism with the bases rounded so it can’t fall on them).
This comment was originally posted on Reddit

19. Your typical barbarian actually has to worry about the difference between the dice when choosing between a greatsword and a great axe. The greatsword will give you a slightly higher average, but the great axe will give you higher variance; this might be useful if your average damage is just below your foes health.
This comment was originally posted on Reddit

20. 1d12 averages to 6.5, not 7. In practice, this difference is more than eclipsed by the difference in variance, the different criticals offered by the two weapons, and the cool factor.
This comment was originally posted on Reddit

21. It’s just whatever Flash uses. It’s rand(ceil) or whatever the command is.
This comment was originally posted on Reddit

22. if this stuff interests you, then you might want to read up on probability, permutations and combinations. Statistics will hurt your brain, but the classic stuff has been around since the Greeks, and generally has little to do with complex math. Also, check out Monty’s choice.
This comment was originally posted on Reddit

23. Nope. Been playing DnD since 5th grade.
This comment was originally posted on Reddit

24. My wife felt reassured that these were the kind of models i looked at online
This comment was originally posted on Reddit

25. If you’re still interested, here it is: There are quite a few papers, but some versions of the proof are really cool. For example: Look at the [probability generating function] (http://en.wikipedia.org/wiki/Probability-generating_function) for a fair single six-sided die: 1/6x + 1/6x^2 + 1/6x^3 + 1/6x^4 + 1/6x^5 + 1/6x^6. To obtain the generating function for two of these, all you need to do is multiply the above by itself, and get: 1/36 x^2 + 2/36 x^3 + … + 1/36 x^12. The result we want above is 1/11 for all 11 outcomes (2~12, or coefficients of x^2 ~ x^12). So ideally we should have 1/11 (x^2 + … + x^12) = x^2 / 11 (1+x+…+x^10) expressed as a product of two (loaded) 6-sided dice Generating functions: = (a1x^1 + … + a6x^6)(b1x^1 + … + b2x^6) = x^2 ( a1+…+a6x^5)(b1 + … + b2x^5) where a1~a6,b1~b6 are REAL, and are between 0 and 1. (probability) but notice that 1+x+…+x^10 cannot be factored into two 5th degree polynomials with real coefficients. This is due to the fact that the roots of 1+x+…+x^10 are the ten complex 11th roots of unity. (apply the conjugate root theorem and you quickly realize you can’t possibly pair up conjugate roots into an odd (5th) degree polynomial)
This comment was originally posted on Reddit

26. "If I completely redefine the problem, I can map one die role to the other instead of comparing how the two differ! Please stop sucking at math." Seriously. He’s comparing the outcomes of rolling one 12 sider versus the sum of two 6 siders. 2d6 means the sum of two six sided die rolls. It does not mean roll two six sided dice and map the outcomes to resulting values however you please. He’s doing very basic statistics here, and he’s doing it correctly. It’s not difficult to understand, and it has nothing to do with mapping one roll to the possible results of the other.
This comment was originally posted on Reddit

27. decker says:

Ha. You accidentally stumbled onto the correct answer for the average of two six sided dice. There are 36 possible outcomes, not 11. Some of the values that occur will be the same of course, but a 2 7 roll is not the same as a 3 4 roll just to give one example.

28. decker says:

Ha. You accidentally stumbled onto the correct answer for the average of two six sided dice. There are 36 possible outcomes, not 11. Some of the values that occur will be the same of course, but a 2 7 roll is not the same as a 3 4 roll just to give one example.

29. This went downhill as soon as they made the decision to *add* the results from the two 6-sided dice. To preserve the 12-sided distribution, roll the pair of 6-sided dice and denote the outcomes as **X1** and **X2**. If **X2** is 4,5, or 6 then return 2 * **X1**. Else return **X1**.
This comment was originally posted on Reddit

30. Settlers of Catan uses the distribution of 2d6 as one of its main mechanics.
This comment was originally posted on Reddit

31. if you rolled the 2 dice at the same time, but would only take (for exaMPLE) the one to the right; it would effectively be a d12

32. if you rolled the 2 dice at the same time, but would only take (for exaMPLE) the one to the right; it would effectively be a d12

33. Anyone whose played the Settles of Catan already knows all this.
This comment was originally posted on Reddit

34. There is no reason you should be adding the 6-sided die outcomes together. If you’re looking to obtain a 12-sided die distribution, roll a pair of 6-sided dice denoting the outcomes **X1** and **X2**. If **X2** is 1,2, or 3 then return **X1**. Else return **X1**+6.
This comment was originally posted on Reddit