2

I have a complicated probability question. I want to know how to calculate the probability of reaching a target number (or greater) on a variable number of dice with each die having a variable number of sides. For example, the chance of rolling a 10 or higher on 2d6 and 1d4. I can calculate the answer by just writing down all the possibilities for any given set of dice but I need a formula that can work this out on its own if given the inputs. I want to use this formula as part of a google spreadsheet, (similar to Microsoft Excel). If it helps, I wont ever need more than 10 dice at a time and the dice can only have 4, 6, 8, 10, or 12 sides.

Thanks.

latyper
  • 21
  • 1
    I don't have time to write a full answer now, but you're dealing with a probability distribution called Irwin-Hall distribution (https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution). See the article and if you figure it out, you can even answer your own question. – kviiri Oct 26 '15 at 16:27
  • By symmetry, since $9 + 10 = (1+1+1)+(6+6+4)$, the probability of rolling a sum of $10$ or higher on two six-sided dice and one four-sided die is $\frac12$ – Henry Oct 26 '15 at 16:36
  • @kviiri: The Irwin-Hall distribution is continuous while this question is about a discrete distribution. – Henry Oct 26 '15 at 16:40
  • @Henry Thanks for correcting me! I did a bit of googling and this came up: http://math.stackexchange.com/questions/357442/distribution-of-sum-of-discrete-uniform-random-variables – kviiri Oct 26 '15 at 16:44
  • I really appreciate everyone's help but I can't keep up with the vocabulary you guys are using. Is it possible to dumb this down a lot or am I delving into something more complicated than I first appreciated? – latyper Oct 28 '15 at 00:33
  • See this example or search in this website... There are a lot of examples. –  Nov 29 '15 at 19:50

1 Answers1

2

One way is to use generating functions.

If you have $n$ dice, with sides $a_1,\dots,a_n$, then the coefficient on $x^k$ of the polynomial $$ \prod_{i=1}^n \left( \frac{1}{a_i} \sum_{j=1}^{a_i} x^i \right) $$ yields the probability of a sum of $k$ with these dice.

Summing the appropriate values will give you the probability of a sum above a given value.

For example, if you have a three-sided, a four-sided, and a six-sided die, then we want to look at $$ \left(\frac{1}{3}\sum_{i=1}^3 x^i\right)\left(\frac{1}{4}\sum_{i=1}^4 x^i\right)\left(\frac{1}{6}\sum_{i=1}^6 x^i\right)=\frac{1}{72} x^{13} + \frac{1}{24} x^{12} + \frac{1}{12} x^{11} + \frac{1}{8} x^{10} + \frac{11}{72} x^9 + \frac{1}{6} x^8 + \frac{11}{72} x^7 + \frac{1}{8} x^6 + \frac{1}{12} x^5 + \frac{1}{24} x^4 + \frac{1}{72} x^3. $$ Then, for example, the probability that the sum is greater than $10$ is $\frac{1}{12}+\frac{1}{24}+\frac{1}{72}=\frac{5}{36}$.

Another example. For the probability of throwing 9 or greater with two six-sided dice, we look at $$ \left(\frac{1}{6}\sum_{i=1}^6 x^i\right)\left(\frac{1}{6}\sum_{i=1}^6 x^i\right)=\frac{1}{36} x^{12} + \frac{1}{18} x^{11} + \frac{1}{12} x^{10} + \frac{1}{9} x^9 + \frac{5}{36} x^8 + \frac{1}{6} x^7 + \frac{5}{36} x^6 + \frac{1}{9} x^5 + \frac{1}{12} x^4 + \frac{1}{18} x^3 + \frac{1}{36} x^2 $$ Summing the coefficients on $x^9$, $x^{10}$, $x^{11}$, and $x^{12}$, we find the probability of throwing $9$ or higher is $\frac{5}{18}$.

  • I don't remember anything they taught me in high school math. I looked at some wikipedia articles but I can't work out what that E looking thing is supposed to do. Can you show me what the formula for 9 or higher on 2d6 would like please. I think I'll be able to pull apart what is going on if the question is simpler. – latyper Oct 28 '15 at 00:25
  • @latyper Hi latyper. I've added the 2d6 example you asked for. The E looking thing is an upper-case greek letter, sigma. It indicates a summation. You can read about this notation on Wikipedia. https://en.wikipedia.org/wiki/Summation Cheers! – Matthew Conroy Oct 28 '15 at 17:32
  • Where are you getting the denominators from? In the 2d6 target 9 example you posted you list denominators of 36, 18, 12, 9, 36, 6, 36, 9, 12, 18, and 36. I also do not understand why the numerator changes between 1 and 5. – latyper Nov 16 '15 at 23:15
  • You need to multiply (or "expand") the polynomial expressions shown to the left of each equation to get the expanded form to the right. – Matthew Conroy Nov 17 '15 at 19:58
  • How do you expand the polynomial? I get that the stuff after the equals sign equals the stuff before the equals sign but I'm not following what you are doing to make the expansion happen. – latyper Nov 18 '15 at 06:38
  • Multiplication of polynomials is taught in a basic algebra course. There are lots of online references. Try: https://www.google.com/search?q=multiplication+of+polynomials&ie=utf-8&oe=utf-8 – Matthew Conroy Nov 18 '15 at 17:30