Jonathan Lamontagne-Kratz

A Mathematical Solution To Mississippi Marbles!

Jonathan Lamontagne-Kratz

Jonathan Lamontagne-Kratz

March 20, 2023

Math
Computer Science

Appendix

My family is a big game family. We love every type of game, whether it's Catan, Monopoly, or Flashpoint. We play games all the time, and one of our favourite games to play with a lot of people is Mississippi Marbles. It’s an easy-to-learn game that’s good for everyone, young or old. I am a very competitive person, every game I play I play to win, and so my naturally competitive spirit made me want to win Mississippi Marbles as often as possible. This summer when we were playing, my grandfather and I got into a debate over the probability of certain dice rolls. and on the surface, seems to just be a game of chance This debate got me interested in the math behind the game and had me wondering what the best strategy would be for the game. I was unable to find any strategies online and very little on the probabilities of the rolls for the game, and so because of this, my goal for this internal assessment is to mathematically solve Mississippi Marbles. In other words, using mathematical concepts to find the best strategy for the game will theoretically result in the highest chance of winning.


First, it is important to have a good understanding of the rules, which can be found here.


To find the most optimal strategy to win,  I will find the probabilities of all possible scoring rolls and their expected values. From this, using basic game theory, I will determine when someone should choose to stop rolling or keep rolling and pass the dice. For this investigation, I will be using 5 decimal places for probabilities, and percent difference, for ease but also so that my probabilities will sum to 1.00000. I will use the nearest whole number for scores because there can be no fractional scores. And I will use 3 significant figures for all other values.


First I started by calculating the probabilities of all the scoring possibilities for a single roll for each of the dice counts.

I started by calculating the probabilities for one die using the basic math equation:

E(X) = Xp

Where X is the resulting score of a success

and p is the probability of success

For example, for one die, the only scoring options are one 1 or one 5. There is a ⅓ or 0.33333 chance of rolling a 1 or a 5 with one dice, and the score for this would be 100 or 50, these have equal probabilities, so we can put the value of a 1 or a 5 at 75 points. The expected value can now be calculated using the above equation as shown below:

E(75) = 7513 = 25

Since this data will be displayed in tables for other dice numbers I have put it in Appendix A.


We can use the cumulative probability of the possible outcomes to make sure we have accounted for all possible outcomes, as this should add to 1.00000. As seen in Appendix A the probabilities add to 1.00000.


With two dice this was a little harder. Instead, I used a binomial distribution to calculate the probabilities. This is applicable because we know the number of trials (the number of dice) and the number of trials is fixed and each observation is independent and has only two outcomes. This is better for this number of dice because there are no special scoring possibilities here like three-of-a-kind or a straight. The possible dice values along with their average scores are shown in the table below.

Blog Post Image

As previously stated the probabilities can be calculated using a binomial distribution as shown below:

Blog Post Image

Doing this for the other possibilities gives the results shown in Appendix B.


Here we can see that we get an expected value of 50 for two dice. This can be done for three dice and produces the results seen in Appendix C.


There are a few important things to note here. The probability of “three 1s or 5s” overlaps with the probability of “three 1s” or “three 5s”, in other words, 555 would count for “three 5s” and for “three 1s or 5s”. This means that we need to account for all these combinations that are double-counted. So to account for this I calculated the probability of “three 1s or 5s” using a binomial distribution similar to the one shown above and then subtracted the probability of “three 1s” and the probability of “three 5s”. This has to be done because, for example, any rolls that are not three-of-a-kind are scored differently, so they should be calculated with the value, whereas any rolls that are three-of-a-kind have a set score, for 1 and 5 this is 500 points. All possibilities that are 1s or 5s, will not include special scoring options like three-of-a-kinds or straights. These results show that the expected value for three dice is 84.5 points as seen in Appendix C.


