Kirb your enthusiasm!

WEBSITE HOSTED AT: www.3plusplus.net

"Pink isn't a color. It's a lifestyle." - Chumbalaya
"...generalship should be informing list building." - Sir Biscuit
"I buy models with my excess money" - Valkyrie whilst a waitress leans over him


Monday, January 10, 2011

Back to Basics: Mathammer


I was kindly sent this e-mail about Mathammer and I thought it was a great way to start out the Back-to-Basics series. So big thanks to Dariokan for writing this up!

Hey Kirb !

I’ve read quite a lot of crap on the Internet recently (including once on your nervertheless excellent website, it was about a Dread That so wasn't me... though I do like how 3++ was complimented haha) and I told to myself: “Why not sharing a little knowledge about mathammering, and contributing a little”. Then I got drunk and forgot. Most of players are already aware of those, but here are some quick tips for those who are not that keen on math, to help calculate probabilities and odds. And excuse my English; it’s not my first language.

1) Probability ? What the @#+*?

It’s the (relative) frequency that an event will occur. Let’s take Guardsmen and their very convenient CT3 as an example. They hit on a 4+, that means if the die reads 1, 2, 3 the Guard misses, and 4, 5, 6 he hits. The event we are talking about here is when the Guard will hit. The die can show us 6 results, 3 of which lead us to the event “hit”. Therefore, a Guard has 3/6, same as ½ aka 50% chance to hit. And 50% chance to miss. A Space Marine will hit on a 3+, that’s 3, 4, 5 or 6 on the die. 4 results that will lead to the event “hit”: 4/6, or 2/3 that means roughly 66% to hit. Of course, that’s does NOT mean that if you shoot with 2 Guards, one will miss, and one will hit. We’ll discuss about it later.

2) Combining probability

“Yeah right, but you roll to shoot, then you roll to wound, then there is an armor save." And that’s why we must combine numbers. Following the same pattern as above, you will have to multiply the numbers to get an estimation of the chances that the event “The target loses one hp” happens. Let’s take a closer look at it. Keeping with a Guard shooting at another Guard.
-To hit: 4+, that are 3 chances out of 6, 3/6, or ½.
-To wound: 4+, same: ½
-NOT to save: a Guard as a Flak Jacket, giving him a 5+ save. We are looking for the event “the wound is not saved”, which means results of 1, 2, 3 or 4 on a die. 4 chances out of 6, 4/6=2/3
-Final result: 1/2x1/2x2/3=(1x1x2)/(2x2x3)=2/12=1/6
When shooting a single shot at another Guard, a guard as 1 chance out of 6 (roughly 16%) to kill him.

Of course, those calculations can be applied to vehicles penetration, and so on.

3) Cranking probabilities up to 100%

“Does that mean if I shoot with 6 guards, I then have 100% chances to kill him?” No. Nononono, absolutely not, just go hang yourself in a tree if you’ve ever thought that. Simply put, apart from automatic rolls (i.e. rolling to see if I penetrate a AV10 vehicle with my S10 weapon, meaning that any result will do) you can never be 100% sure that something will happen. To have the correct numbers, you must go through a “Bernoulli trial”, which is complicated and time consuming. And not the purpose of this text. But math education...:(

Off course, the same applies to automatic fails. Penetrating a Land Raider with a Lasgun is impossible, but wounding a MC with E6, a 2+ save and a second 2++ Super Fell No Pain From Hell is still possible. If highly unlikely. (0,42% for those who wonder. 1 out of 216)

4) Law of large numbers

Long story short: if you throw 2 dice, you will have very random results. If you throw 30 or more dice, you will get closer to the expected result. Eluding numbers, because I do not want to complicate things, if your 2 Guards shoot each once, the odds to hit or miss are like that:
25%: no one will hit.
50%: only one guard will hit.
25%: the 2 of them will hit.

On the other hand, if you throw a bucket of dice (First Line FIRE! Second Line FIRE! Or a mob of 25 boyz charging), you can be sure that the results will get closer to the expectations. That means, for 10 guards firing 3 times, 30 shoots at 4+, most of the time you will be close to 15 hits. 12, 14, 18, but almost never the results “no one will hit” or “all of them will hit”. That’s the main goal of concentrating fire.

5) Estimations on the run

