# What Are the Odds?November 23, 2010 9:21 AM   Subscribe

Help me calculate the odds of this series of dice rolls.

I’m about to start a Pathfinder RPG campaign for a group of guys with whom I’ve never played before. For character creation, I had the group roll up characters using the standard method: Rolling four six-sided dice, dropping the lowest of the four, and adding the remaining three together. This was to be repeated six times, and then the six results were to be assigned to character attributes.

Three of the players rolled in front of me. I know what they rolled. The fourth couldn’t make it, so I told him that he could go ahead and roll without my supervision. He just emailed me his character, and according to the information that he provided, his rolls were (in descending order from highest to lowest) 18, 18, 17, 16, 16 and 15.

Needless to say, this strikes me as being statistically improbable. Having said that, I'd like to know precisely how statistically improbable it is. I'm bad at figuring this sort of thing out, but I thought that perhaps the hivemind could help me. What are the odds that someone could roll a string like that?
posted by Parasite Unseen to Sports, Hobbies, & Recreation (33 answers total) 1 user marked this as a favorite

The probability that someone rolls that exactly is going to be quite low, but in a deceptive way: if you flip 10 coins, you'd expect to get 5 heads and 5 tails...but the string HTHTHTHTHT for example, would have the same probability as HHHHHHHHHH.

What's more instructive, I think, is to think of the likeliness of significant variations around the mean... honestly I'd just write a little script on a per score basis (or hell just use excel) that gives you a distribution of scores, and can then give you quartiles to get a sense of just how unlikely it is.
posted by wooh at 9:31 AM on November 23, 2010

By "like that," do you mean exactly that group, or do you mean at least as good as that group? Or something else?
posted by DevilsAdvocate at 9:32 AM on November 23, 2010

Oh man, I am totally awful at probabilities, but if you check out this calculation on Anydice.com, you can at least see the probability of each of the individual rolls. I know there's a way to compound those probabilities, but it's been forever since I learned how to do that. Surely MeFi's math experts can help out with the rest.

And yeah, that set of rolls definitely smells suspicious.
posted by specialagentwebb at 9:32 AM on November 23, 2010

The Attributes section of this page explains the odds of rolling 4d6 and dropping one. Looks like an 18 is a 1.6% chance, 17 is 4.2%, 16 is 7.3% and 15 is 10.1%. I would love for someone else to explain the math behind that though.
posted by ChrisHartley at 9:35 AM on November 23, 2010

Response by poster: By "like that," do you mean exactly that group, or do you mean at least as good as that group? Or something else?

Let's say at least as good as that group, with "as good" being defined as totaling the same amount.
posted by Parasite Unseen at 9:35 AM on November 23, 2010

The probability that someone rolls that exactly is going to be quite low, but in a deceptive way: if you flip 10 coins, you'd expect to get 5 heads and 5 tails...but the string HTHTHTHTHT for example, would have the same probability as HHHHHHHHHH.

But he's not interested in the probability of the string. He's interested in the probability of that unordered group. Since scores can be assigned to abilities arbitrarily, 18, 18, 17, 16, 16, 15 is the same as 15, 17, 18, 16, 18, 16 or any other ordering.

Anyway, I just simulated a million generations of 6 stats using the roll 4 drop lowest method. I got those exact scores 16 times. That's .0016%. Do you want to see how often 'that good or better' comes up?
posted by jedicus at 9:38 AM on November 23, 2010

I make out that the average is around 12.25 and a standard deviation of around 2.75 using a monte-carlo simulation in excel and N=300 rolls.

Here is one set of quartiles:
```Minimum       4
25th %tile   10
50th %tile   13
75th %tile   15
Maximum      18
```
It's not impossible of course, but given the circumstances I would be highly suspicious of 6 roles at or above the 75th percentile.
posted by muddgirl at 9:39 AM on November 23, 2010

