Journal Articles

CVu Journal Vol 28, #5 - November 2016 + Programming Topics
Browse in : All > Journals > CVu > 285 (9)
All > Topics > Programming (877)
Any of these categories - All of these categories

Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.

Title: A Commoner’s Response

Author: Martin Moene

Date: 04 November 2016 17:04:20 +00:00 or Fri, 04 November 2016 17:04:20 +00:00

Summary: Roger Orr offers an analysis of the Baron’s last game.

Body: 

I was intrigued by the description of the game Baron M and Sir R were playing in the last CVu.

The strategy for each player is obviously to try and maximise their own score. But the problem is working out how each player should best approach this – it is more subtle than it seems at first sight!

Let’s start with player one and their first roll of the die.

Since half the numbers are 0–4 and half are 5–9 it seems clear that when throwing a number from 0 to 4 first it would be best for them to put this die in the units field and hope that lady luck treats them better on the second throw!

If the first throw is from 6 to 9 the chances are that the second throw will be lower, so it is better to place the first die in the tens.

The hard choice comes if they throw a 5 first. Half the time the next number will be lower, which is bad, but half the time it will be the same or greater. So what’s the best strategy to employ here? It’s not easy to decide, as deferring the choice might improve our chances, so let’s come back to that later.

Player two then faces two different positions depending on whether player one put his first die in the tens spot or the units spot.

In the tens case, it seems simple: play your coin in the tens if it is bigger, and in the units if it is less.

But again the harder decision is what is the best strategy if it is the same – what then?

If the score is from 6 to 9 they’re unlikely to do as well on the second roll, and should play the tens spot, but if they roll a 5 they’re likely to do no worse next time – and might do better. So should they match player one on a 5, or play a 5 in the units and hope to get a higher roll next time? Let’s come back to that question later as well.

If player one has placed his die in the units spot then player two faces the same question as player one did, mutatis mutandis.

Again, if they throw from 0 to 4 they should place it in the units spot, hoping to get a higher score on their second roll, and if they throw from 6 to 9 they should place the die in the tens spot.

Once again, rolling 5 presents them with a more difficult problem.

So we have three questions to answer to decide the best strategy to play this game.

The juxtaposition in CVu of the Baron’s game with the article on ‘Random confusion’ led me to run a simulation to try and see by experiment what happens, assuming a set of fair 20-sided dice (creating these would be no mean feat, I surmise, and would require excellent engineering skills!)

I anticipate it will take experienced players something like 30 seconds to play a single game, counting the coins probably being the slowest part. The gentry may have it differently, but those who work for their living must restrain their dicing habits to the evening or risk ruin. So assuming the two players can manage dice playing continuously from 8pm to midnight we should see what happens after each night’s games, by when about 480 games will have been completed. (Although what with pouring more wine and answering any calls of nature that might occur they might not quite achieve that many games each evening.)

There are three binary choices for strategy options so there are eight possible combinations to try out.

(Although they’re not actually independent choices – if player one always puts a 5 in the units spot then player two never has the opportunity to invoke option 2.)

I ran a simulation of eight nights, running through one set of options on each night.

Option 1 Option 2 Option 3 Player one's winnings (losses)
0 0 0 (822)
1 0 0 476
0 1 0 889
1 1 0 181
0 0 1 (232)
1 0 1 (173)
0 1 1 (114)
1 1 1 (232

But one simulation is hardly enough, let us see what a second eight nights produces.

Option 1 Option 2 Option 3 Player one's winnings (losses)
0 0 0 (114)
1 0 0 (232)
0 1 0 358
1 1 0 299
0 0 1 (173)
1 0 1 476
0 1 1 (645)
1 1 1 63

Oh dear – it doesn’t look very consistent, does it? Perhaps a simulation of a single night’s playing for each option isn’t long enough to be certain of our strategy, dice being the unruly objects that they are.

Let’s see what happens at the end of a whole year of playing:

Option 1 Option 2 Option 3 Player one's winnings (losses)
0 0 0 12,865
1 0 0 2,481
0 1 0 9,207
1 1 0 3,543
0 0 1 17,231
1 0 1 (115)
0 1 1 4,782
1 1 1 (232)

This is looking quite hopeful for player one, but if we run the results for a second year we again see quite a few changes in the results:

Option 1 Option 2 Option 3 Player one's winnings (losses)
0 0 0 4,841
1 0 0 3,897
0 1 0 (2,652)
1 1 0 (1,944)
0 0 1 8,027
1 0 1 (3,773)
0 1 1 9,797
1 1 1 1,714

Let’s assume playing this game does amazing things to the players’ life expectancy and they manage to keep playing for one hundred years. (They’d better also have a very high boredom threshold, and a very large supply of coins....)

Option 1 Option 2 Option 3 Player one's winnings (losses)
0 0 0 10,411,745
1 0 0 1,316,482
0 1 0 10,105,948
1 1 0 1,114,761
0 0 1 7,711,315
1 0 1 (163,061)
0 1 1 8,102,898
1 1 1 (290,737)

Let’s stretch our imagination a bit further and imagine they play for another century (it’s only a simulation, no actual players were harmed getting these results....):

Option 1 Option 2 Option 3 Player one's winnings (losses)
0 0 0 10,052,022
1 0 0 1,558,441
0 1 0 10,105,830
1 1 0 1,407,755
0 0 1 7,739,426
1 0 1 (293,923)
0 1 1 7,865,541
1 1 1 (158,282)

Now we’re getting somewhere that looks a bit more consistent. We’re still getting a fair bit of variation, but the picture is becoming clearer.

Player one should not take option 1; if they throw a five first they should place it in the units spot and hope for a higher roll the second time round.

Given this, player two’s best strategy on option 2 is irrelevant but they should take option 3 as, although in the long term they still lose money, their loss is slightly less.

Conclusion

Using a Monte Carlo method to analyse this sort of puzzle is possible, but you have to run a lot of simulations to get consistent results. However, this is like real gambling where as this simulation showed, even a year of nightly gaming doesn’t produce consistent results!

A quick search of the web on random walks will give some idea of the likely variation after a given number of rounds, and so an indication of the number of rounds you might need to run to get the desired consistency in the results.

Notes: 

More fields may be available via dynamicdata ..