Thursday 13 June 2013

Some Rainy Day Probability



So I thought I would end this dry spell of posting with a couple interesting pieces of probability, one for warhammer fantasy, and one for 40k.

I'll look at wizards miscasting, and the probability of miscasting given the number of dice rolled for a spell. Often people will throw 6 dice at a spell hoping it will miscast, but do you really know what the odds are when you make that roll? You will now! Hooray!

Luckily a lot of game probabilities are simple enough binomial distributions and as long as you know your chance of hitting, wounding, saving, etc you can determine the likelihood of getting any given number of successes (in Bernoulli statistics there are only successes and failures, which translates excellently to wargaming). Here we consider irresistible force to be a success. 

We know you can't roll two 6s on a single die, and gamers generally know their 2d6 probabilities, so its safe for me to assume everybody knows, with 2 dice, getting boxcars is 1/36 = 2.777...%. I want my formula to work in general,  however, so verifying this will be a good check.

So. To find the probability of rolling a pair of sixes I need to know that the odds of rolling a six on a single die is 1 in 6, simple enough. Instead of working through the complication of finding all the results on 6d6 that have 2 or more sixes, however, it is easier to find the odds of rolling 0 or 1 six, and subtracting that from 1 (or 100%). This works because the probability of every possible outcome summed must add to 1.

If I let x be the number of dice rolled, my formula is P(miscast) = 1 - [ (xC0)(1/6)^0(5/6)^x + (xC1)(1/6)(5/6)^(x-1) ].

I'll break it down. xC0 means x choose 0, the combination function. This tells me all the possible combinations of n succsses in N trials. In this way NCn = N!/(n!*(N-n)!). So xC0 will always be 1, but I thought I would include it to be completely rigorous. I now know how many ways I can choose no dice of 3. I multiply this by the probability that that die rolls a 6, to the power of how many 6s I want, in this case 0. Any number raised to the power 0 is 1, but again I want to be thorough. Then multiply this by the number of dice I want to not be 6s, all three. Do the same for rolling a single six and we get the odds of rolling at most one 6. Subtract this from 1 and we get the odds of rolling at least two 6s. Nice.

Trying it out for 2d6 we get P(miscast on 2 dice) = 1- [(2C0)(1/6)^0(5/6)^2 + (2C1)(1/6)(5/60 ]
                                                                         = 1 - 0.97
                                                                         = 0.02777... or 2.77%
So it works.

Here's the list:
Probability of irresistible/miscast with
1d6 = 0%
2d6 = 2.77%
3d6 = 7.41%
4d6 = 13.19%
5d6 = 19.62%
6d6 = 26.32%

So one in four throws of 6 dice at a spell result in an irresistible/miscast. Good to know I guess.

I also wanted to look at something that was bothering me. Charging in 40k is now random, 2d6. Sure we all know the average is 7, and can be pretty confident in getting off 6" charge. If the target is in cover, however, that is changed to 3d6 dropping the highest die. This one is harder, and I didn't actually know the result. There is a general rule for 3d6 drop the lowest/highest which is to modify the average by 2, up to 9 or down to 5, but I wasn't completely satisfied by this.

I couldn't come up with a simple formula, and had to resort to a counting game. Finding this handy-dandy table was the only thing that made this endeavor possible.

3d6 distribution
So I can count up the results with two 1s in, the results with a 1 and a 2, the results with either 1 and 3 or 2 and 2, and so on. Here it is.
#       %           %>
2      7.41        100
3      12.50      92.59
4      15.74      80.09
5      16.67      64.35
6      15.74      47.69
7      12.50      31.94
8      8.80        19.44
9      5.56        10.65
10    3.24        5.09
11    1.39        1.85
12    0.46        0.46

So, turns out the most common occurring result is in fact 5, and the average is 5.54. Keep your models in 5" and you can play the odds pretty consistently. I know I won't be risking many 6" charges into cover with this knowledge. 

Let me know what you think. I can do more of these, and produce plots and all sorts of fun things, but if it just comes off as douchy then fuck it.

1 comment:

  1. These are so cool, it's interesting to see what effect knowing the math will thoroughly have on strategy. Especially the 40K Charging one.

    ReplyDelete