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).

HandScoreCountPermutationsOdds
⚀⚁⚂⚃⚄151120120
⚁⚂⚃⚄⚅201120120

Quintuple

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).

HandScoreCountPermutationsOdds
⚀⚀⚀⚀⚀5111
⚁⚁⚁⚁⚁10111
⚂⚂⚂⚂⚂15111
⚃⚃⚃⚃⚃20111
⚄⚄⚄⚄⚄25111
⚅⚅⚅⚅⚅30111

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.

HandScoreCountPermutationsOdds
⚀⚁⚂⚀⚀812020
⚀⚁⚂⚁⚁1012020
⚀⚁⚂⚂⚂1212020
⚀⚁⚂⚃⚃1416060
⚀⚁⚂⚄⚄1616060
⚀⚁⚂⚅⚅1816060
⚁⚂⚃⚀⚀1116060
⚁⚂⚃⚁⚁1312020
⚁⚂⚃⚂⚂1512020
⚁⚂⚃⚃⚃1712020
⚁⚂⚃⚄⚄1916060
⚁⚂⚃⚅⚅2116060
⚂⚃⚄⚀⚀1416060
⚂⚃⚄⚁⚁1616060
⚂⚃⚄⚂⚂1812020
⚂⚃⚄⚃⚃2012020
⚂⚃⚄⚄⚄2212020
⚂⚃⚄⚅⚅2416060
⚃⚄⚅⚀⚀1716060
⚃⚄⚅⚁⚁1916060
⚃⚄⚅⚂⚂2116060
⚃⚄⚅⚃⚃2312020
⚃⚄⚅⚄⚄2512020
⚃⚄⚅⚅⚅2712020

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.

HandScoreCountPermutationsOdds
⚀⚀⚀⚁⚁711010
⚀⚀⚀⚂⚂911010
⚀⚀⚀⚃⚃1111010
⚀⚀⚀⚄⚄1311010
⚀⚀⚀⚅⚅1511010
⚁⚁⚁⚀⚀811010
⚁⚁⚁⚂⚂1211010
⚁⚁⚁⚃⚃1411010
⚁⚁⚁⚄⚄1611010
⚁⚁⚁⚅⚅1811010
⚂⚂⚂⚀⚀1111010
⚂⚂⚂⚁⚁1311010
⚂⚂⚂⚃⚃1711010
⚂⚂⚂⚄⚄1911010
⚂⚂⚂⚅⚅2111010
⚃⚃⚃⚀⚀1411010
⚃⚃⚃⚁⚁1611010
⚃⚃⚃⚂⚂1811010
⚃⚃⚃⚄⚄2211010
⚃⚃⚃⚅⚅2411010
⚄⚄⚄⚀⚀1711010
⚄⚄⚄⚁⚁1911010
⚄⚄⚄⚂⚂2111010
⚄⚄⚄⚃⚃2311010
⚄⚄⚄⚅⚅2711010
⚅⚅⚅⚀⚀2011010
⚅⚅⚅⚁⚁2211010
⚅⚅⚅⚂⚂2411010
⚅⚅⚅⚃⚃2611010
⚅⚅⚅⚄⚄2811010

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.

HandScoreCountPermutationsOdds
⚀⚁⚂⚃x;x∈{⚁,⚂}10260120
⚀⚁⚂⚃x;x=⚅101120120
⚁⚂⚃⚄x;x∈{⚂,⚃}14260120
⚂⚃⚄⚅x;x∈{⚃,⚄}18260120
⚂⚃⚄⚅x;x=1181120120

Quadruple

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.

HandScoreCountPermutationsOdds
⚀⚀⚀⚀x45525
⚁⚁⚁⚁x85525
⚂⚂⚂⚂x125525
⚃⚃⚃⚃x165525
⚄⚄⚄⚄x205525
⚅⚅⚅⚅x245525

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.

HandScoreCountPermutationsOdds
⚀⚀⚁⚁x6430120
⚀⚀⚂⚂x8430120
⚀⚀⚃⚃x10430120
⚀⚀⚄⚄x12430120
⚀⚀⚅⚅x14430120
⚁⚁⚂⚂x10430120
⚁⚁⚃⚃x12430120
⚁⚁⚄⚄x14430120
⚁⚁⚅⚅x16430120
⚂⚂⚃⚃x14430120
⚂⚂⚄⚄x16430120
⚂⚂⚅⚅x18430120
⚃⚃⚄⚄x18430120
⚃⚃⚅⚅x20430120
⚄⚄⚅⚅x22430120

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.

HandScoreCountPermutationsOdds
⚀⚁⚂xy;x∈{⚀⚁⚂},y∈{⚄⚅}6660360
⚀⚁⚂xy;(x,y)=(⚄,⚅)61120120
⚁⚂⚃xy;x∈{⚁⚂⚃},y=⚅9360180
⚂⚃⚄xy;x∈{⚂⚃⚄},y=⚀12360180
⚃⚄⚅xy;x∈{⚃⚄⚅},y∈{⚀⚁}15660360
⚃⚄⚅xy;(x,y)=(⚀,⚁)151120120

Triple

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.

HandScoreCountPermutationsOdds
⚀⚀⚀xy3920180
⚁⚁⚁xy6820160
⚂⚂⚂xy9720140
⚃⚃⚃xy12720140
⚄⚄⚄xy15820160
⚅⚅⚅xy18920180

Hands with Three Degrees of Freedom

Doubles

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.

HandScoreCountPermutationsOdds
⚀⚀xyz2560300
⚁⚁xyz4460240
⚂⚂xyz6360180
⚃⚃xyz8360180
⚄⚄xyz10460240
⚅⚅xyz12560300

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.

Results

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

ScoreOdds
10
2300
3180
4265
51
6940
710
8355
9330
10741
1180
12915
1340
14620
15791
16405
17100
18760
19140
20296
21140
22160
2330
24105
2521
2610
2730
2810
290
301

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