So, using excel (which has a pretty crappy random number generator) and a relatively small sample (10k), I got that the probability of a score >= 15 is ~23%, meaning that the probability of having all scores >=15 is ~.01%. Quite low, and that's for scores worse than what you put... now, if you sat down and didn't "cheat" per se but kept rolling stats until you got 6, you could boost it up (but even that would take a very large expectation of rolls). (This is, by the by, how a lot of statistical analysis is done as I've seen it...you create bounds that are easier to analyze and analyze those bounds, which then give you ballparks).

He's cheating.
posted by wooh at 9:40 AM on November 23, 2010

For one roll: The odds of rolling an 18 are one in 54. There's 6*6*6*6 possible rolls, and 24 ways to get 18 (1/6/6/6, 6/1/6/6 ... 2/6/6/6, etc). 24/1296 == 1/54.

The odds of rolling a 17 are about one in 19. Same possible rolls, 67 ways to get 17 (1/5/6/6, 1/6/5/6, 1/6/6/5, 5/1/6/6, etc, minus 5/6/6/6 etc and 6/6/6/6). (72-4-1)/1296 ~= 1/19.

Anything more complicated that that to calculate, and I'd just write a program instead.

Disclaimer: I'm not a mathematician or a statistician :)
posted by Dilligas at 9:40 AM on November 23, 2010

On a million trials I got 69 matches of 'that good or better' using a 'uniformly superior' definition of better (i.e., sort the scores ascending then each score must be at least equal to the corresponding real score).
posted by jedicus at 9:41 AM on November 23, 2010

A little more from the guy who made Anydice: 4d6 Drop the Lowest. So the chance of getting two 18s is 0.38%
posted by specialagentwebb at 9:41 AM on November 23, 2010

It's in the neighborhood of 1 in 100,000 for something at least as good as this series.

Unless you're playing with thousands of friends, he's cheeting.
posted by originalname37 at 9:44 AM on November 23, 2010

On a million trials I got 163 matches of 'that good or better' using your definition of totaling the same amount (i.e., 100). That's .0163%. He's either phenomenally lucky or he fudged it.
posted by jedicus at 9:45 AM on November 23, 2010

I mean he's "cheating".
posted by originalname37 at 9:46 AM on November 23, 2010

I hate to keep posting, but I'm still figuring out how to use Anydice. If his calculations are correct, then the chance of rolling a stat block with a sum greater than or equal to 100 is less than 0.01%. (click the "At Least" button for a better view of the data)
posted by specialagentwebb at 9:47 AM on November 23, 2010

Depending on your DM style, I think you are well within your DM responsibilies to say, "Congratulations on your 'lucky rolling' - but your character is way better than anyone else in the party. I can give you some options to reconcile your character unless you have a better suggestion."

The options as I see it are:
(1) Re-roll the whole character in your presence or using an online dice simulator.
(2) keep the overall character balance (high in whatever, low in whatever) but rebalance to a more reasonable average.

Also, I reran my sheet with N=6200 and here are a stable set of quartiles:
```Minimum       3
25th %tile   10
50th %tile   12
75th %tile   14
Maximum      18
```

posted by muddgirl at 9:48 AM on November 23, 2010 [2 favorites]

Binomial Probability if you want to know more about how these calculations work.

But yeah, that's all kind of suspicious. muddgirl has a good take on how to handle it.
posted by momus_window at 9:57 AM on November 23, 2010

yeah, he's cheating. depending on the friend, you can call him out on it and make him reroll... or you can make sure he's bogged down with some cursed items fairly early in the campaign, and what do you know, every time he's on watch, he get's attacked. funny how that keeps happening.
posted by jrishel at 10:10 AM on November 23, 2010

~8.73*10-6 (Less than 9 in a million chance of getting stats which sum to 100 or more given 6 rolls of 4d6 dropping the lowest.)

There's 64 combinations of stats (listed in descending order) that add to 100 or better. The probability of each is calculated by multiplying the probability of each of the stats (from ChrisHartley's link, or calculated directly), times the number of ways in which that set of numbers can be ordered (6! divided by the factorials of the number of stats which occur duplicate times).

For example, the probability of getting your player's combination exactly would be 0.016*0.016*0.042*0.073*0.073*0.101*(6!/2!/2!) [18 and 16 each occur twice, which is where those 2!s come from] ≈ 1.05*10-6

Doing this for all 64 combinations, and adding those up, I get ~8.73*10-6

[On preview: either jedicus or I am doing something wrong, as even getting 163 out of a million when ~9 out of a million are predicted is phenomenally unlikely.]
posted by DevilsAdvocate at 10:13 AM on November 23, 2010 [1 favorite]

I do not think that the "sums to over 100" is a good way to do it unless you are careful, because the fact that you'd doing 4d6 drop 1 changes how it would be distributed. It's a relatively simple question to do on a roll by roll basis though and people have churned the numbers and gotten fairly similar answers.
posted by wooh at 10:23 AM on November 23, 2010

He's cheating.

If I were the DM, I'd say something like "holy cow, those are some lucky rolls! unfortunately, that unbalances your character as compared to the rest of the team. I rerolled on your behalf, you should now assign: 17 15 14 13 13 11 (to punish for cheating, give particularly crappy numbers, or use an online roller to do it fairly).

