Sugar Pill Games Logo
June 24, 2021

Conditionally Great Expectations

Conditionally Great Expectations image

Getting up to speed

In the previous installment of probability in games, we looked at games where you are allowed to reroll all but one of your previously rolled dice. We also looked at a variation on this idea that utilizes coin flips in place of die rolls. We surprisingly found a optimal strategy in these games strategy that involves reflipping coins/rerolling dice that land on their best side, so that you get more possible flips… until you are down to your last few coins/dice. You can read or review that analysis here.

The game that we’ll finish analyzing in this article involves rolling five customs six-sided dice with sides labelled: FAIL, FAIL, FAIL, PASS, PASS, ACE. The player’s goal is to minimize the number of dice showing FAIL, although each die showing ACE negates a single FAIL when counting this score. After rolling all five dice, the player must choose to set aside one or more dice (to not be rolled again), and then reroll their remaing dice. Play continues in this way until all five dice are set aside, at which point their score is assessed.

The final aspect of this game that I’d like to address in this article is ability for an ACE showing die to negate the penaltiy for a single FAIL showing die. Let’s being with the same approach that we saw in the previous article: to build up expected value tables for increasing numbers of dice that might be rolled on a given turn.

Computing Expected Values… All Over Again

In the case of a single die roll, we have 3/6 faces showing FAIL which correespond to one point each, 2/6 faces showing PASS which correspond to zero points each, and 1/6 faces showing ACE and corresponding to zero points.

E1 = (1/6 * 0) + (2/6 * 0) + (3/6 * 1) = 1/2

We are going to run into trouble using this E1 witin our calculations of E2. But to make that trouble along with a way of handling that trouble more clear, let’s go ahead and construct a table of all possible rolls of two dice. I’ll abbreviate ACE as A, PASS as P, and FAIL as F going forward.

faces chance roll0 roll1
AA 1/36 0 ?
AP 4/36 0 ?
AF 6/36 0 ?
PP 4/36 0 ?
PF 12/36 1 ?
FF 9/36 2 ?

A New Wrinkle

Here’s where our approach from the last article begins to fall apart: we can’t just blindly plug our value for E1 into the roll1 column here (as we did with the coins before). For example, when re-rolling one of two ACEs depicted in the top row, the final score will always be zero because the held ace will negate even a FAIL if it is rerolled. And when re-rollong one of the two FAILs (depicted in the bottom row), it’s possible that an ACE is rerolled to negate the held FAIL and bring the total score down to zero. These kinds of situations will only get more complicated with more dice, so we’ll want to develop some kind of strategy for managing this complexity.

An underlying problem here is that a single E1 expected value does not contain enough information to compute the expected values for hands that include additional dice. This is because those additional dice might include FAILs that are canceled out by later rolls, or ACES that might help cancel out later rolled FAILs. A few people in the BGG Thread initially wanted to counting an ACE as always contributing a -1 FAIL to your score. But the only time we can do this, is when a matching FAIL is showing on a die within the same hand.

One tool that we can use to model and address this is conditional expected values. We’ll compute multiple values of E1 we can choose between based on the number of unmatched FAIL and ACE showing dice in the rest of the hand. I’ll use a kind of function notation for this, where the argument passed to this function is the number of unmatched FAIL faces in the larger hand, minus the number of unmatched ACE faces in that same hand. So E1(-1) is the expected value when rolling a single die within a hand that has one more ace than fail. E1(0) is actually what we computed as E1 above, since accounting for zero additional dice implies that the number of held FAILs and ACEs are perfectly matched. And E1(1) is the expected score that results from rolling a single die within a hand that has one more FAIL than ACE.

E1(-1) = (1/6 * 0) + (2/6 * 0) + (3/6 * 0) = 0
E1(0) = (1/6 * 0) + (2/6 * 0) + (3/6 * 1) = 1/2
E1(1) = (1/6 * 0) + (2/6 * 1) + (3/6 * 2) = 4/3

Note that we can extend this list to other values, but it’s not terribly interesting since a single die can only be matched with a single ACE or FAIL. So E1( any number less than -1: which means more than one unmatched ACE ) will be 0, and E( any number greater than 1: which means more than one unmatched FAIL ) will be that number +1/3.

Rolling Two Dice

Now we can use these conditional expected values to fill in the table that we had trouble with before:

faces chance roll0 roll1 min(roll 0,1)
AA 1/36 0 E1(-1) 0
AP 4/36 0 E1(-1) 0
AF 6/36 0 E1(-1) 0
PP 4/36 0 E1(0) 0
PF 12/36 1 E1(0) E1(0)
FF 9/36 2 E1(1) E1(1)

