Jump to content

Using the Binomial Distribution in 40k


Reinholt

Recommended Posts

Preface

 

I've read quite a bit about mathhammer over the years that I've been playing this game, and as someone with a formal background in both statistics and strategy, I thought I'd finally sound off on how I think about statistics and the role they play in the game for me. In general, I worry that people are overly reliant on statistics, and that they are computing the wrong ones (and I'm saying this as a statistics person!).

 

There are a some key reasons for this:

 

1 – Computing odds will never tell you what to do; it will just tell you what the possibilities are if you do something.

 

2 – Building models of unit behavior is actually extremely non-trivial, as there are many factors that need to go into any mathematical analysis. Missing any of these can have catastrophic results on the conclusions of the model. Don't believe me? Ask the guys who were pricing mortgage backed securities for the past few years.

 

3 – Evaluating any unit or attribute in isolation, or in only a limited set of circumstances provides an incomplete picture. With that said, you obviously can't crunch infinity possibilities with computational brute force, so one should always keep in mind that the results are, in the end, quite limited and act in accordance with that principle.

 

By now, I probably have a few people nodding, a few people scratching their heads wondering where I am going with this, and at least three people upset I have mentioned math who already closed the thread. So what I'm going to do is attempt to explain how I use statistics to conceptualize unit behavior, and a few tricks I've developed over time.

 

Part I – What does the mean mean?

I see a lot of computations that run something like this: “Well, firing at other marines, with a bolter at 12” or less, I would expect to see 2 * 2/3 * ½ * 1/3 casualties (shots * chance to hit * chance to wound * chance they fail their armor save), or roughly .22 casualties.”

 

Well, that's great, and it's also true. But it's not complete. I've always felt it's important to have a sense of what the complete probabilistic space for any weaponry looks like, and to do that, the computation is not so trivial.

 

One can conceptualize any attack as a binomial trial. For those unfamiliar with the binomial distribution, you can probably google it and find a decent explanation, so I'll basically just give a brief summation of what goes on here. All binomial processes can be parameterized with three variables:

 

Number of Attempts (I will call this n)

Odds of success (I will call this p)

Number of Successes (I will call this k)

 

