RolePlay onLine RPoL Logo

, welcome to Community Chat

15:07, 20th April 2024 (GMT+0)

Mathheads: help with dice probability.

Posted by badpenny
badpenny
member, 253 posts
eats shoots and leaves
Wed 20 Apr 2016
at 13:42
  • msg #1

Mathheads: help with dice probability

Using a target system, I get how to calculate the individual probability of a single die, but I'm not sure how to calculate the additive nature of multiple dice.

Here's the premise of a single d6:

RollSuccess
1No Success
2-51 Success
61 Success and re-roll

Just FYI: On the dice roller it's Target 2 and re-roll maxes.

I'm trying to figure out a "base difficulty" chart for this system I'm cobbling together.  I'd like to know what are the odds of rolling X number of success with Y number of dice using the above rubric.

Example: If the average human (it's going to be a superhero system) has 2d in an athletics measurement (trait/skill/etc) let's say, I'm looking to populate a chart something like this:

BalancingSuccesses needed
Yard wide 
Wide (1-3 ft) 
Narrow (< 1 ft) 
Balance beam 
Tightrope 

Thanks for any help.
swordchucks
member, 1178 posts
Wed 20 Apr 2016
at 14:40
  • msg #2

Mathheads: help with dice probability

Anydice.com is a good place to go with most probability issues... but it's super-tricky in this case.  Stealing from some code for nWOD, I got this:

http://anydice.com/program/831f

There are lots of built in functions for looking at the data in different ways, too (try the "at least" button for what you're probably wanting.
meschlum
member, 162 posts
Wed 20 Apr 2016
at 17:26
  • msg #3

Mathheads: help with dice probability

Easy!

First, we want the average, to know what a die is worth and get a feel for possible difficulty ranges (difficulty 4 on 1d6 is not the same as on 2d6, after all).

With one die, you have 5/6 successes (anything but a 1) and a 1/6 chance of rolling another die - which is worth 5/6 successes and a 1/6 chance...

So that's 5/6 + 1/6 * 5/6 + 1/36 * 5/6 + ... = 5/6 * (1 + 1/6 + 1/36 + ...) = 5/6 * 6/5.

Meaning you get (on average) 1 success per die.

This does not give you the detailed distribution (there is a chance of getting 9001 successes on a single die, after all), but helps to set expectations. Over the long term, someone with 2 dice will manage a difficulty 2 task fairly often, for instance.


Next, we want to look at the variance, to get a first pass estimate of how much a die will vary from the average.

The standard deviation is a bit more challenging to compute, so we use a few shortcuts. First, we compute the average of the square of the number of successes (so 0 on a roll of 1, 1 on a roll of 2-5, 4 on a roll of 6 followed by 2-5, etc.). This gives us (skipping a few steps) 25/36 * (1 + 4/6 + 9/36 + 16/216 +...). Skipping a few more steps, we get 1.4, so the final variance is 1.4 - 1 = 0.4 (we subtract the square of he mean).

A coin flip granting either 0 or 2 successes has an average of 1 success, and a variance of 1, so your results are less random than what you'd get with a coin flip (or 2 successes on 4+ with a d6). This suggests that results will rarely vary from the expected value, so your range of difficulties will be limited.

A variance of 0.4 means that if you roll 5 dice (total variance 5 * 0.4 = 2), you expect the number of successes to vary by sqrt(2) = 1.4, so most of the time you'll get between 4 and 6 successes. With 10 dice, you get sqrt(4) = 2, so most of the time you're between 8 and 12 successes. Adding a die is a significant increase is skill and a difference of a few points in difficulty is hard to overcome.


Finally, let's look at the statistics for low numbers of dice, where the effect of the law of large numbers is reduced and so estimates using the variance are less reliable.

1 die

0 successes: 1/6
1 success: 25/36 (4/6 direct, 1/6 * 1/6 of rolling 6 followed by 1)
2 successes: 25/216 (4/36 direct, 1/36 * 1/6 of rolling 6, 6, 1)
3 successes: 25/1296
...

This is an exponential curve, decaying fairly quickly, with the odds of getting N+1 successes are 1/6 the odds of getting N successes (for N > 0).

2 dice

0 successes: 1/36 (none from either die)
1 success: 50/216 (none from one die, one from the other - either 0, 1 or 1, 0)
2 successes: 675/1296 (0, 2 or 2, 0 for 50/1296 plus 1, 1 for 625/1296)
3 successes: 1300/7776 (0, 3 or 3, 0 for 50 plus 1, 2 and 2, 1 for 1250)
4 successes: 1925/46656 (0, 4 for 50, 1, 3 for 1250, 2, 2 for 625)
5 successes: 2550/279936 (0, 5 for 50, 1, 4 and 2, 3 for 1250 each)
...

This is a bit more complicated, but the exponential decay is still there once you get past the average (2 successes in this case).


Successes1 die2 dice
017%3%
169%23%
212%52%
32%17%
40.3%4%
50.05%1%


With 1 die, you get 1 success quite often, and are in the 0 to 2 range 98% of the time. With 2 dice, you get a variance of 0.8, so you expect about +/-1 success on average, which is definitely the case (92% of the time!). Three dice have a variance of 1.2, so not much more variation - outliers will be a bit more common, but I expect you'd still be in the 2-4 range around 90% of the time.
swordchucks
member, 1179 posts
Wed 20 Apr 2016
at 18:27
  • msg #4

Mathheads: help with dice probability

I massaged the anydice results a bit to make this table:

Successes1d2d3d4d5d6d7d8d9d10d
0%16.67%2.78%0.46%0.08%0.01%0%0%0%0%0%
1%69.44%23.15%5.79%1.29%0.27%0.05%0.01%0%0%0%
2%11.57%52.08%25.08%8.25%2.28%0.57%0.13%0.03%0.01%0%
3%1.93%16.72%41.69%25.04%10.05%3.29%0.95%0.25%0.06%0.01%
4%0.32%4.13%18.78%35.1%24.22%11.29%4.23%1.38%0.41%0.11%
5%0.05%0.91%6.03%19.38%30.66%23.14%12.09%5.07%1.83%0.6%
6%0.01%0.19%1.64%7.53%19.28%27.51%22.03%12.57%5.78%2.28%
7%0%0.04%0.41%2.42%8.63%18.88%25.16%20.97%12.84%6.37%
8%0%0.01%0.09%0.69%3.17%9.43%18.35%23.33%20.01%12.96%
9%0%0%0.02%0.18%1.02%3.85%9.99%17.79%21.85%19.14%
10%0%0%0%0.04%0.3%1.37%4.46%10.37%17.23%20.63%
11%0%0%0%0.01%0.08%0.44%1.73%4.99%10.61%16.69%
12%0%0%0%0%0.02%0.13%0.6%2.09%5.44%10.76%
13%0%0%0%0%0.01%0.04%0.19%0.78%2.43%5.83%
14%0%0%0%0%0%0.01%0.06%0.27%0.97%2.75%
15%0%0%0%0%0%0%0.02%0.12%0.53%1.86%

badpenny
member, 254 posts
eats shoots and leaves
Wed 20 Apr 2016
at 19:59
  • msg #5

Mathheads: help with dice probability

Wow, fantastic amounts of information.  Thank you for your time and effort!
rubberduck
member, 3254 posts
Oh all right, I give up:
Quack Quack
Thu 21 Apr 2016
at 10:05
  • msg #6

Mathheads: help with dice probability

And remember, as far as I can see the above table is the chance to get exactly that amount of successes. So if a 1d roll needs at least 1 success, it has a 83.33% chance of success (1 success + 2 successes + 3 successes, etc.)
Merevel
member, 1018 posts
Gaming :-)
Very unlucky
Thu 21 Apr 2016
at 13:28
  • msg #7

Mathheads: help with dice probability

Ug, I remember from statistics class there was a math equation that would take the odds of pass and odds of failure and the number of tries to give you number of times you are likely to succeed.

I could try and dig it up if you want?
This message was last edited by the user at 14:00, Thu 21 Apr 2016.
engine
member, 45 posts
Thu 21 Apr 2016
at 13:53
  • msg #8

Mathheads: help with dice probability

One good takeaway from all this is that "exploding" dice really don't do that much.
badpenny
member, 255 posts
eats shoots and leaves
Thu 21 Apr 2016
at 14:14
  • msg #9

Re: Mathheads: help with dice probability

engine:
One good takeaway from all this is that "exploding" dice really don't do that much.


That more or less is true.  I'm not married to the scheme, but I know I want a bell curve in place.

Does anyone know how to get the dice roller to take the median (of three) dice?  You can drop lows and highs, but say you wanted to median of 3d20: 11 *16* 19....
engine
member, 46 posts
Thu 21 Apr 2016
at 14:26
  • msg #10

Re: Mathheads: help with dice probability

badpenny:
That more or less is true.  I'm not married to the scheme, but I know I want a bell curve in place.
Then you wouldn't want exploding dice. They don't do much, but they would skew a bell curve.

badpenny:
Does anyone know how to get the dice roller to take the median (of three) dice?  You can drop lows and highs, but say you wanted to median of 3d20: 11 *16* 19....
I don't know, and I'd be surprised if it's possible, but I'd be interested to know where you're going with this. For one thing, it would require rolling only odd numbers of dice, and the more you rolled the more likely you'd be to land around the average of the dice. You'd have a curve, but it would be so sharp that you'd save time by assuming that the result was the average value for the die.
badpenny
member, 256 posts
eats shoots and leaves
Thu 21 Apr 2016
at 17:23
  • msg #11

Re: Mathheads: help with dice probability

In reply to engine (msg # 10):

The issue I have is with linear rolls, e.g a single d20 with exactly an even 5% chance to roll any given value.  It's too swing-y for my tastes.  I was thinking that if you rolled 3d20 and took the median die, you'd get more midline values.

Rolling 2d10 strikes me as achieving more or less the same result as the above.

The only reason I experimented with a dice pool is because with the dice roller you're not really put out by having to roll a ton of dice, unlike at a table rolling physical dice and having to spend the time to calculate the result.

Really, just looking for a nifty little dice mechanic to randomize things.  I've done all the dice+bonus things and thought that a dice pool based on a rank could be something different.
engine
member, 48 posts
Thu 21 Apr 2016
at 17:35
  • msg #12

Re: Mathheads: help with dice probability

badpenny:
In reply to engine (msg # 10):

The issue I have is with linear rolls, e.g a single d20 with exactly an even 5% chance to roll any given value.  It's too swing-y for my tastes.  I was thinking that if you rolled 3d20 and took the median die, you'd get more midline values.
You will, it just seems unwieldy to me.

2d6 is a classic bell curve. Lots of games use that. 3d6 gives you a much sharper curve, such that you generally don't even need to consider the highest numbers.

One thing to watch out for is that when your curve gets sharper bonuses and penalties have much more effect. With a single die, +1 is good and +2 is about twice as good, but neither really tend to put you in a range you don't generally see already. With a sharp curve, say with 3d6, a +2 puts you pretty far outside the norm already. I'm not saying that's undesirable, I'm just making sure you're aware of the fact.
meschlum
member, 163 posts
Thu 21 Apr 2016
at 18:20
  • msg #13

Re: Mathheads: help with dice probability

With 2d10, you get a range from 2 to 20 and linearly in- (or de-) creasing weights, so it's partway to a normal distribution.

With 3d6, you are notably closer to a normal distribution with a range of 3 to 18. Try 3d8 - 3, and you get 0 to 21 for a decent 'd20' feel, plus exceptional rolls.


If you're using the median on 3d20, then the reasoning is as follows.

To get a 20 (or a 1), you need to roll two (or more) 20s.

Three 20s happen with probability (1/20)^3 (1 in 8000)
Exactly two 20s happen with probability 3 * 19 / 8000 (20, 20, not 20 happens 19 times, 20, not 20, 20 happens 19 times, and not 20, 20, 20 happens 19 times).

So that's 58 / 8000 of getting a 20 (a bit more than 0.7%).


To get a 2 to 19 (N), you need to roll one N, one 1 to N and one N to 20.

Three N happens with probability 1/8000
Two N happens with probability 57/8000 (see above)
One N happens with probability 6 * (N - 1) * (20 - N) / 8000 (the 6 term comes from the different order in which the dice can roll). That's 6 * (21N - N^2 - 20)/8000


Which gives a general formula of (126N - 6N^2 - 62)/8000 for N ranging from 1 to 20 (the odds of getting a 20 median when you roll a single 20 are zero).




So:

Result2d103d8 - 3MedianMedian 5d
00%0.20%0%0%
10%0.59%0.73%0.12%
21%1.17%2.08%0.74%
32%1.95%3.28%1.81%
43%2.93%4.33%3.13%
54%4.10%5.23%4.56%
65%5.47%5.98%5.96%
76%7.03%6.58%7.21%
87%8.20%7.03%8.23%
98%8.98%7.33%8.94%
109%9.38%7.48%9.31%
1110%9.38%7.48%9.31%
129%8.98%7.33%8.94%
138%8.20%7.03%8.23%
147%7.03%6.58%7.21%
156%5.47%5.98%5.96%
165%4.10%5.23%4.56%
174%2.93%4.33%3.13%
183%1.95%3.28%1.81%
192%1.17%2.08%0.74%
201%0.59%0.73%0.12%
210%0.20%0%0%

Which lets you compare.

2d10 gives you better odds of getting extreme high results than 3d8-3 (15% chance of 16+ versus 11%) and similar odds to the median. It has fewer low results (starting at 2) and a higher average (11 instead of 10.5).

The median is more flatly distributed around the mean (8 to 13 aren't all that different) than 2d10 and is more likely to get a low value than the others (2d10 starts at 2, which helps a lot, and 3d8-3 has lots of average results).

3d8-3 has the most extreme range, and is much closer to the normal distribution.


So your benefit in using the median is in getting more low values than 2d10, more high values than 3d8-3, and average values being less differentiated (with 2d10, 11 happens about one and a half times more often than 8, while with the median it's 6% more often).

Edit: Added results when using the median of 5d to the table. It's close to 3d8-3 around the mean, with fewer outliers (3- or 18+), a bit narrower than the 3d median and broader than 3d8-3 around the mean. Using 5 dice actually makes the median less different, so it's not that useful (and convoluted to boot).
This message was last edited by the user at 23:33, Fri 22 Apr 2016.
swordchucks
member, 1181 posts
Fri 22 Apr 2016
at 13:25
  • msg #14

Re: Mathheads: help with dice probability

Ever mess with ORE?  In essence, you have a pool of dice determined by stat+skill (or the equivalent in the system you're in) and roll that many d10s.  You then look for matches and the matched sets (if any) determine how well things went.  Matched sets are judged by their height (the number on the die) and their width (the number of dice in the match).  So, 3 1s and 2 10s might be better or worse than each other, depending on the particular system (usually, width goes to speed, so 3 1s is better than 2 10s when running a foot race - but 2 10s would be better if debating someone).  Sometimes, there are specific interpretations - like with a damage roll, width might be the damage and height the hit location.

There's a bit more to the interaction of sets than that, but that's the basics of it.  It is certainly far, far from a d20 roll (which I also share your distaste for).
badpenny
member, 257 posts
eats shoots and leaves
Fri 22 Apr 2016
at 13:35
  • msg #15

Re: Mathheads: help with dice probability

In reply to swordchucks (msg # 14):

Isn't that used for Godlike?  I recall that height x width mechanic from several years ago.  I'll look into that.

And thanks again to all the mathheads who've posted amazing levels of detail!  It's really helping!
Sign In