Or, as others said, you can let him cheat but take care of the issue in-game by nerfing his character through cursed subpar weapons or perhaps a juicy amulet that looks awesome but actually reduces all your stats by 1. And oops, it can only be removed by a 10th level wizard. And gosh, there sure seems to be a lack of those around.
posted by zug at 10:25 AM on November 23, 2010 [1 favorite]

The odds that he rolled that specific sequence while you werent looking are the same if he rolled something reasonable. That being said I wouldn't be surprised if he is cheating, are you friends with this guy or is he just a warm body to fill the group?

Anyways, I am not that familiar with pathfinder, but assuming it works similarly to 3.5 is there any reason why you arent using an array, or a point buy system?
posted by BobbyDigital at 10:36 AM on November 23, 2010

Please just remember that just because something's improbable, doesn't mean it's impossible. People play RPG games every day, and unlikely rolls are going to happen. Unlikely + him self-reporting the results certainly points towards cheating, but rolling that combination is far from impossible.
posted by auto-correct at 10:42 AM on November 23, 2010

[On preview: either jedicus or I am doing something wrong, as even getting 163 out of a million when ~9 out of a million are predicted is phenomenally unlikely.]

I think you're doing something wrong. The Python code for this is extremely straightforward:

```import random dice = [0,0,0,0] stats = [0,0,0,0,0,0] matches = 0 # 1 million trials (technically 1 million and 1) for i in range(1000000):  #produce 6 stats  for j in range(5):   # roll 4 dice with values between 1 and 6 inclusive   dice[0] = random.randint(1,6)   dice[1] = random.randint(1,6)   dice[2] = random.randint(1,6)   dice[3] = random.randint(1,6)   # drop lowest and add the rest   dice.sort()   stats[j] = dice[1] + dice[2] + dice[3]  # check the total stat value  if sum(stats) >= 100:   matches = matches + 1 print "Matches: {0}".format(matches)```

Generally I find simulation more straightforward and less error prone than calculating exact probabilities in cases like these, but if I've made a coding error, please let me know. It's also possible the Python PRNG is unbalanced, but that seems unlikely.

I reran it a couple of times and got similar numbers: 151 and 147.
posted by jedicus at 10:42 AM on November 23, 2010

The odds that he rolled that specific sequence while you werent looking are the same if he rolled something reasonable.

No, this is only true when all individual outcomes are equally likely. That is, if you roll a single die six times, then 6,6,6,6,6,6 is just as likely as 5,3,5,1,6,2. But when rolling 4d6, removing the lowest, and adding the remaining three, 18 is not just as likely an outcome as 10 from a single roll, and that does not hold. (By analogy: if you flip a coin six times, H-H-H-H-H-H is just as likely as T-H-T-T-T-H, but edge-edge-H-edge-edge-edge is much less likely than T-H-T-T-edge-H.)

Also, we were given the scores in sorted order, which means that different combinations are not equally likely even if the individual rolls were. Rolling a single die six times and sorting the results, 6,6,6,6,6,6 is just as likely as 3,3,3,3,3,3, but both are much less likely than 6,5,5,3,2,1. (Only one sequence of rolls can produce the first or second, but there are 360 sequences which can produce the third. Each sequence is equally likely, but that means the third ordered set is 360 times as likely as one of the first two.)
posted by DevilsAdvocate at 10:52 AM on November 23, 2010 [1 favorite]

I think DevilsAdvocate is correct. The analytical solution (8.73e-6) is strikingly similar to my simulation answer of 8.765e-6 (8,765 hits out of a billion runs).
posted by originalname37 at 11:18 AM on November 23, 2010

The Python code for this is extremely straightforward...but if I've made a coding error, please let me know

Unfortunately, I don't know Python, so I can't really evaluate it, though nothing jumps out at me as obviously wrong. However, I wrote a perl program:
```\$matches=0;

for \$trialn (0..999999)
{
for \$statn (0..5)
{
for \$dien (0..3)
{
\$die[\$dien]=int(rand(6))+1;
}
@die=sort {\$a <=> \$b} @die;
\$stat[\$statn]=\$die[1]+\$die[2]+\$die[3];
}
\$sumstat=\$stat[0]+\$stat[1]+\$stat[2]+\$stat[3]+\$stat[4]+\$stat[5];
if (\$sumstat>=100) {\$matches++;}
}
print ("\$matches\n");
```
and got results in line with my prediction. 10 runs of this program (each run representing a million trials) gave 9, 7, 4, 8, 6, 10, 7, 10, 7, 11 matches.

Someone who knows both languages want to take a look at these and figure out who's doing something wrong?
posted by DevilsAdvocate at 11:30 AM on November 23, 2010 [1 favorite]