So you want to know what will probably happen when your unit will shoot at this other unit? There’s a simply way to know, on average, what is going to happen. Let’s imagine 10 Guard rapid-firing at another squad.
Base pool : 20 dice. 50% will hit -> 10 dice remaining.
10 dice to wound, again 50% chance to wound -> 5 dice remaining.
Armor save : 4 wounds out of 6 will not be saved : 4/6=2/3. What is two third of 5 dice? 5x2/3=10/3=3.33. That means, on average, you will kill between 3 and 4 guards.
Food for thought : what now if they shoot at 10 marines ?
20, shoot at 4+: 10 remaining. 10, wounding on 5+: 3.33 dice remaining. Armor save 3+, means only 2 wounds out of 6 (1/3) will not be saved: 3,33x1/3=1.11. On average, they will kill a single Space Marine.
And if 10 Marines shoot at 10 guards? 20 dice will bring us to…. 8.88 wounds (taking into account the fact that bolters ignore the Guards’ Flak Jacket). We’ll round it up to 9. Pretty impressive difference, huh?

6) Adding modifiers to the sauce

+1 to damage rolls on vehicle will mean that: 4 are now 5, 5 are now 6 and 6 well remains 6. Just keep in mind you need to base your calculations on the DIE result, then apply it to the chart.

7) 2D6 rolls

These are trickier. “A character with Ld 10 can fail on a 11 or 12 on the dice, that’s 2 chances out of 12, or 1 on 6!”. Again. No. 11 can be achieved by rolling 5 and 6 OR 6 and 5, 12 by rolling double 6. You have, by rolling 2 dice and adding them together (which is NOT the same as rolling 2 dice and looking at the results independently), 36 combinations possible. Thus a Ld10 character, rolling on his unmodified Ld, will have 3/36 chances (1 chance out of twelve after simplification of the fraction) to fail his test. 8.33%. For quick references, I made those calculations:
Final Ld / Chances to pass

2 2.77%
3 8.33%
4 16.66%
5 27.77%
6 41.66%
7 58.33%
8 72.22%
9 83.33%
10 91.66%

That means: YES there is a HUGE difference between Ld 7 and Ld 9, and NO, those critters out of synapse will not follow your masterminded plan that often. On a side note : the average roll on 2D6 is 7, and on 3D6 it's between 10 and 11.

Well, I think that sums up the question of mathammering without complicating too much. Just keep in mind : even if a single Guard has 2.7% chance to kill a Terminator, one lucky roll and your unit can be obliterated. Even if the odds are on your side, get a plan B. Just in case ;)

Dariokan

Some really basic stuff here but it's a good read for everyone to ensure we are all on the same page with our math! I've often seen people guilty of 3 which makes me cringe inside but Dariokan's final point is really important. No matter the numbers they are just numbers and whilst they give you an idea of what a unit can or cannot do, there are a lot more variables at stake and relying on averages will often see you lose.

Comments (34)

Loading... Logging you in...
  • Logged in as
Good work, Dariokan. Good to see this in such a quick-and-easy format. Lord knows I'm no mathematician, but running 40k numbers has always been enjoyable. I also really like that you stress the point that these numbers are not really reliable when you have a small pool.

On a related note, if I hear one more Warmachine player say "don't boost, you need exactly a 7 to hit!" I'm going to puke.
2 replies · active 742 weeks ago
Depends what you're trying to hit, and what that hit will set up, surely?
Does that... really need to be said? Of course that's what I mean. =)
'“Does that mean if I shoot with 6 guards, I then have 100% chances to kill him?” No. Nononono, absolutely not, just go hang yourself in a tree if you’ve ever thought that."'

<3 , carry on.
1 reply · active 742 weeks ago
Good article, but its comments like "go hang yourself" that take away from it. Are you trying to teach or make people feel small? This comment adds nothing.
My goodness! If this is back to basics when what constitutes and normal or advanced article? :D

That said it is a good article, you've got a good dose of humour and a nice clear explanation. Good job. My only suggestion would be to include a little more by way of fractions. Percentages can be a little unwieldy and when you're rolling dice seeing things in terms of die-sides can be helpful stuff.

You needn't drop the percentages but you could go about including the probability as well. So for instance your last table would become.