And we can use this table to compute E2(0) as follows:

E2(0) = (12/36 * 1/2) + (9/36 * 4/3) = 1/2

When two dice are rolled within a hand that has two unmatched aces, the score will always be 0, so E2(-2) = 0. And when there is only one un-matched ACE in that larger hand, the table will look as follows:

faces chance roll0 roll1 min(roll 0,1)
AA 1/36 0 E1(-2) 0
AP 4/36 0 E1(-2) 0
AF 6/36 0 E1(-2) 0
PP 4/36 0 E1(-1) 0
PF 12/36 0 E1(-1) 0
FF 9/36 1 E1(0) E1(0)

This allows us to compute E2(-1) to be:

E2(-1) = (9/36 * 1/2) = 1/8

Here are the tables for E2(1):

faces chance roll0 roll1 min(roll 0,1)
AA 1/36 0 E1(0) 0
AP 4/36 0 E1(0) 0
AF 6/36 1 E1(0) E1(0)
PP 4/36 1 E1(1) 1
PF 12/36 2 E1(1) E1(1)
FF 9/36 3 E1(2) E1(2)

and for E2(2):

faces chance roll0 roll1 min(roll 0,1)
AA 1/36 0 E1(1) 0
AP 4/36 1 E1(1) 1
AF 6/36 2 E1(1) E1(1)
PP 4/36 2 E1(2) 2
PF 12/36 3 E1(2) E1(2)
FF 9/36 4 E1(3) E1(3)

Which we can use to calculate:

E2(1) = (6/36 * 1/2) + (4/36 * 1) + (12/36 * 4/3) + (9/36 * 7/3) = 11/9
E2(2) = (4/36 * 1) + (6/36 * 4/3) + (4/36 * 2) + (12/36 * 7/3) + (9/36 * 10/3) = 13/6

And E2(3) will just be one more than E2(2) since two dice only cancell out a maximum of two FAILs:

E2(3) = E2(2) + 1 = 19/6

Three Dice to Get Ready

In a game with five dice, we only need to consider E3(-2 through +2). To save space, I’ll collapse all of the E3(X) tables together below. The new final column in this table lists the optimal number of dice to reroll, dependent on the condition X which is the number of unmatched FAIL dice minus the number of unmatched ACE dice held outside the three dice being rolled. (Note that in breaking ties for equally optimal reroll choices, the strategy below prefers to roll the maximum number of dice so that our optimal stratgies can be stated more concisely).

faces chance optimal reroll strategies
AAA 1/216  
AAP 6/216  
AAF 9/216 ROLL 1 WHEN X = 2
APP 12/216  
APF 36/216 ROLL 2 WHEN X = 1, or 2
AFF 27/216 ROLL 2 WHEN X = 0, 1, or 2
PPP 8/216  
PPF 36/216 ROLL 2 WHEN X = 0, 1, or 2
PFF 54/216 ROLL 2 WHEN X = -1, 0, 1, or 2
FFF 27/216 ROLL 2 WHEN X = -2, -1, 0, 1, or 2

One way to summarize this optimal strategy is to say that whenvern you entire score is not zero and you have at least one FAIL to re-roll, you should re-roll as many FAILs and PASSes as possible. This table allows us to compute the following conditional expected values:

E3(-2) = (27/216 * 1/8) = 1/64
E3(-1) = (54/216 * 1/8) + (27/216 * 1/2) = 3/32
E3(0) = (27/216 * 1/8) + (36/216 * 1/2) + (54/216 * 1/2) + (27/216 * 11/9) = 217/576
E3(1) = (36/216 * 1/2) + (27/216 * 1/2) + (8/216 * 1) + (36/216 * 11/9) + (54/216 * 11/9) + (27/216 * 13/6) = 26/27
E3(2) = (9/216 * 1/2) + (12/216 * 1) + (36/216 * 11/9) + (27/216 * 11/9) + (8/216 * 2) + (36/216 * 13/6) + (54/216 * 13/6) + (27/216 * 19/6) = 65/36

It’s interesting to note here that E3(1) is less than 1 and E3(2) is less than two. Not only do we get the benefit of extra re-rolls as we saw with coin flips in the last article, but we also have the opportunity to negate some of the held FAILS that that we enter these rolls with. Next, we’ll expand from three to four dice through the following table.

And Four Dice To Go

