Calculate single "battle" outcome odds for RISK

1k Views Asked by At

I am trying to reproduce the values in this odds ratio table from Wikipedia.

For all those unfamiliar with RISK, this is a game where units fight against each other via the roll of the dice:

  • The attacker may roll up to 3 dice and the defender may roll up to 2 dice.
  • The best 2 dice of the attacker are paired with the 2 dice of the defender (top die vs. top die and second die vs. second die)
  • In case of a tie the die of the defender is considered to have won
  • Each player loses the amount of units corresponding to die pairs which were not in their favor.

I am trying to sum this up as a formula, but the best I could come up with was writing out all of the possible combinations and there are quite a few.... could you help me out?

Edit:

In the mean time I have written an exhaustive lookup script and managed to find formulae for the cases where either the attacker or the defender only throws one dice (see detailed info on this on my blog). But I still was unable to get concise mathematical expressions for e.g. 2v2 or 3v2 cases. Can you help me out?

1

There are 1 best solutions below

4
On

This is a problem that can be solved recursively. We start by finding the values in the top left corner and work our way outward as follows. Let me introduce some notation that I completely made up: $P(W|[n,m]) = $probability attacker wins battle given attacker has n armies and defender has m armies.

Define $P(R|[k,l]) = $probability that the attacker completely wins a roll (i.e. knocks the guy down by one or two armies, depending on number of dice rolled) given attacker has $k$ dice and defender has $l$ dice.

Define $P(T|[k,l]) = $probability that both sides lose one army for a given roll.

Just to make it easier for us, define $P(L|[k,l]) = $probability that attacker completely loses a roll.

Then we first find $P(W|[1,1]) = P(R|[1,1]) = .4167$, trivially.

Then $P(W|[1,2]) = P(R|[1,2])*P(W|[1,1]) + P(T|[1,2])$

We can continue onward, and generalize:

$P(W|[n,m]) = P(R|[n,m])*P(W|[n,m-2]) + P(T|[n,m])*P(W|[n-1,m-1]) + P(L|[n,m])*P(W|[n-2,m-1])$

Now, in order for this formula to work, we need to define $P(W|[0,m]) = 0$ and $P(W|[n,0]) = 1, $ for $m,n > 0$. The formulas for $P(R|[n,m])$ and other dice rolls are pretty easy to calculate. To compute all of these, I'd recommend using a computer and programming into it the rules for number of dice rolled for two given army sizes. Then, you can compute the table with the dice probabilities, save that as a constant, and traverse through the table from the top left outward. The key is to compute them in layers of $m + n$, i.e. first do $m + n = 2$ (just the case of m = n = 1), then do $m + n = 3$, etc. This sort of thing is typically referred to as dynamic programming and is actually quite easy to implement.

Hope that's helpful!