Results 1 to 3 of 3

Thread: As if I have any chance of rolling a ...

  1. #1
    Join Date
    Feb 2000
    Location
    Germany
    Posts
    1,011

    As if I have any chance of rolling a ...

    To make it short:
    I've written a (C++) command line program for educational purposes, that will print the probability distribution for almost any (<-- great exaggeration) number of dice.

    The program accepts input in the form x dy , with x being the number of dice and y being the number of faces. Input of the form 2d6+3, or 3d4+1d6 is not accepted. However, y can be just about any value, you are not restricted by the limits of three-dimensional space, so it is okay to ask for the distribution of d13, or d33.

    The output will look like this, without the lines (I had to put these in for propper format).

    6 combinations

    _______absolute__cumulated__cumulated
    result__frequency__frequency__percentage

    ___1_________1_________1____16.6667
    ___2_________1_________2____33.3333
    ___3_________1_________3____50.0000

    ___4_________1_________4____66.6667
    ___5_________1_________5____83.3333
    ___6_________1_________6___100.0000


    Right now, the program has one more limitation: if the number of different combinations for the specified values is larger than 4,294,967,295 the program will quit. This isn't too bad, though, since this prevents you from starting calculations that would take your computer several months or even years to finish.
    (Calculating the distribution for 20d6 would take about 7 years and 4 months on my PC. )

    Here are the links:
    dice.exe
    source code (if you are afraid of computer viruses and don't trust me )
    The source code was never intended for release, so don't expect too much.

    In case you would like to have the results not only on your screen, but also in a text file, you can redirect the output in the following way. Instead of starting the program by typing "dice" and pressing enter you will have to type "dice > filename.txt" and press enter. Then proceed as usual.

  2. #2
    Join Date
    Aug 2004
    Location
    Belgium
    Posts
    118
    Interesting program, might come in handy someday.

    My only regret is that it doesn't give absolute percentage aswell.
    I think absolute values are far more interesting then cumulted ones.

    Anyway thanks for sharing.
    Romuald "Pantoufle" Theate

  3. #3
    Join Date
    Feb 2000
    Location
    Germany
    Posts
    1,011
    Quote Originally Posted by Pantoufle
    Interesting program, might come in handy someday.

    My only regret is that it doesn't give absolute percentage aswell.
    I think absolute values are far more interesting then cumulted ones.
    Why's that? Usually people would like to know the probability of beating a certain TN. All you have to do to get that probability value for , say TN 10, is to subtract the cumulated probability for TN 9 from 1.
    Absolute percentages for single results actually aren't very informative, from a statistic point of view.

    Anyway thanks for sharing.
    You're welcome.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •