# complex dice probability make head esplodeDecember 21, 2007 1:52 PM   Subscribe

I need a tool to help me analyze the probability of certain events occurring regarding a pool of X dice for a game I am creating. See my examples below.

I am looking for a dice statistics program or, baring that, a set of formulas I could input into excel, that can answer the following questions. Graphing capabilities are a plus.

Some of the events I want to analyze:

1) The probability that, from a pool of X dice, Y dice can be chosen by a player such that the sum of the Y dice is equal or lesser than a number N.

2) Related to the previous question; of the pools that succeed what is the distribution of how close they are to hitting N, (for instance, if the sum of Y dice is 10 and the number the player was aiming for was 12 then they are only off by 2).

3) In a pool of X dice How likely is it that there will be Z sets of doubles (say two 6s or snake eyes) and, more specifically, what are the chances of getting a specific set of doubles (say just snake eyes).

I am pretty statistics theory inept (never took it in school) but I am average to above average with math in general... basically please keep any advice in laymen terms as much as possible. Thanks
posted by DetonatedManiac to Technology (7 answers total) 2 users marked this as a favorite

For sort of complex stuff like this the easiest way to do it is to run a simulation, and actually roll X dice 5000 times and see how many times you can meet whatever criteria. Divide that by 5000 and that's very close to your probability.

If you aren't a programmer, this might be a good project to learn python or something for. It shouldn't be very difficult.
posted by aubilenon at 2:01 PM on December 21, 2007

What you're looking for is the Monte Carlo method. The computer takes the underlying probabilities and then runs it an ungodly amount of times. It is sort of like cheating, and it has problems outside of physical processes.

Regardless, there's a lot of data out there on how to implement Monte Carlo in practically any language or program that could support it.

In any case you should get a shape of the probability distribution for what you're looking for.
posted by geoff. at 2:20 PM on December 21, 2007

Excel plus the rand() / randbetween() function?
posted by mphuie at 3:30 PM on December 21, 2007

I haven't looked too closely at how it, and it seems like it'd have a bit of a learning curve, but you can probably make dicelab give you the answers you want.
posted by plant at 5:01 PM on December 21, 2007

I'm sure you'll get some great answers here, but you might want to try cross-posting this on Board Game Geek's Game Designer forums. The people on there literally spend hours a day thinking and writing about stuff like this, and giving them this question would be a wonderful Christmas gift that would appreciate with gusto.
posted by Ian A.T. at 9:08 PM on December 21, 2007

The proper way to do (1) and (3) is with combinatorics, some set theory, and the axioms of probability. The distributions in (2) will depend on how many times you roll the dice, but it'll end up being normal by the central limit theorem, for n > 30.

The easy way to do all of this is to download R, which is a statistics programming language. There are plenty of R tutorials floating around. You can use a discrete uniform distribution to model dice (your sample space is {1,2,3,4,5,6} all with p = 1/6). R will let you generate as many random trials as you want, manipulate them however you want, and then print up a nice little histogram with everything you ever wanted to know.
posted by devilsbrigade at 12:27 AM on December 22, 2007

Slight correction: that sample space is for one die. If you're just doing sums, you can define your sample space as {2,3,4,5,6,7,8,9,10,11,12}, in which case it would no longer be uniform (there are multiple ways to sum to 6, but not to sum to 2). YYou may also find it easier to work with a sample space more like {{1,1},{1,2},{1,3}....{6,6}}, which will let you be more flexible. R does all of these things.
posted by devilsbrigade at 12:30 AM on December 22, 2007

« Older Retaining my URL   |   He needs a grill to match his truck and his NASCAR... Newer »