Monday, February 17, 2020

5d6 but only count straights and matching

On 7 Feb 2020, diregrizzlybear on the GLOG channel of the OSR Discord asked1:

5d6 but only count straights and matching.

One solution might be to list all the rolls and score each one. This is probably feasible with a script. Instead, I enumerated the “hands”, and then found the probabilities of each of those.

Hands with No Degrees of Freedom

Run of Five

There are only two runs of five: ⚀⚁⚂⚃⚄ and ⚁⚂⚃⚄⚅. There is only one way to “make” each of these hands (“Count”), but because each die has a different face, there are 5!=120 possible orderings of each hand (Permutations).



There are six possible quintuples, and again, there is only one way to construct each one. While there are 5! possible orderings of five dice, because five of them are interchangeable, there is only one possible ordering of a quintuple (5!/5!=1), which makes a quintuple much less likely than a run of five.

If this seems counter-intuitive, consider rolling one die five times in order. If your first roll is a ⚀, to eventually score quintuples, the next roll must also be a ⚀ (1/6 odds). To eventually score a run of five, the next roll must only be not ⚅ or ⚀ (4/6 odds).


Run of Three + Double

There are 24 ways to score a run of three + double: 4 runs of three and 6 doubles. Depending on the doubled number, it may be possible to score this as other hands (run of four, triple), but this is never advantageous.

Because of the doubled number, there will be fewer ways to order this hand than a run of five, but more than a quintuple. If the doubled number is in the run, there are 5!/3!=20 possible orderings, and if it is not, then there are 5!2!=60.


Triple + Double

There are 30 ways to score a triple + double: 6 ways to score one and then 5 remaining ways to score the other (to exclude quintuples, which are already accounted for). As with run of three + double, we must account for duplicated numbers when counting orderings. There are then 5!/(3!*2!)=10 permutations of each.


Hands with One Degree of Freedom

Run of Four

There are three possible runs of four: ⚀⚁⚂⚃x, ⚁⚂⚃⚄x, ⚂⚃⚄⚅x, where x is our “unfixed” die (our degree of freedom). If x is equal to either the highest or lowest element of the run, then we instead have a run of three + double. If it is equal to a number after either end of the run, then we instead have a run of five. So for ⚀⚁⚂⚃x and ⚂⚃⚄⚅x, x has three possible values, and for ⚁⚂⚃⚄x, x has two possible values. We will also consider the cases where x is “inside” the run and “outside” the run separately, as the number of permutations is different.



There are 6 possible quadruples, with 5 ways to construct each one (again, to exclude quintuples). There are 5!/4!=5 permutations of a quadruple.


Two Doubles

There are 15 ways to score two doubles (half as many as triple + double, because it doesn't matter which number is the first multiple and which number is the second). The unfixed die (x) can take any of the four remaining values2. A hand of two doubles has 120!/(2!*2!)=30 permutations.


Hands with Two Degrees of Freedom

Run of Three

There are 4 runs of three: ⚀⚁⚂xy, ⚁⚂⚃xy, ⚂⚃⚄xy, ⚃⚄⚅xy. However, x cannot equal y (else we have run of three + doubles), x and y cannot both equal numbers in the run (else we have two doubles), and neither of x and y can equal a fourth part in the run (else we have a run of four).

For a run of three with no duplicates (for example, ⚀⚁⚂⚄⚅), there are 5!=120 permutations. For a run of three with one duplicate, there are 5!/2!=60 permutations.



There are six possible triples, each with two degrees of freedom (x,y). x cannot equal y, neither of x and y can equal the tripled number, and x and y cannot form a run of three with the tripled number. There are then (52-5)/2-R=10-R ways to make each triple, where R is the number of runs of three containing the tripled number.


Hands with Three Degrees of Freedom


There are six possible doubles, each with three degrees of freedom (x,y,z). None of x, y, and z can equal each other, none of x, y, and z can equal the doubled number, and x, y, and z cannot form a run with the tripled number. There are then 5!/(3!*(5-3)!)-R1-R2 =10-R1-R2 ways to make each double, where R1 is the number of runs of three (4) and R2 is the number of runs of four containing the doubled number.


Other Hands

Other hands are not possible with 5 dice, but I did not bother to prove this more formally. Instead, I can show that all hands are accounted for: there are 6^5=7776 possible rolls (in order), and the sum of all the “Odds” of the above hands is 7776.


Now we can sum the odds by score (instead of by hand) and normalize them. This gives us the following distribution.


The minimum score is 2, maximum 30, mean ~12.4, median 11, and mode 6. My spreadsheet is a bit messy, but you can see it here. Let me know if anything here seems off.

1 “Asked” is a strong word. Nobody asked for this.back

2 In the case of ⚀⚀⚁⚁⚂, both run of three and two doubles would score 6. For convenience, we will consider it as two doubles, because restrictions to exclude it are already part of the math for a run of three.back