When I tried to use binomial distributions for four dice the math got much more complicated, as many more overlaps had to be taken into consideration. For example, you could get “two 1s, one 5, and one 4” this is not the same as a “three 1s and one 4”, which are scored differently but would be considered the same as “three 1s or 5s” in a binomial distribution approach. Furthermore, “three 1s or 5s” does not include “three 1s” but a binomial distribution method would need to take account of this overlap in probabilities. I found my probabilities were often prone to error as they did not add up to 1.00000. I attempted this method for both four and five dice, but it took an enormous amount of time and had many errors. It was far too much work for six dice. Instead to be safer and more confident in my results I used a combinatorial approach. This approach looks at the possible configurations for dice rolls. For example, in the first example, two 1s, one 5, and a 4 would become XXYA where X and Y are a 1 or a 5, but not the same, and A is another non-scoring number. The second example would become XXXA. This approach allows us to generalize and makes calculating expected values and probabilities much easier and more efficient. Because this method is a little easier and allows for better error checking as you can check for more specific combinations. I also did it for two and three dice (one die is not necessary as there is only 1 scoring combination).


The scoring combinations for four dice can be seen below.

Blog Post Image


From this, first, we need to calculate the possible meaningful rearrangements of the dice. For example, the first possibility is XABC. The X could go in any of the four positions, so it has possible arrangements of 4C1 then after that the A has three possible positions so it has 3C1 and so on.

Then we calculate the possible dice values for XABC. X has two possibilities, 1 or 5, and ABC has 4C3 as there are three dice, but four possibilities for each dice, but each dice must be different. We use a combination here because for example if A was a 6, B a 4, C a 3, and D a 2 it would be the same as if A were a 2, B a 3, C a 4, and D a 6. After this, we multiply the rearrangements by the possible dice values and get the total number of ways that that combination could occur. Then we divide this by the total possibilities for that number of dice, four dice being 64=1296. Dividing the total possibilities for a given combination by the total number of possibilities for that dice amount gives us the probability of that combination. This can be seen in Appendix I.


To get the probability of one 1 or 5, we add the probability of all values with only 1 X or Y, that would not overlap with other areas, for example, note that XAAA is one 1 or 5 and three-of-a-kind (not “three 1s” or “three 5s”). This means it will have its own row in the expected value table. The expected value table can be seen in Appendix D.

Note that for four 2s which would lose all points, I took the average points that would be in the middle of a game or 6500, but a player should factor in their points at the time for the best results.


The same method was repeated for five and six dice. The combination tables can be seen in Appendix J and Appendix K and the expected value tables can be seen in Appendix E and F.


Something to note for five dice if you have “five 1s or 5s” you are bound to get at least 1 three-of-a-kind so it will be counted under a new row which accounts for this.


Next, I did statistical trials for the single roll probabilities using Python. The code for the program can be seen in Appendix L. For the single roll expected values, I coded statistical trials for the results to compare. I had the program do 10 million trials for each dice count (10 million single rolls each, for a total of 60 million rolls). The results can be seen below:

Table 1:

Blog Post Image


I noticed that for six dice it was higher than the expected result so I decided to collect data on how many times one 1, two 1s, three 1s, etc were rolled. I then compared the data to the theoretical percentages I had calculated prior and double-checked everything using the OmniCalculator for dice odds, a sort of third-party verification (Sas, Wojciech). I found that all my probabilities were correct. I also ended up calculating the combinations for one and two dice in Appendix G and Appendix H. I calculated the percent difference from my trials to my theoretical results using the equation:


Blog Post Image

and got the results shown in Appendix M.


I noted only a few significant percent differences, notably the ones for six of-a-kind which had significantly fewer successes and so was more off. However, this does not seem to explain why the expected value was lower than the results because there were fewer six-of-a-kind than expected.


Next, I calculated the expected value if a player were to roll until they busted. The previous calculations were only for a single roll, meaning that they were the odds for rolling the dice and then passing them, they did not account for setting aside our scored dice and then rolling again. We can account for this by including the expected value of the remaining dice after a roll in the score for that roll. In other words, dice rolls that result in one die remaining will have the expected value of one die added to their scores, effectively accounting for continued rolling (instead of just one roll). The equation for the expected value is now:

Blog Post Image


