Tuesday, December 18, 2012

Win at Risk using Monte Carlo simulations

The objective in Risk is simple: world domination. In this board game, players attack each other's territories using dice. The attacker gets to roll three dice, and the defender two dice. The highest numbers are compared, and if the attacker has a larger number the defender loses one soldier (and vice versa). The same is done for the second highest numbers. For example, if the attacker rolls 6, 4, 2 and the defender rolls 5, 5, players loses one soldier each.

However, even though the attacker rolls an extra dice, the defender has an edge as well. In the event of a tie, the attacker will lose one soldier. Is this enough to offset the attacker's 3-dice advantage? What does this mean for rolling strategies?

With 5 dice, there are 7,776 possible number combinations. Clearly, listing every single one down would be quite tedious. Instead, I used Excel to simulate 10,000 dice rolls using a random number generator. I then calculated the "expected net wins for the attacker", which is simply:

Soldiers lost by defender - soldiers lost by attacker

This is expressed as the average for every 100 rolls.

The results are shown below. First look at the top-left corner, which is the typical case where the attacker rolls 3 dice, and the defender rolls 2 dice. While both the attacker and defender will lose some soldiers, the defender will lose 7.5 more soldiers for every 100 rolls. What this means is that the defender loses on average, so it pays to be offensive in Risk. It looks like the 3-dice advantage does outweigh the defender's edge in winning ties!

Expected net wins for attacker (per 100 rounds)
Defender rolls 2 dice
Defender rolls 1 dice
Attacker rolls 3 dice
7.5
31.6
Attacker rolls 2 dice
-22.3
15.9


However, the defender also has the option of rolling one dice, instead of two. Players sometimes do this, for example when there are only 2 or 3 soldiers left in the territory. Does this raise the defender's odds of winning?

This turns out to be a lousy strategy. Here, the defender loses even more soldiers - 32 more than the attacker for every 100 rounds, much more than the 7.5 earlier. Hence, the defender should never use 1 die, unless forced to (i.e. only one soldier left).

Lastly, the attacker might sometimes be down to two dice, when he only has three men left. Should he continue attacking, or wait for reinforcements? The answer to this is "it depends". Firstly, if the defender has two dice, the attacker is at a disadvantage, as he loses 22 men more than the defender (again, per 100 rounds). Secondly, if the defender is down to 1 die, the attacker maintains his edge as the defender loses 16 more men than the attacker. Hence, the attacker should only use 2 dice when the defender uses 1 die. 

In a nutshell, attack when you have more dice than the defender, and defend with as many dice as possible. Enjoy La ConquĂȘte du Monde!


Afternote: it turns out that the simulation gets results very close to the theoretical one, shown below.

Expected net wins for attacker (per 100 rounds)
Defender rolls 2 dice
Defender rolls 1 dice
Attacker rolls 3 dice
7.9
31.9
Attacker rolls 2 dice
-22.1
15.7

No comments:

Post a Comment