2 1/36 or 2.77%
3 3/36 or 8.33%
4 6/36 or 16.66%
5 10/36 or 27.77%
6 15/36 or 41.66%

And so on. I find that seeing numbers that relate directly to the dice in your hand as well as the total number of outcomes possible for any roll can be really helpful. Especially for the beginner.
4 replies · active 742 weeks ago
A good idea indeed. If Kirby is ok with that, and if that's not too much hassle to modify it, I'll send him the two lists of numbers.
Delighted to be of service. It's a solid article!
You hassle creator you.
You've seen right through me! Ach. :D
Great article on the basics, though the sentence "On the other hand, if you throw a bucket of dice (First Line FIRE! Second Line FIRE! Or a mob of 25 boyz charging), you can be sure that the results will get closer to the expectations" is incorrect, and so somewhat misleading. You can't be *sure* that the results will get closer to the expectations. You can predict that the probability of something close to an average result is quite high, but there's still a chance that your 25 Boyz will all roll 6s on all their attacks... a very small chance, maybe, but still a chance. (I hate to be picky -- what am I saying, I love to be picky! -- but I think it's worth using language precisely when talking about probabilities.)

Might be worth illustrating the point with some maths, actually -- figure out just what the probability of rolling (say) "between 25 and 35 hits" if rolling 60 dice at BS3.

Incidentally, the SmallRoller calculator is excellent for calculating probabilities with dice:
http://www.fnordistan.com/smallroller.html

Takes a lot of the legwork out, so long as you know enough of the basics of dice probability already.
2 replies · active 742 weeks ago
You are right to be picky Ian. As I said, English is not my first language and I have struggled to find a suitable sentence. :) That being said HOW DARE YOU CRITIZICE MY WORK YOU PIECE OF @#$% I'M GONNA SHOWER YOU WITH HOLY PROMETHEUM ! xD What ? No please don't be bring me back to the asylum pleeaaaase ! (corrections on their way ;) )
Huge improvement, thank you! And, thank you for taking the constructive criticism so politely -- most people react with Krak missiles rather than just promethium. :)

I used SmallRoller to quickly give you some numbers for those 30 shots at 4+ to hit:

There's an 89.98% chance of rolling at least 12 hits, and only a 10.02% chance of rolling 19 hits or more. So, about 80% of the time you'll get between 12 and 18 hits -- pretty reliable. There's less than a 5% chance that you'll get 20 hits or more.
Excellent write up. Clear explanations. Very good work indeed.
Antebellum's avatar

Antebellum · 742 weeks ago

Great article. I just went through some Mathammer recently to see if a power weapon or a lightning claw was better on a SP.

One thing that would add to this discussion though is how to do rerolls. How does the probability to hit with a lascannon differ from a twin-linked lascannon, or how does a 3+ save differ from a 3+ FNP save.
4 replies · active 742 weeks ago
They stack as mentioned above so the TLLC would become 2/3 + 1/3*2/3 or 0.6666 + 0.6666* 0.3333 = 0.8887 to hit and the 3+ FNP is easy as trhe chance of dieing is halved so a 3+ save would be 1/6 nt 2/6, 2 + would be 1/12, 4+ would be 1/3 chance to die/kill
That would be beyond basic mathhammer. But a relevant question nonetheless. I tried to explain and failed miserably (the Dread thingy Dariokan was refering too). Conditional probability is quite tricky. I think the easiest approximation would be to count twin-linked as if it were two shots, instead of one. A rough estimate at best, but easy to use... (Correct me if I am wrong, guys)

Take the example in 4)
25% chance you would not hit
75% you would... (note that you are still firing a single shot)

Again, given my track record, do not just take my word for it... There are people in the community who have created excellent excel sheets to calculate such probabilities for you... I think there is a good one hidden somewhere on this site (clicking Mathammer in the tag cloud will get you there)
Actually, to account for rerolls such as twin-linked, you have to count the number of rerolls you get, and then apply the fractions again. I'm a tyranids player, so here's a Tyranid example.

Let's say I have a carnifex with 2x Twin-Linked Devourers.
He gets twelve shots, and on average half of them hit (that's six) because of his BS3. I then get rerolls for the missed shots, on average that's also half of them, six. Now I apply my odds to the rerolls (I hit on a 4+ so half the shots), so out of the 6 rerolls, 3 are successful on average. That's a total of 9 hits average out of 12 shots with my TL Dev Carnifex.
LClaw more often than not for SP. They are life-savers. Ask Kyle. And Puppy.
2) Combining probability:
One thing to remember really:
if P(A) is the probability of A and P( B) is the probability of B then if A and B are independant:
P( A and B ) = P(A) *P( B)