These values will recursively affect each other, as every roll has a chance of leading to all other rolls, increasing the expected values. Because of this expected value will approach a limit.


For this limit, I used a spreadsheet, the final resulting tables of the spreadsheet can be seen in Appendix P, Appendix Q, Appendix R, Appendix S, Appendix T, and Appendix U, for one-six dice respectively and added the expected values of the remaining dice to the score for that roll. For six dice, when plugging in the expected values of other dice counts it resulted in an error because Google Sheets does not allow recursion or infinite loops. To fix this I plugged in the expected values manually updating them until the 3 significant figures of the expected value no longer changed. The new expected values can be seen in the table below:

Table 2:

Blog Post Image


I checked these with statistical trials using Python, the code can be seen in Appendix N. Ten million trials were done for each of the different dice counts.  The results of the trials can be seen here:

Table 3

Blog Post Image


I noticed that all the average scores were slightly lower than expected. After noticing this, I double-checked all probabilities and made sure there were no flaws in the program by manually checking 600 sample rolls (to completion), the sample rolls can be seen in Appendix O. I suspect that whatever caused my values for six dice for single rolls to be off caused these inconsistencies. However, because the difference is generally minimal it should have little effect on the optimal strategy, as the difference between 564 and 573, for example, is too small to affect what the optimal strategy should be as you can only score in intervals of 50 or above.


The next question I had was whether or not to keep “three 2s” and other possibly subpar rolls.  We can see that three 2s have the second lowest score per die other than rolling one or two 5s. I decided to check when we should keep “three 2s” and 5s.


It is obviously good to collect all the dice, so we do not need to check what we should keep when we can collect all six dice. Additionally, when there is a choice between two dice and one die we should always choose to go to one die, since the expected value is higher, and two dice give us no additional scoring options. I checked all the likely combinations that might improve the expected value and compared these to the previous results using the same spreadsheet as before. To do this I changed the expected value of the remaining dice to what would be remaining if you took only the useful dice, changed the score value to the score for the dice that were kept, and then compared this to the previous expected value to see if it was improved. For example, for “three 2s and one 1” and six dice, I changed the expected value of the remaining dice to the expected value for five dice, and then changed the score of the roll to 100 instead of 300.


Doing this we find that, with one- four dice you should always keep every point. At five dice, if you roll a 1 and a 5 just keep the 1, if you roll two 5s just keep one of them, and if you roll two 5s and a 1 only keep the 1.


With six dice, keep as few fives as possible when you have only 1s and 5s as scorers (no three-of-a-kind etc). Skip three 2s if you have only a 1 or a 5 as well. If you have two 1s or 5s, keep the three 2s as well. Otherwise take all the dice you can get. The expected values for the improved strategy can be seen in the table below:

Table 4:

Blog Post Image


Next I decided when to figure out when to stop rolling. So far I have found the expected values for all the dice values and which dice combinations we should keep and which we should pass on. However, this does not fully encapsulate the game. When you are playing, you do not roll until you bust otherwise you would never score any points. So for an optimal strategy stopping score must be determined, so that we know when we should pass the dice. The stopping score should be any value higher than our expected value for six dice, as this means we have an above-expected score and should cash in on this. However, the game is slightly more complex than this. If we were playing completely by ourselves this would be fine, but we have to account for the score that we pass on to our neighbour. However, before taking this into account let’s calculate when we should piggyback.


We can also use these values to determine when we should roll with six dice, or piggyback off our neighbour. If the value they are passing us plus the expected value of the number of dice they are passing us is greater than the expected value of six dice, then we should piggyback. Otherwise, we should roll with six dice. For example, if our neighbour passes us 400 points with two dice, this is greater than the expected value of ~218 (Table 4) so we are expected to do better than if we just rolled six dice (an expected value of ~605). Doing this I calculated the score which we should piggyback on. The results of these calculations can be seen below:

Table 5:

Blog Post Image


