Tuesday, July 24, 2012

Here's to You, Nikephoros - Making Sense of the New Hull Points Maths

Ok, so Nike has made a rather interesting tool and posted it up on his website. He essentially is performing what is called a "Monte Carlo" or resampling approach to attempting to determine what the odds of killing a vehicle target are. It's a fine approach, and in fact Monte Carlo methods are the cutting edge in statistics right now, and allow you to do lots of things without having to make messy assumptions about the data you are working with.

But it's not my preferred method for Warhammer, for the simple reason that I feel like I 'own' the data more if I actually calculate these probabilities myself. To be clear, I'm not saying that you 'need' to know any of these things to be good at Warhammer. At all. But I enjoy working with numbers, and find that it actually makes me a smarter person to go through what are essentially uber cool word problems.

I mean imagine if you were sitting in 5th grade math class and your teacher reads you the following problem:

"You are a Space Marine Captain. Defender of the Empire of Man and champion of the God Emperor. Your force, the 3rd Company of the Imperial Fists, is tasked with holding a chokepoint against the cursed forces of the Traitor Astartes - the Chaos Space Marines. You know that this pass is protecting the entire right flank of the Imperial forces on the fortress planet Cadia, the best hope of the Imperium for stopping the 13th Black Crusade.

You have carefully fortified your position, using the precepts laid down by your Primarch, Rogal Dorn. Under your command are two full squads of Devastator Marines, equipped with a total of 8 High Powered Lascannons, anti-tank weapons capable of defeating even the strongest armor. 

To your front, dustclouds inform you that the forces of Chaos are coming to test your lines. As the dust clears, you see not one, but two mighty Chaos Land Raiders, adorned with twisted icons and leering daemonic faces. You know you cannot allow these machines to breach your lines. 

If the wind is from the West at 10 miles per hour, and the New York train is 2 hours late, what are your odds of destroying a Land Raider with each volley of Lascannon fire?"

I don't know, I feel like this might have helped me pay more attention in math class.

Anyways, 6th edition has presented new challenges in performing what was previously a fairly simple calculation.

First, I would suggest reading through this post here, as it gives a good foundation for calculating the chances to destroy a Land Raider from penetrating hits. But now, in 6th, we also have to worry about Hull Points. Let's talk about that.

To calculate the probability of destroying the Land Raider through penetrating hits, we will first calculate the probability of destroying it with a single hit. We start with our chance to hit (2/3) times the chance that it will pen (1/6), times the chance that it will Explode (since it's AP 2, that's 1/3).

So 2/3 x 1/6 x 1/3 = .037, or 3.7%.
This is the chance for each individual shot to Explode the Land Raider.

Then we need to determine what the cumulative odds of the Land Raider exploding are, for all eight shots. Intuitively, we might be tempted to simply add the 3.7's together eight times. This is not correct. You know this is not correct, because if you just kept adding additional Lascannons, eventually you would get to over 100% probability. You can never have 100% probability, and certainly can never have more than 100% probability, for anything that even has a chance of failure. This does. We could theoretically shoot 100 Lascannons at a Land Raider and fail to explode it (though the odds are astronomically small).

So how do we accurately determine the cumulative probability? First, we know the probability for a single Lascannon to destroy the target (3.7%). This means we also know the probability for a single Lascannon to NOT explode the target (96.3%). This probability, the odds of the thing NOT happening can be multiplied by itself (raised to the power) of however many attempts we are performing to determine the total odds of the thing NOT happening.

When we do this we see that 93.6% raised to the eight power (.936^8) is 73.9%. Again, this is the odds of NOT exploding the Land Raider, which also allows us to deduce the odds which it WILL explode: 26.1%

So if you sling 8 Lascannons at a Land Raider in the open, you have a little more than a one in four chance of exploding it outright.

Next, we have to determine the chances that the Land Raider will lose at least four Hull Points during this barrage.

For this, we have to do something a bit more complicated (I can hear you groaning SinSynn... and I don't think it's TentacleViolation.com this time).

This is something called a Cumulative Binomial Probability. It's a fancy way of determining, if you try X times to achieve something, and you have Y chance of doing it on each try, what the odds are of you succeeding at least Z times.

So if I flip a coin (50/50 odds) 10 times, what are the odds of me getting at least five heads?

Here is the formula to determine this:

I have done this in Excel several times, and I can tell you that while I can do this kind of math, I can't just look at it and "read it" like some people can. I have to think it through step by step. But that is how we learn and get better, yes? So for those of you who are interested, here is a link to the Wikipedia article on the subject that explains this function inside and out. Have fun. I know I did.

But for those of you who are less mathocistic (see what I did there), here is a link to a handy dandy calculator that someone else has provided for us. This is math for cheaters, frankly. :D

But that's ok. We will see later that while the calculator is cool, we really need to be able to put the Binomial Distrtribution into a Spreadsheet to make the really cool stuff.

But for now, let's use the cheater method. First we need to tell the calculator what the odds of getting stripping a single hull point are. This is similar to the last formula, odds to hit (2/3) times odds to glance/pen (1/3). That's it. Total odds to take a Hull Point per shot are .222.

Yowza! That's a lot better!  So if our odds of stripping a Hull Point are .222 per attempt, and we are attempting it eight times, what are our odds of getting stripping four or more hull points?

Turns out, it's only 7.6%. Ouch. And here is where this new system of GW's gets really interesting, in my opinion.


If that Land Raider only had 3 Hull Points, the odds of wrecking it with those same eight shots are actually 24.9%! That's a massive increase! If the Land Raider only had two Hull Points, the odds would be a whopping 55.4%! This is with the same weapons, and the same armor value. You can see that there really IS a big difference between three and four hull points, and a massive difference between 2 and 3 hull points, in terms of survivability. It's quite an elegant little mechanism to be able to have geometric increases in survivability just going from 3 to 4. Well played, Games Workshop.


Ok, so these Land Raiders are hardy. If we are shooting eight Lascannons per volley at them, our odds of Exploding via penetration (that sounds like something SinSynn would like) are 26.1%. Our odds of Wrecking via Hull Points are 7.6%. So can we just add them together and go from there? Well, no, unfortunately. The issue is complicated by the fact that these two possible events (Wrecked and Exploded) are not exclusive, i.e. they can BOTH happen if we shoot eight Lascannons at them. So that screws up the maths a bit. But never fear, we can go back to the handy inverse probability calculation we called upon earlier to save the day.

So the odds of NOT Exploding the Land Raider, as we recall, is 73.9%. The odds of NOT Exploding the Land Raider is 92.4%. If we multiply these together we will know the combined odds of NOT Wrecking OR Exploding the Land Raider. .739 x .924 = .683. Again, this is the total odds NOT to destroy the Land Raider. That means that the odds TO wreck the Land Raider are .317, or 31.7%.

Whew. This article should explain to you how you can calculate ANY chance to destroy ANY vehicle in 6th Edition. It's a bit complicated, and frankly, we might not NEED to know the precise odds. It's interesting to be able to compare weapons, however, to see which are more efficient for a given task. It's also interesting to do because... maths are interesting. And Warhammer is interesting. Mathhammer, by the implacable deductive powers of logic, must therefore be interesting.

So here's what *I* would like to build. A spreadsheet which will accept your Ballistic Skill, the Strength of the Weapon, AP Modifiers, Armor of Target, Hull Points of Target and Cover Save, and number of Shots Fired, and spit out the exact probability of destroying said target. Even cooler would be a graph showing the probability as a cumulative function of the shots fired.

Pardon me for a moment. I've got to go spend a day buried in Excel. If you don't hear from me by the weekend, call for search and rescue.