Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Probability with dice

  1. Jul 16, 2004 #1

    ShawnD

    User Avatar
    Science Advisor

    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. jcsd
  3. Jul 16, 2004 #2

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  4. Jul 16, 2004 #3

    NateTG

    User Avatar
    Science Advisor
    Homework Helper

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

    Well, you could always try runnign [tex]10^{32}[/tex] 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 [tex]6^{10}[/tex] possibilities. A naive computer program should be able to go through all of them in less than a minute on a modern computer.
     
  5. Jul 16, 2004 #4

    arildno

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

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

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

    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:
    [tex]M(p)=\frac{f^{p}(0)}{p!}[/tex]

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

    A computer will love to derive the second expression for F(x) the requisite number of times and evaluate the derivatives at x=0..
     
  6. Jul 16, 2004 #5
    arildno, what's "m"? The number of dice?
     
    Last edited: Jul 16, 2004
  7. Jul 16, 2004 #6

    arildno

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    Yes, m is the number of dice
     
  8. Jul 16, 2004 #7

    ShawnD

    User Avatar
    Science Advisor

    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 :wink:
     
  9. Jul 16, 2004 #8

    NateTG

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Probability with dice
  1. Dice question (Replies: 19)

  2. Fractional dice? (Replies: 6)

  3. Dice Help (Replies: 5)

  4. Dice - how many walls? (Replies: 6)

Loading...