Now I decided to figure out when we should pass the dice to our neighbour. If we get optimal rolls every time and stop when we are above the expected value, our neighbour might benefit more than us using the dice we pass on. For example, passing 600 with six dice is higher than our expected value with six dice, so presumably, we should stop, however, this is way better for our neighbour as they are expected to score another 605 (Table 4) on top of that we should not pass the dice. But when should we pass the dice?


This can be done by looking at the number of dice you are passing, and the score you are potentially passing to your neighbour. We can multiply the score that we are passing by the chance that our neighbour does not bust, and if this is higher than the score we are gaining from passing the dice, we should consider not passing depending on the placement of our neighbour in the rankings of the game. If the score we pass to our opponent is enough to end the game we probably shouldn’t pass the dice, as we would not get another turn and the game would end. If we are way ahead in the game, we can probably be more lenient on this and pass as long as it is not too beneficial for our neighbour, especially if it brings us much closer to winning.


By finding when the score you are holding is higher than the expected value of the neighbour you are passing the dice to, we can find the score at which a player can pass the dice and assume that they will statistically score more points than their neighbour. The results can be seen in the table below:

Table 6:

Blog Post Image



Some things to note, you can never score less than 150 with one die remaining or less than 300 with two dice remaining so you should always pass. These values are also lower than the expected value of 605 calculated in Table 4, so we should continue rolling anyways. With six dice, the number you are passing is more than the number to end the game, so you should never pass all 6 dice. All scores are the minimum score you can pass.


So according to my calculations, the final strategy is as follows. Always pass the dice with one die and two dice if you are higher than 600 points, 700 points when passing three dice, 1900 points when passing four dice, 5500 points when passing five dice, and never when passing six dice, unless your neighbour is very far behind and you will win the game by logging your points. Piggyback if the score passed to you is greater than or equal to 400 points when receiving one die and two dice, 350 points when receiving three dice, 250 points when receiving four dice, 150 points when receiving five dice, and always when receiving six dice. Keep everything except for when you have five or six dice. For five dice, if you roll a 1 and a 5 just keep the 1, if you roll two 5s just keep one of them, and if you roll two 5s and a 1 only keep one 5. With six dice, keep as few fives as possible when you have only 1s and 5s as scorers (no three-of-a-kind etc). Skip three 2s if you have only a 1 or a 5 as well. If you have two 1s or 5s, keep the three 2s as well. Otherwise take all the dice you can get.


There are however a few flaws to this strategy. This strategy does not account for our neighbour passing the dice if they get a successful roll. This strategy works, assuming that everyone else is trying to benefit only themselves, and doing a good job of it. Since your actions in the game affect yourself, and mainly only your neighbour (though it can go down the line), this means that people across the table from you may be passing their neighbour's incredible rolls, and thus are scoring higher than expected values of rolls. An extreme case might be that someone always passes with five and six dice, giving their neighbour a significant advantage, there is probably little that can be done about this, although it may be beneficial to consider this and alter the play, maybe if everyone else is passing dice often, it will be optimal for you to do the same. A future investigation might ask if it is better for you to only pass the dice when it benefits you more than your neighbour, or if it is better to have your neighbour possibly benefit slightly more than you, but for you to also benefit. Collectively you would both benefit significantly more than the other players in the game, but this strategy might give your neighbour such an edge that they win more games than you do!

If I were to work further on this I think that I would 1 try and take these flaws into account in my strategy. I would also try to pit this against other strategies. For example, how would this compare to a player who passes any time they get to 2 dice, or a player that always rolls the dice passed to them or someone playing a less optimal strategy but with a neighbour that passes them really good scores? I would also consider trying a strategy based on machine learning, as I think that might come up with a near-optimal strategy and it would also be able to account for sub-optimal play. Another thing I would work on is trying to figure out why my theoretical values differed from my statistical trials. I might also try to do trials on some of the other theoretical results I collected like my optimal strategy for example. I would also look at the strategies for the end of the game, as I think that this is more of a grey area as there are larger gaps in scores, so maybe it would be better to score points and pass it to a neighbour who is far behind than risk busting. I would also look at when you should pass a roll that could potentially end the game if your neighbour succeeds.

Add better layout and tables
Comments section?