The La Plata Mountains as seen from above the authorís
            home.


Durango Bill's

"Pig (Pig-out)" Analysis



How to Calculate the Optimal Strategy and Probabilities
for the Dice Game "Pig" (also called Pig-out)



  This page outlines how to calculate the Optimal Strategy and Probability tables given on the Pig Statistics page. It assumes the reader is already familiar with the concept of "Expected Value". The table below is a small section of the probability table displayed in the statistics link. It again shows the percent probability of reaching (or exceeding) 100 in "N" turns for any given score at the start of a player's turn (Recorded Score).


Score at
Start of         <---  Intended Number of turns to reach at least 100  --->
Turn        1       2      3      4     etc.
----------------------------------------------------------------------------
105      100.0   100.0     (All scores at or above 100 have a probability)
104      100.0   100.0     (of 100 percent because you are already there.)
103      100.0   100.0
102      100.0   100.0
101      100.0   100.0
100      100.0   100.0
99        69.4    88.8      These numbers show the probability (in percent)
98        69.4    88.8      that you will reach 100 (or more) in "N" turns
97        69.4    88.8      (Column Headers) given any Recorded Score at the
96        69.4    88.8      start of your turn (leftmost column).
95        68.6    88.2
94        66.9    87.1
93        64.4    85.2
92        61.0    82.6
91        56.7    79.0
90        53.2    75.9
etc.
76        28.9    47.6
etc.
0          0.9     1.9

The question of "Optimal Strategy" usually takes the following form. Given that you know...
       1) The number of turns that you would like to take to get to 100 or more (Col. Headers)
       2) Your recorded score (Score at the start of your turn - extreme left column)
       3) The temporary sum formed by summing your current dice rolls.
