# Probability with dice

1. Jul 16, 2004

### ShawnD

I'm trying to figure out how to calculate probabilities with dice. Suppose I had 10 dice, each with 6 sides, and I added the value of each die. How can I calculate the probability of getting an added sum of 33, or any other number? I know how to calculate the probability of getting that 33 through one specific set of rolls, but there are many many ways of getting a 33.

Another thing, is there a difference between using permutations and combinations in this case?

I plan on writing a computer program to calculate all of this, so any ideas that would take a crazy amount of processing power are still good ideas.

Last edited: Jul 16, 2004
2. Jul 16, 2004

### Zurtex

Well the probability of getting any particular combination of numbers with 10 dice is (1/6)^10, so you then need to multiply that by the number of times it is possible to get the sum of 33.

I would draw out a tree diagram, not bothering to fill out branches where I have dropped too low to get to 33 or gone over 33. Though there is a probably easier way, however I don't see that as too much as a problem converting it into a program.

3. Jul 16, 2004

### NateTG

There is always a difference. One will be correct, and the other will not.

Well, you could always try runnign $$10^{32}$$ trials in a Monte Carlo method, but I doubt that your computer would last that long. There are certainly methods that use a reasonable amount of calculation.

What method you end up using will depend on your sophistication, and your need for precision.

In practice you can simply have the computer run through all possible cases, and you'll get your answer. After all, there are only 10 dice, so there are only $$6^{10}$$ possibilities. A naive computer program should be able to go through all of them in less than a minute on a modern computer.

4. Jul 16, 2004

### arildno

Well, I don't know a thing about terminology (or formalism!) in combinatorics, but here's a thought:

Consider the function:
$$F(x)=(x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6})^{m}=(\frac{x-x^{7}}{1-x})^{m}$$

Clearly, in the first expression, the coefficient in front of power "p" equals the number of ways by which we may sum 1-6 up to p, let's say M(p).

But, equally, we have, by Taylor's theorem:
$$M(p)=\frac{f^{p}(0)}{p!}$$

Hence, the probability of getting "p" is:
$$Prob(p)=\frac{M(p)}{\sum_{i=m}^{6m}M(i)}$$

A computer will love to derive the second expression for F(x) the requisite number of times and evaluate the derivatives at x=0..

5. Jul 16, 2004

### Muzza

arildno, what's "m"? The number of dice?

Last edited: Jul 16, 2004
6. Jul 16, 2004

### arildno

Yes, m is the number of dice

7. Jul 16, 2004

### ShawnD

Well if it's going to be that hard, I'll just say screw it, draw a bell curve, then call it quits.

Thanks for the input though

8. Jul 16, 2004

### NateTG

A naive computer program is quite easy:

Code (Text):

#include<stdio.h>

#define NUM_DICE 10
#define NUM_FACES 6
#define DESIRED_VALUE 33

void main() {
int dice[NUM_DICE];
int i,j;
int count=0;
int total=0;

for(i=0;i<NUM_DICE;i++) {
dice[i]=0;
}
while(dice[NUM_DICE-1]<NUMFACES) {
dice[0]++;
for(i=0,j=NUM_DICE;i<NUM_DICE-1;i++) {
if(i==NUM_DICE-1 and dice[i]>=NUM_FACES) {
j+=NUM_DICE*(NUM_FACES-1);
break;
}
if(dice[i] >= NUM_FACES) {
dice[i+1]++;
dice[i]=0;
}
j+=dice[i];
}
total++;
if(DESIRED_NUMBER==j)
count++;
}
printf ("There odds of getting a sum of DESRIED_NUMBER are %d in %d\n",count,total)
exit 0;
}

There are also faster methods.