Wednesday, June 22, 2011

Rolling a lot of the same dice.

[1] [2] [3] [4] [5] [6]
[1] 2 3 4 5 6 7
[2] 3 4 5 6 7 8
[3] 4 5 6 7 8 9
[4] 5 6 7 8 9 10
[5] 6 7 8 9 10 11
[6] 7 8 9 10 11 12

   Anyone who plays Craps or Settlers of Catan can tell you that if you roll two six sided dice, the most common number to be rolled is a seven.  A quick look at the above table can tell you that it comes up six times out of 36 times.  But what if you rolled 3d6 or 4d6 or Xd6, what are the odds that a certain number would come up?  Well one way to solve this (and the way I did the first time I looked in to this) was to make a three and four dimensional table respectively.  But at some point this starts to make people brains hurt.  There is a easier way (an by easier that we have the internet to do math for us.)

Now a little math review before we go on. We will be using 6d6 as the example here, as this would be a common number to roll in dice pool games.

How many total possible ways can the dice land?

Well I have 6 dice each that can come up six ways so that would be 6^6 = 46,656 outcomes.  Look back at the 2d6 example to get this, 6^2 = 36. (Still talking about 2d6 here), if you roll a one on the first dice, then you have six possibilities to match it with (1, 2, 3, 4, 5, 6).  The same is true for a roll of a two on the first dice and so on through rolling a six on the first die. So six out comes on the first die each with six outcomes attached to it comes out to be 36 total outcomes.  Now if you were rolling 3d6 then for each of those 36 outcomes , from the 2d6, you have 6 possibilities to go with them for a total of 216 or 6^3.  But this still does not give me how many times I could roll a 12, or in other words I have the denominator of my probability but not my numerator.

??? / 46,656

Well I stumbled on something one day while trying to find an easier way to do this, rather than huge spread sheets tables I used the first time.  This gem I found was this.

(x^1 + x^2 + x^3 + x^4 + x^5 + x^6)^6

Let me start out by pointed to what the number mean, then why it works, and finally how to solve this beast (with our friend the internet.)

The exponents by the X stand for the dice face value 1-6 and the exponents on the outside stands for how many dice you are going to roll.  Unwritten above the coefficient in front of the X stands for how many times that number can come up (1x^3 means 3 can come up only once.)  

If you remember back to you high school algebra (x^2)*(x^3) does not equal x^6 but x^5, the exponents add, not multiply.  Also thinking back, if I said (x^1 + x^2)^2, I think most of you would remember something about F.O.I.L. and come up with an answer of:

(x^1 + x^2)^2
(x^1 + x^2) (x^1 + x^2)
(x^2 + x^3 + x^3 + x^4)
(x^2 + 2x^3 + x^4)

What does the mean, well if you have a two sided die and rolled two of them, you have a 1/4 chance of rolling a two or four (1x^2 & 1x^4) and a 2/4 chance or rolling a 3 (2x^3).
But I am sure that you don’t want to tackle  (x^1 + x^2 + x^3 + x^4 + x^5 + x^6)^6 by hand (I once had a student who I gave this problem to as extra credit over the weekend, he came back with yards of paper with the correct solution, by hand no less.)

Well here were the internet comes in, there is this wonderful site called WolframAplha, that will do the math for us, so I just type in:

(x^1 + x^2 + x^3 + x^4 + x^5 + x^6)^6

And out comes . . .

All those lovely numbers in front of the x are the number of ways that total can be rolled.  Take 2856x^25 this means there are 2,856 ways of rolling 25 on 6d6.  From here it is an easy deal to plug the numbers in to excel and end up with a chart that shows a nice growing bell curve like this:

The orange curve is 6d6 (Click for Larger Graph).

What the odds of rolling a 21 on 2d6+3d4?

No comments:

Post a Comment