Should you add this temporary sum to your old recorded score (giving a new higher recorded score), or should you roll the dice again (and risk losing all your current temporary score and possibly everything)?

   For example: Assume you wish to get to 100 in 3 turns. Also, assume you started your current turn with a recorded score of 76. Finally, you have successfully rolled the dice to accumulate a temporary sum of 14. The Optimal Strategy table shows that you should roll the dice again if your temporary dice sum is 14 or less, but should stop if your total is 15 or more. We will show why you should stop with 15 or more (Optimal Strategy table [Row 76][Col 3]. Then using this strategy we will show how to calculate the probability of success. (Entry that will go in the probability table [Row  76][Col 3]. Also see the above table.)

   If you know the probabilities for the leftmost "N" columns in the probability table, then you can calculate the optimal strategy and probability for any row in the "N + 1" column. In the table above, we know all the values for "Number of Turns = 2" column. We will calculate the "Stop Number" (Optimal Strategy Table) and probability of success for Row = 76 Column Header = 3. This process can be extended by a computer program to include all rows in a particular column. Then it can be extended again to include the next column to the right (and the next column to the right after that, etc.)


Calculating the "Optimal Strategy" for this example

   We first calculate the expected probability to reach 100 using this combination, and then subtract the "quit-now" win probability. If this result is positive, then we should roll the dice. If the result is negative, then we should quit now. For all possible rolls of the dice, we multiple the probability of this roll by the expected win probability found in "Number of Turns = 2" and sum the results.


Indexing below is [Recorded Score + Temporary dice sum + this dice role][Nbr. Turns - 1]

(1/36) * EVtable[76+14+12][2] +    (Prob. roll 12) * 100.0  (Value from table)
(2/36) * EVtable[76+14+11][2] +    (Prob. roll 11) * 100.0           "
(3/36) * EVtable[76+14+10][2] +    (Prob. roll 10) * 100.0
(4/36) * EVtable[76+14+9][2]  +    (Prob. roll 9) * 88.8
(5/36) * EVtable[76+14+8][2]  +    (Prob. roll 8) * 88.8
(4/36) * EVtable[76+14+7][2]  +    (Prob. roll 7) * 88.8
(3/36) * EVtable[76+14+6][2]  +    (Prob. roll 6) * 88.8
(2/36) * EVtable[76+14+5][2]  +    (Prob. roll 5) * 88.2
(1/36) * EVtable[74+14+4][2]  +    (Prob. roll 4) * 87.1
(10/36) * EVtable[74][2]  +        (Prob. 1 die = 1) * 47.6 (EV from old recorded)
(1/36) * EVtable[0][2]             (Prob. snake eyes = restart from 0) * 1.9
= 76.7                        = Percent expected value if you roll dice.
- 75.9                        Minus expected value if you stop now at 76 + 14 = 90
------
   0.8                        = Expected increase in the EV if you roll the dice
                                again when your temporary dice total is 14.


Now let's make a similar calculation if your temporary dice total is one higher at 15.

(1/36) * EVtable[76+15+12][2] +    (Prob. roll 12) * 100.0  (Value from table)
(2/36) * EVtable[76+15+11][2] +    (Prob. roll 11) * 100.0           "
(3/36) * EVtable[76+15+10][2] +    (Prob. roll 10) * 100.0
(4/36) * EVtable[76+15+9][2]  +    (Prob. roll 9) * 100.0
(5/36) * EVtable[76+15+8][2]  +    (Prob. roll 8) * 88.8
(4/36) * EVtable[76+15+7][2]  +    (Prob. roll 7) * 88.8
(3/36) * EVtable[76+15+6][2]  +    (Prob. roll 6) * 88.8
(2/36) * EVtable[76+15+5][2]  +    (Prob. roll 5) * 88.8
(1/36) * EVtable[74+15+4][2]  +    (Prob. roll 4) * 88.2
(10/36) * EVtable[74][2]  +        (Prob. 1 die = 1) * 47.6 (EV from old recorded)
(1/36) * EVtable[0][2]             (Prob. snake eyes - restart from 0) * 1.9
= 78.0                         = Percent expected value if you roll dice.
- 79.0                         Minus expected value if you stop now at 76 + 15 = 91
------
-  1.0                         = Expected decrease in the EV if you roll the dice
                                 again when your temporary dice total is 15.


   Thus we find the expected value increases if you roll at 14, but decreases if you roll at 15. Similar calculations show positive values for all temporary dice totals under 14 while all temporary dice totals above 15 show negative changes in the expected value. Thus the "Optimal Strategy" for this example is to stop rolling the dice if your temporary score is 15 or higher. Now that we know the optimal strategy for row = 76 col = 3, the next task is to calculate the expected success value for this table entry.


   The expected value calculation is much easier if we precompute (e.g in the initialization routine for the program) the following table. Values in each column show the probability of various temporary dice totals provided you are using a strategy of rolling the dice if your temporary sum is less than the column header (the "Stop Number"). We leave this calculation as an exercise for the reader, and just show a small section of the results.



Temporary     <---  "Stop Number"  --->
Dice Total    4        5   etc.     15
--------------------------------------
28        .0000    .0000         .0000     Data is the probability that your
27        .0000    .0000         .0000     temporary dice total will equal the
26        .0000    .0000         .0015     total shown in the left column given
25        .0000    .0000         .0041     that your strategy is to stop rolling
24        .0000    .0000         .0082     the dice if your current temporary sum
23        .0000    .0000         .0143     from rolling the dice is equal to or
22        .0000    .0000         .0229     greater than the column header numbers.
21        .0000    .0000         .0317
20        .0000    .0000         .0422
19        .0000    .0000         .0527
18        .0000    .0000         .0616
17        .0000    .0000         .0670
16        .0000    .0008         .0683
15        .0000    .0015         .0629
14        .0000    .0023         .0000
13        .0000    .0031         .0000
12        .0278    .0316         .0000
11        .0556    .0586         .0000
10        .0833    .0856         .0000
9         .1111    .1127         .0000
8         .1389    .1397         .0000
7         .1111    .1111         .0000
6         .0833    .0833         .0000
5         .0556    .0556         .0000
4         .0278    .0000         .0000
One 1     .2778    .2855         .5116    Prob. of a single "1" at some point.
Two 1's   .0278    .0285         .0512    Prob. of "Snake eyes" at some point.

Note: All columns must add to 1.0000
Calc. hint: Col "5" is just col "4" plus a dice roll if your total = 4

The expected value that will be entered at Row = 76 Col = 3 in the EVtable is thus the following:

.0015 * EVtable[76+26][2]  = .0015 * 100.0  +    You reached 76 + 26 = 102
.0041 * EVtable[76+25][2]  = .0041 * 100.0  +    You reached 76 + 25 = 101
.0082 * EVtable[76+24][2]  = .0082 * 100.0  +    You reached 76 + 24 = 100
.0143 * EVtable[76+23][2]  = .0143 * 88.8  +     You reached 76 + 23 = 99
.0229 * EVtable[76+22][2]  = .0229 * 88.8  +     You reached 76 + 22 = 98
.0317 * EVtable[76+21][2]  = .0317 * 88.8  +     You reached 76 + 21 = 97
.0422 * EVtable[76+20][2]  = .0422 * 88.8  +     You reached 76 + 20 = 96
.0527 * EVtable[76+19][2]  = .0527 * 88.2  +     You reached 76 + 19 = 95
.0616 * EVtable[76+18][2]  = .0616 * 87.1  +     You reached 76 + 18 = 94
.0670 * EVtable[76+17][2]  = .0670 * 85.2  +     You reached 76 + 17 = 93
.0683 * EVtable[76+16][2]  = .0683 * 82.6  +     You reached 76 + 16 = 92
.0629 * EVtable[76+15][2]  = .0629 * 79.0  +     You reached 76 + 15 = 91
.5116 * EVtable[76][2]     = .5116 * 47.6  +     You rolled a single "1"
.0512 * EVtable[0][2]      = .0512 * 1.9         You rolled "Snake Eyes"
-------------------------------------------
                           = 62.0                = The expected value found at
                                                   EVtable[row = 76][col = 3]


Finally, to calculate all the numbers found in the tables in the statistics section, we put all of the above calculations inside the following double loop.

for (NbrTurns = 1; NbrTurns <= 30; NbrTurns++) {
   for (RecordedScore = 0; RecordedScore <= 99; RecordedScore++) {
      do the above calculations;
   }                                 /*  Repeat for all Recorded Scores   */
}                                    /*  Repeat for all Number of Turns   */



Return to Pig Main Page



Web page generated via Sea Monkey's Composer HTML editor
within  a Linux Cinnamon Mint 18 operating system.
(Goodbye Microsoft)