There is then a really convoluted formula (if you like pain, it's this: (p^k)*(1-p)^(n-k)*(n!/(k!(n-k)!)) ) that you can use to compute the odds of any particular number of successes occurring with n attempts and p odds of success.

 

So that's great, and it's possibly enough to make your head hurt. But what does it mean? It means that for our humble marine with a bolter, we can actually compute the direct and complete odds of all three outcomes that could plausibly occur. There are three options:

 

0 kills - .79

1 kill - .2

2 kills - .01

 

You will also notice that if we take the average of these (.79 * 0 + .2 * 1 + .01 * 2) we get .22, which was our average from above. But here we have more information. Basically, we know that about 4/5 of the time we will kill nothing, that 1/5 of the time we will kill one guy, and that while it's theroetically possible to kill two guys, you might not want to hold your breath waiting for it.

 

Now this result is mildly amusing for a single bolter shot, but the method can also can speak to a much more important question: what is the range of possibilities when an entire squad is shooting?

 

As an example, rapid firing 20 bolters (assuming we're all morons and incapable of taking special weapons or heavy weapons, but we'll get to that later) into a unit of marines would net the following result:

 

0 kills - .09

1 kill - .24

2 kills - .28

3 kills - .21

4 kills - .11

5 kills - .04

6 kills - .01

7 or more kills – less than .01

 

So, in short, you're most likely to kill between 1 – 3 guys (no shock, as .22 * 10 = 2.2, which would have been our mean here), but you can see that you should expect your effective kill range to vary anywhere between 0 and 5 when you open fire.

 

This is, at least to me, much more useful information. I try to never count on anything in particular happening, but rather want to have a range of possibilities I would expect to happen and thus not be surprised by. It's important to know that about 1/10 of the time, you aren't killing a damn thing when you rapid fire 20 bolters at marines. It's just as important to know that if you want to wipe out an entire squad, you're going to need at least two full squads of your own shooting at them, and probably significantly more.

 

It's even more important to realize that you really don't want to do these computations by hand, and that you definitely cannot do them in your head, and so knowing these things beforehand is probably quite preferable to irritating your opponent by having a laptop open and crunching numbers in excel (or open office calc) during a game. Personally speaking, I'll usually crunch the numbers for my entire army shooting at various opponents, and scribble the key notes down on a 3x5 card or 8x11 sheet I'll keep with me when I play for reference.

 

Part II – Combinatorics Strikes Back

 

Now, let's assume we're not morons who put only bolters in our squads, and ask a much more realistic question to make things very interesting very fast.

 

“Okay, Reinholt, if you're so smart, let's say I have a tactical squad with one multi-melta, one plasma gun, and one sergeant with a power weapon and a bolt pistol that just jumped out of a rhino, and they are going to rapid fire a chaos space marine squad in 5+ cover. What can I expect?”

 

First, we need to realize what we are actually shooting with: 2 bolt pistols (the multi-melta moved, so it's not firing at a damn thing this turn), 7 bolters, and 1 plasma gun. The bolt pistols get 1 shot each, the bolters get 2 shots each, and the plasma gun gets 2 shots, so our net result is 16 bolter shots and 2 plasma shots.

 

To compute our probability, we know from earlier that our chance to kill a chaos space marine with a bolter is (2/3)*(1/2)*(1/3), and additionally, our chance to kill a chaos space marine in 5+ cover with a plasma gun is (2/3)*(5/6)*(2/3). Thus, we have the following two sets of probabilities:

 

16 Bolter Shots

0 kills - 0.15

1 kill - 0.30

2 kills - 0.28

3 kills - 0.17

4 kills - 0.07

5 kills – 0.02

6 or more kills – less than .01

 

2 Plasma Gun Shots

0 kills - 0.40

1 kill - 0.47

2 kills – 0.14

(Additionally, chance to blow oneself up is about 10.5%, just for reference)

 

Now, there's a quick way to compute the combination of the odds and get it approximately right (weighted average chance of success for combined shooting, which means taking 16 bolter shots * probability of success + 2 plasma shots * probability of success and then dividing that by 18 (total shots) to get your p for a binomial function) or a long way to compute the combination of the odds (using a matrix to actually literally compute each possibility, which is not too bad with two weapons, but gets ugly fast with about six or seven different types of guns firing), but either one gives you roughly accurate to entirely accurate results. In our case, the answer is basically:

 

0 kills - 0.06

1 kill - 0.19

2 kills - 0.28

3 kills - 0.24

4 kills - 0.14

5 kills - 0.06

6 kills – 0.02

7 or more kills – less than .01

 

Thus, even with combined shooting and accounting for things like cover, you can compute the probability distribution that you are likely to see when you open fire on an opponent. I find this approach to be a pretty useful tool; I usually know what most of my squads are likely to accomplish (within a broad range) when I open fire on other units, and in general, this allows people to make more intelligent tactical decisions (you aren't guessing what will happen, but rather, you know what can happen).

 

More so, this technique generalizes to all kinds of things. You should be able to figure out what will happen when your opponent shoots at you, how assaults are going to sort out (you'll need a few iterations of this to account for initiative), and why certain weapons are either overrated in their effectiveness or highly underrated. In general, looking at the entire probability distribution for a variety of options tends to provide a more complete picture of unit capability than just computing mean results.

 

As a side note, if anyone wants the spreadsheet I use to compute this stuff, shoot me a PM. I'd be glad to send you a copy, and if you don't have excel, open office calc works just as well and is free.

 

Part III – Why None of What I Just Said Gives Anything Close to a Complete Answer

 

I stated earlier that I was going to explain why one should be very skeptical of mathhammer as a precise answer, so I'm going to poke a few holes in what I just did to explain why you should never think you have the whole answer. I'll start with a question:

 

“What is better to shoot at marines with, a plasma gun, or a flamer?”

 

Well, that depends. First, it clearly depends on range (at all points where you are further away from the enemy than the length of the flamer template but closer than 24”, the plasma gun is definitely better). Second, it clearly depends on how many guys you can hit with the flamer template. Third, it depends on cover (let's assume 5+ again).

 

For instance, if we assume we can tag three guys with the flamer template, we get the following distributions from close range:

 

2 Plasma Gun Shots

0 kills - 0.40

1 kill - 0.47

2 kills – 0.14

(Chance to blow oneself up is about 10.5%)

 

3 Flamer Hits

0 kills - 0.58

1 kill - 0.35

2 kills – 0.07

 

But what if you can hit 5 guys with the Flamer?

 

0 kills - 0.40

1 kill - 0.40

2 kills - 0.16

3 kills – 0.03

 

Suddenly the Flamer is better.

 

Why do I bring this up? Because there are several types of uncertainty that cannot be accounted for in literal mathhammer that will greatly impact strategic choices within a game (ignoring anything your opponent is doing as of yet). We can make some assumptions about them for comparative purposes, but this is the point where I start to advise extreme caution, as getting assumptions wrong (2 guys under a flamer template on average vs. 5 guys) will lead to very different conclusions about optimal courses of actions.

 

Some examples of these kinds of problems include, and are almost all answered by “it depends”:

 

1 – How many times per game will my units get to shoot, and how many turns will they be in assault?

 

2 – Are template weapons more effective, or are direct fire weapons more effective?

 

3 – Am I going to be shooting at optimal targets at close range, or will I be forced to fire at non-optimal targets from longer ranges? Does range even matter for this weapon?

 

4 – Will this unit be in reserve and have to spend a significant amount of time off board?

 

And so on...

 

Without answers to these questions, it's impossible to correctly state the right moves. A good example of this goes back to the debate on tactical squads versus bikes in a thread I started before. Bikes are definitely more likely to be shooting from their sweet spot, and more likely to either be in assault or out of assault as they see fit. Conversely, Bikes are vastly more susceptible to S4 weapons or lower than a tactical squad in a rhino (because unless the rear armor is exposed, those weapons won't even hurt a rhino), and if difficult terrain is involved, suddenly the bikes are taking a 1/6 attrition ratio to even accomplish anything.

 

The math is not clear, and will vary heavily from game to game, and opponent to opponent. This is why I advocate knowing the general parameters of effectiveness, and understanding the key variables, but not over-optimizing or reducing flexibility too much. An opportunistic opponent who knows the same things will be able to use your weaknesses against you.

 

Thus, I would argue that understanding the probabilities is only the start of really figuring out what you want to do and how to act; mathhammer is an input to a decision making process, and only one of many inputs. You also have to consider in-game objectives, psychological concerns, and long-term moral concerns (“even if I can lash this group of guys together and then drop a vindicator template on him, which is both good from a mathhammer perspective and a psychological perspective, is it morally correct to do this to a 12 year old who's already lost 2/3rds of his army in the first two turns of the game to me, or should I let him retain a few units and at least not be totally humiliated so that I don't have someone try to stab me in the parking lot later...”), and so on.

 

In short, compute your probability distributions for your units firing on various targets as a point of reference; know yourself and what could happen with each of the actions you make. But know what you don't know, and know what else you have to consider.

 

Enjoy.

Link to comment
Share on other sites

I could tell that alot of work went into it and it shows. I normally use the much simpler "average" math-hammer when I'm working out the differences between units or loadouts and as such, this statement was very appropriate.

 

So, in short, you're most likely to kill between 1 – 3 guys (no shock, as .22 * 10 = 2.2, which would have been our mean here), but you can see that you should expect your effective kill range to vary anywhere between 0 and 5 when you open fire.

 

Its one thing to note an average (in this case 2.2) but its quite another to understand you're going to have some variation. In this example, I'd be ok assuming I'm going to kill 1-3 Marines when firing and plan accordingly.

 

Another really good statement was this:

Why do I bring this up? Because there are several types of uncertainty that cannot be accounted for in literal mathhammer that will greatly impact strategic choices within a game (ignoring anything your opponent is doing as of yet). We can make some assumptions about them for comparative purposes, but this is the point where I start to advise extreme caution, as getting assumptions wrong (2 guys under a flamer template on average vs. 5 guys) will lead to very different conclusions about optimal courses of actions.

 

All math-hammering involves some sort of assumptions. In the good cases, you try to make them as realistic as possible and you always make them known when you're spitting out numbers as facts. A prime example is the number of units hit under a small blast marker.

You could do the math showing it only hits 1 guy and suddenly the weapon is crap or you can show it hitting 8 guys and now its wonderful!

Taking a more realistic assumption, one based on multiple people's experiences is even better and use that in your calculations. In this case, I've always gone with 3 models under a cup cake.

Link to comment
Share on other sites

Now I want to see the full probability distribution graphed and some standard deviations for 17 bolters and a Melta shot. I should put that minor in math/discovery informatics to work but I'm lazy. Thus, I went into computing. :tu:
Link to comment
Share on other sites

I tend to regard computing standard deviations around a mean as not terribly helpful for most situations in 40k; usually you aren't dealing with a normal distribution, so there's no easy rule of thumb about what 1 / 2 / 3+ standard deviations means, and likewise, it's superior to know the entire probability space anyways.

 

With that said, 17 bolters and a melta shot is pretty trivial to compute using this method. Just do the same thing I did for the plasma gun, but with a meltagun instead.

Link to comment
Share on other sites

I also just use averages as I noticed how similar they were to the distribution (as mentioned, "2.2, so most likely 1-3"), though I've done a program on my calculator to calculate the probability to destroy vehicles, as you only need to worry about one model. When I play games I usually keep away from doing math as I feel it ruins the spirit in the game (for me), and its more exciting (or risky) just going by gut feeling.

 

Its well-written, just too bad people might get shied away from it. Do we have your permission to put it in the Librarium? I'd like to see it in there; I'll bring up your work with the others at the Librarium and see what they think or you can just submit it to the Librarium yourself and we'll let you know (too bad we don't seem to have an article explaining mathhammer in general/simple mathhammer, wink, wink :) ).

Link to comment
Share on other sites

Interesting, and it reminded me why I found statistic classes so terrifying. But as long as you don't crack open six sigma to reduce defects in an army list, I can say that article was very useful.
Link to comment
Share on other sites

(too bad we don't seem to have an article explaining mathhammer in general/simple mathhammer, wink, wink :) ).

 

 

Didnt' we have a great little discussion about math-hammering in the main amicus section? Lots of good information and thought went into that, on both the simple and complex levels.

Link to comment
Share on other sites

Its well-written, just too bad people might get shied away from it. Do we have your permission to put it in the Librarium? I'd like to see it in there; I'll bring up your work with the others at the Librarium and see what they think or you can just submit it to the Librarium yourself and we'll let you know (too bad we don't seem to have an article explaining mathhammer in general/simple mathhammer, wink, wink :P ).

 

Two things:

 

1 - Thanks for the compliment, and likewise, I know some people won't do it. I'm not too worried about it; I'm not here to twist arms, just to throw out ideas.

 

2 - I'd actually like for this not to go in the Librarium. If there's really demand for something math-hammer related there, I'd like to write something a bit more expansive explaining more about context, use during games, and then some statistical techniques for getting the most out of it. I feel like this is, perhaps, a bit too narrow in focus. Maybe a component without being the entirety thereof.

 

I have some strong ideas about probability, uncertainty, and math...

Link to comment
Share on other sites

Reinholdt: This is why I came up with Killhammer. I'm not SMART enough to do that much math. But gut checks, experience, and SIMPLE probabilities can be used to figure out what to do in my system.

 

Add what you put together with what I put together, make it so you can run it for multiple units vs. multiple units, etc. etc. etc.

 

And we could PROBABLY come up with a computer program that could tell you what moves to make that would beat most 40k players. And unlike 1995, processing power isn't an issue.

 

I'm not sure whether to be giddy with possibilities, or glad that something as simple as Killhammer works for me.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.