Wednesday, July 18, 2012

1-4-24 (Midnight)

How to play

Midnight is played with six dice where the objective is to get the highest score. Someone starts by rolling six dice. On each roll, you are required to keep at least one of your dice, and you re-roll the remaining ones. You do this until all six dice have been kept. So at most you will roll six times.  For example, you can choose to keep anywhere from one to six dice on the first roll. If you kept two of them, then you'd re-roll the remaining four dice, and you can choose to keep one to four of them. And, so on...

The sum of the six selected dice becomes your score, with one caviat: you must qualify the hand by rolling a one and a four. Therefore a maximum score is twenty-four by rolling 1-4-6-6-6-6, and a minimum score is zero by not qualifying.

When beginning, the order is determined randomly. After a round has been played, the lowest score goes first and the highest score goes last. Clearly, going last has the advantage due to the ability to know when to simply just stop trying for a  higher score while taking on the risk of getting a lower one. Say the first person scores an 8. And, as the 2nd player, your very first roll is 1-4-6-5-1, you can simply stop right there and claim a win with a score of 12.

For a three, four, or more player game, only a single distinct winner can win the pot. So, say in a four player game, two people score 18, one guy scores 15, and another scores a 13. Since there is no distinct winner due to two best scores tying, there is no winner this round. All players ante up again, building the pot. All players are still in the game, and therefore, are eligible to win. You play until there is a single distinct winner, who scoops.


Is there an optimal strategy for this game? If so, what is it?

Basic Strategy: Maximizing the Expected Score

A good place to start is to understand what score to expect when playing the game with $N$ dice. To begin, lets assume there is no score with which to beat and that there is no qualifier. Given these assumptions, our objective is quite simple: maximize our expected score at every decision. Like Threes, such an analysis is certainly best done in reverse.

Suppose we are playing with only one die where $D \in \{1,2,3,4,5,6\}$. We will assume that all dice are fair, so $P(X=x)=\frac{1}{6}$. The expected score of rolling one die, $i$, is

$E_{1}=\frac{1}{6}\sum_{i=1}^{6} i $
$E_{1}=\frac{21}{6}=3.5$

Suppose we are playing with two dice, $i$ and $j$; rearrange them so they are in descending order and call them $d_{1} \geq d_{2}$. The rules require that we keep at least one, so clearly we keep $d_{1}$. The questions is whether to keep $d_{2}$. If we don’t keep it, our expected value from it will be 3.5 when we re-roll. Hence, we should keep $d_{2}$ if it is a 4, 5, or 6. Following this method, the expected value of our score when we play with two dice is expressible as

$E_{2}=\frac{1}{6^2}\sum_{i,j=1}^{6} d_{1}+max(d_{2}, E_{1})$
$E_{2}=\frac{593}{72}=8.236\overline{1}$


Suppose we are playing with three dice, $i$, $j$, and $k$; sort them and call them $d_{1} \geq d_{2} \geq d_{3}$. We must keep $d_{1}$, so we need to decide whether to keep either of the other two dice.  If we keep both $d_{2}$ and $d_{3}$, our score is $d_{1}+d_{2}+d_{3}$. If we re-roll only $d_{3}$, then our expected score is $d_{1}+d_{2}+E_{1}$. If we re-roll both $d_{2}$ and $d_{3}$, then our expected score is $d_{1}+E_{2}$. Thus we want to choose the option with the highest expected score. The expected value of our score when we roll three dice is expressible as

$E_{3}=\frac{1}{6^3}\sum_{i,j,k=1}^{6} d_{1}+max(d_{2}+d_{3}, d_{2}+E_{1}, E_{2})$
$E_{3}=\frac{26098}{1944}=13.42490...$

Continuing on in this fashion, The expected value of our score when we roll four dice is

$E_{4}=\frac{1}{6^4}\sum_{i,j,k,l=1}^{6} d_{1}+max(d_{2}+d_{3}+d_{4},\ d_{2}+d_{3}+E_{1},\ d_{2}+E_{2},\ E_{3})$
$E_{4}=18.84364...$


(I stop here because, in reality, we will be qualifying two of the dice.)


Given the expected scores of playing with $N$ dice, we have encoded above a basic strategy which is optimal for a game of Midnight with four dice where we have no score to beat and there is no qualifier. Unfortunately, it is a tricky strategy to paraphrase and is not a simple statement summarizable to a "this die or more should always be kept on roll $r$" simplicity. However, a simplification to the strategies outlined above can be made by noting that 1) sixes should always be kept and 3) the $E_{N}$ values that appear above can be replaced by their integer parts for easy memorization (for example a sum of integers is greater than $3.5$ only if the sum is greater than or equal to 4). Incorporating the qualifier into the strategy is quite simple: roll and keep either one qualifier, both qualifiers or the single highest die until the hand is qualified then follow the above strategy. Now we have an optimal way to play Midnight when going first.


A simulation of 1000000 games using this strategy has the following distribution of scores

---------------------------------------------------------------------
 X    PDF                             CDF
---------------------------------------------------------------------
  0   0.043242 XXXXX                  0.043242                     
  7   0.000011                        0.043253                     
  8   0.000054                        0.043307                     
  9   0.000185                        0.043492                     
 10   0.000666                        0.044158                     
 11   0.001940                        0.046098                     
 12   0.004907                        0.051005 X                   
 13   0.010342 X                      0.061347 X                   
 14   0.020015 XX                     0.081362 X                   
 15   0.033875 XXXX                   0.115237 XX                  
 16   0.051430 XXXXXX                 0.166667 XXX                 
 17   0.074744 XXXXXXXXX              0.241411 XXXX                
 18   0.100089 XXXXXXXXXXXX           0.341500 XXXXXX              
 19   0.125422 XXXXXXXXXXXXXXX        0.466922 XXXXXXXXX           
 20   0.150675 XXXXXXXXXXXXXXXXXXX    0.617597 XXXXXXXXXXXX        
 21   0.157373 XXXXXXXXXXXXXXXXXXXX   0.774970 XXXXXXXXXXXXXXX     
 22   0.126293 XXXXXXXXXXXXXXXX       0.901263 XXXXXXXXXXXXXXXXXX  
 23   0.071532 XXXXXXXXX              0.972795 XXXXXXXXXXXXXXXXXXX 
 24   0.027205 XXX                    1.000000 XXXXXXXXXXXXXXXXXXXX
---------------------------------------------------------------------
<X> = 18.68492

Fortunately, we do not always need to go first, so sometimes our objective is different than simply maximizing the expectation. Sometimes we have to take chances (and get lucky) because we have a score to beat. This is easy to see if we add a little more information to our example. Imagine you are rolling second with a score of 20 to beat and you have an opening roll of 1-4-3-5-5-6. Keeping all the die because $3+5+5+6 > E_{4}$ would guarantee you a loss.

So what is the best play? The answer is, it depends...

[coming soon, 1-4-24 (2)]

No comments:

Post a Comment