Similarly, I did a c# program, and got 12, 10, 7, 12, 5, 9 as my results.
posted by specialagentwebb at 11:33 AM on November 23, 2010

Ah, yeah, there's a bug. I forgot that range() isn't inclusive, so I was actually only rolling 5 dice each time, which meant that as soon as an 18 cropped up it got sorted to the 6th position in the array and stayed there. Obviously that biased the results quite a bit. Running it again I get 11 hits, which is much more in line with everyone else's results. Sorry about that.

A bit of salvage: my biased result (basically) shows that even if you spot yourself a guaranteed 18 the result the player got is still extremely unlikely.
posted by jedicus at 11:39 AM on November 23, 2010

In case anyone is still wondering about DevilsAdvocate's answer of 8.73e-6, here is the (severely unlovely) C code that I used to get exactly 8,765 hits in a billion runs:
```   // a billion runs
for(i=0;i<1000000000;i++)
{
total = 0;

// six sets
for(j=0;j<6;j++)
{
min = 6; sum = 0;

// four rolls
for(k=0;k<4;k++)
{
// roll the dice
cur_rand = rand();
cur_roll = ((cur_rand)/(RAND_MAX/6))+1;

// Keep track of min
if(cur_roll < min) min=cur_roll;
sum+=cur_roll;
}
// subtract min
sum-=min;
total+=sum;
}

// check the total
if(total>=100)
{
num++;
printf("%d\t[%d],%d,%e\n",i,total,num,(float)num/(float)i);
}
}

// spit out the result
printf("%e = 1 in %d\n",(float)num/1000000000.0,1000000000/num);
```

posted by originalname37 at 11:48 AM on November 23, 2010

Looks like an 18 is a 1.6% chance, 17 is 4.2%, 16 is 7.3% and 15 is 10.1%. I would love for someone else to explain the math behind that though.

It's not really that easy to explain without just slogging through and counting up the combinations. If you roll a d6 4 times, there are 64=1296 possible sequences of numbers, each with probability 1/1296. There are 21 possible sequences for which the sum of the three highest rolls is 18:

6666
6665
6664
6663
6662
6661
6656
6646
6636
6626
6616
6566
6466
6366
6266
6166
5666
4666
3666
2666
1666

So the probability of generating an 18 is 21/1296, or ~1.6%

We can simplify our calculations a bit by combining sequences which have the same numbers on individual dice but in different order, and listing them in descending order, and counting how many times each appears:

6666 (1)
6665 (4)
6664 (4)
6663 (4)
6662 (4)
6661 (4)

We can simplify it even further by noting that for each of the cases where one die is not six, they have the same number of possible sequences, so we can list them as:

6666 (1)
666n, where n≤5 (5*4=20)

To get a sum of 17, you have to roll two 6s, one 5, and one additional die which is 5 or less. But we have to count the one where the additional die is 5 separately than the one where it's 4 or less, because they have different numbers of sequences:

6655 (6)
665n, where n≤4 (4*12=48)

For a total of 54 sequences which generate 17; 54/1296 ≈ 4.2%

16 gets even more complex, as you can either have a) two 6s, one 4, and one 4 or less; or b) 6, two 5s, and one 5 or less. I.e.,

6644 (6)
664n, n≤3 (3*12=36)
6555 (4)
655n, n≤4 (4*12=48)

For a total of 94; 94/1296 ≈ 7.3%

And so forth, although as you go towards the middle of the range you get more and more possible combinations you have to account for (then it decreases again as you get towards the bottom of the range, finally coming to a 1/1296 chance of 3, since the only way to get that is 1111.)

Actually, that's how you'd do it for much larger sets of rolls. To actually do it for 4d6 (which I did for my calculation, to avoid significant roundoff error from only having two significant digits in those approximations), I just listed all 1296 possible sequences in Excel, calculated the sum of the three highest in each, and counted those up—less chance of error than if you're trying to list out all sets of rolls that generate, say, a 13 by hand.
posted by DevilsAdvocate at 12:23 PM on November 23, 2010

Thank you, makes sense now.
posted by ChrisHartley at 12:40 PM on November 23, 2010

Wow - I love all the math, but let's end this with a simple policy:

All dice rolls to create attributes must be done in front of the DM. End of story. You don't like it, tough luck. For the other players who might object, allow them to roll again with you as witness, then they can choose the set (not individual rolls - the WHOLE set) they like.
posted by chrisinseoul at 10:59 AM on November 25, 2010

« Older The best place to pick up Website Designers?   |   Haikus are easy/But sometimes they don't make any... Newer »