faces chance optimal reroll strategies
AAAA 1/1296  
AAAP 8/1296  
AAAF 12/1296  
AAPP 24/1296  
AAPF 72/1296  
AAFF 54/1296 ROLL 2 WHEN X = 1
APPP 32/1296  
APPF 144/1296 ROLL 3 WHEN X = 1
APFF 216/1296 ROLL 3 WHEN X = 0, or 1
AFFF 108/1296 ROLL 3 WHEN X = -1, 0, or 1
PPPP 16/1296 ROLL 3 WHEN X = 1
PPPF 96/1296 ROLL 3 WHEN X = 0, or 1
PPFF 216/1296 ROLL 3 WHEN X = -1, 0, or 1
PFFF 216/1296 ROLL 3 WHEN X = -1, 0, or 1
FFFF 81/1296 ROLL 3 WHEN X = -1, 0, or 1

In addition to rerolling as many non-ACE dice as possible when your score is above zero and you have at least one FAIL to roll, you can see that rerolling 3 PASSES with a non-zero score is also part of our optimal strategy with four dice. This follows from our observation above about E3(1) being less than 1 because these extra rolls give us a chance to negate held FAILs.

From the table above we can compute the following conditional expected values:

E4(-1) = (108/1296 * 1/64) + (216/1296 * 3/32) + (216/1296 * 3/32) + (81/1296 * 217/576) = 517/9216
E4(0) = (216/1296 * 3/32) + (108/1296 * 3/32) + (96/1296 * 217/576) + (216/1296 * 217/576) + (216/1296 * 217/576) + (81/1296 * 26/27) = 7375/31104
E4(1) = (54/1296 * 1/8) + (144/1296 * 217/576) + (216/1296 * 217/576) + (108/1296 * 217/576) + (16/1296 * 26/27) + (96/1296 * 26/27) + (216/1296 * 26/27) + (216/1296 * 26/27) + (81/1296 * 65/36) = 368567/559872

All Five Dice

Now we are finally ready to look at that opening roll of all five dice. Since this is all of the dice in the game, we don’t need to worry about additional unmatched ACEs or FAILs, and can focus entirely on the calculations needed to compute E5(0).

faces chance optimal reroll strategies
AAAAA 1/7776  
AAAAP 10/7776  
AAAAF 15/7776  
AAAPP 40/7776  
AAAPF 120/7776  
AAAFF 90/7776  
AAPPP 80/7776  
AAPPF 360/7776  
AAPFF 540/7776  
AAFFF 270/7776 ROLL3
APPPP 80/7776  
APPPF 480/7776  
APPFF 1080/7776 ROLL4
APFFF 1080/7776 ROLL4
AFFFF 405/7776 ROLL4
PPPPP 32/7776  
PPPPF 240/7776 ROLL4
PPPFF 720/7776 ROLL4
PPFFF 1080/7776 ROLL4
PFFFF 810/7776 ROLL4
FFFFF 243/7776 ROLL4

Again we see an optimal strategy of rolling all non-Ace values whenever you have at least one FAIL that can be rerolled. Our final calculation of E5 can now be expressed as:

E5(0) = (270/7776 * 1/64) + (1080/7776 * 517/9216) + (1080/7776 * 517/9216) + (405/7776 * 517/9216) + (240/7776 * 7375/31104) + (720/7776 * 7375/31104) + (1080/7776 * 7375/31104) + (810/7776 * 7375/31104) + (243/7776 * 368567/559872) = 81603277/644972544

What All of these Numbers Mean

And the optimal strategy that appears to hold through out all possibel rerolls in a five die games can be stated as follows. Reroll as many non-ACE dice as you are able whenever you have an unmatched FAIL that can be rerolled, or when you have an unmatched FAIL that is locked and three unlocked dice showing PASS.

To summaries the expected values that we have computed above:

conditional expected score approximation
E1(-1) 0 0.00
E1(0) 1/2 0.500
E1(1) 4/3 1.33
     
E2(-2) 0 0.00
E2(-1) 1/8 0.125
E2(0) 1/2 0.500
E2(1) 11/9 1.22
E2(2) 13/6 2.16
     
E3(-2) 1/64 0.0156
E3(-1) 3/32 0.093
E3(0) 217/576 0.376
E3(1) 26/27 0.962
E3(2) 65/36 1.80
     
E4(-1) 517/9216 0.0560
E4(0) 7375/31104 0.237
E4(1) 368567/559872 0.658
     
E5(0) 81603277/644972544 0.126

I hope you’ve found this analysis interesting. This is probably the most arithmatically intense installment of Probability in Games that I have written to date. So please feel free to let me know, if you find any typos or computation mistakes. And if you’d like to see an analysis of another kind of game, or probabilistic technique, please feel free to let me know.

Have a Question?