So for a reroll:
P(hit with reroll) = P(hit) + P(not hit) * P(hit)
For BS4: P(hit with twinlinked weapon) = P(hit with weapon on first roll) +P(not hit with weapon on first roll )*P(hit with weapon on second roll)
= 4/6 + 2/6*4/6
= 32/36
= 8/9

Same for 3+FNP :
= 4/6+2/6*1/2
= 10/12
= 5/6 or the same probability as a 2+ save.
Good read! As for: "3) Cranking probabilities up to 100%" You can calculate this type of probability by using a binomial distribution. The math is really hard but there is a handy calculator for this on the internet. I cover all this a while back in my blog. You can check the linky for more info : http://cadia122.blogspot.com/2010/11/calculating-...
4 replies · active 742 weeks ago
Maths? Hard? Never!

Oh wait. I see what you mean. :D
No. Your first line was correct ^^.
I like the way you roll!
You in-depth article is very interesting !
I can never subscribe to these things...
And thank you, sir! :)
3) Cranking probabilities up to 100%
You don't have to use a compute the bernoulli trial to determine the probability of 6 guards killing a guard.
It's much easier to use two probability laws:

The probability of A happens or not is 1 so
probability of (A) + probability of (A not happening) = 1

and

when A and B are independant the probability of (A happening and B happening) is equal to the probability of (A happening) multiplied by probability of (B happening)

So in our case we are going to calculate the much simpler probability of 6 guards not killing a guard which is simply the probability of one guard not killing to the 6th power.

Proba of not killing a guard for a single guard = 1 - proba of a guard killing the guard .

So we get :

Proba of killing the guard with 6 guards = 1-( 1 - proba of a guard killing the guard )^6
Here :
= 1 - (1-1/2*1/2*2/3)^6
= 0.67
= 67%

You can do exactly the same thing for the probability of destroying a tank (just remember to add destroyed result from multiple immo/weapon destroyed results), Excel is nice for this, or a pocket calculator, or a smart phone...
I've been using the Heresy Combat Calculator. Very simple to use.
http://www.heresy-online.net/combatcalculator/sho...
This will *probably* confuse some people.
1 reply · active 742 weeks ago
Lucky it is not his fault, as correlation =/ =casuation :p
http://xkcd.com/552/
I like this, but remember, probabilities are given in decimals, not percentages.

If we have a marine on a bike shooting at a plague marine.

Basic probabilities for one shot.

To hit BS4 with re-roll
To hit, 0.67
To hit with the re-roll, 0.33 x 0.67 = 0.22
Total to hit, 0.89

To wound, strength 4 versus toughness 5
To wound, 0.33

To fail a save, 3+ armour and 4+FNP
To fail armour, 0.33
To fail armour and fnp, 0.33 x 0.5=0.17
Total fail, 0.17

Total = 0.89 x 0.33 x 0.17 = 0.05

Which tells us shooting single shots at Plague Marines is pretty pointless.

If we have 3 bikers shooting the Plague Marine in rapid fire range

Let P equal probability of success, 0.05
Let K equal probability of failure, 0.95
Let n equal number of trials (dice), 6

Via multinomial theorem (P+K)^n

Using binomial, 6!/(1!x5!)=6, 6!/(2! x 4!) = 15, 6!/(3! x 3!)=20

(0.05^6) + 6(0.05^5 x 0.95) + 15(0.05^4 x 0.95^2) + 20(0.05^3 x 0.95^3) + 15(0.05^2 x 0.095^4) + 6(0.05 x 0.95^5) + (0.95^6)

If we want to know the probability of getting just one wound on him, we can jump right to the end. (0.95^6) gives us the probability of not wounding him at all, or when calculated 0.74. Taking that away from 1 gives us the probability of wounding the Plague Marine, and that is 0.26. It's still not great, but it's better than a single shot at long range.

Post a new comment

Comments by

Follow us on Facebook!

Related Posts Plugin for WordPress, Blogger...