Mathhammer - The guide

Discuss tactical and strategic development for 40K/Tau.
User avatar
onlainari
Por'Ui
Por'Ui
Posts: 304

Mathhammer - The guide

Post#1 » Aug 17 2007 08:35

Mathhammer - The guide for the gifted and mathematically challenged alike

Warhammer is a game of dice. In general, mathhammer aims to predict the dice. Its fault is its failure to take any amount of "luck" into account.

Lets begin with the basics. Flip a coin. Did it come up heads? A coin that can only come up heads or tails has 50% chance of coming up heads. Were you lucky?

Ok now flip two coins. I bet you got one heads and one tails, or two heads, or two tails. Not much of a bet is it? The fact is, all of these outcomes are possible, and all these outcomes are the only possible outcomes.

If you were asked to predict the flip of two coins what would you say?

Each outcome has a probability. You could predict that the flip will be one heads and one tails, but this only has a 50% chance of happening.

When we roll dice, you can try to predict the outcome just that same. If you have 4 BS3 markerlights, the prediction will be 2 markerlight hits. But just as with the coin flip, the prediction might not come true. And in fact, in this case, it will probably be something other than 2 hits.

In general, when trying to predict the number of successes in a dice roll, you multiply the probability of success of a single die by the number of dice.

I am told that the more formulas I write in this article the less popular it will be, but I hope if I keep them simple then it won't be too bad.

Predicted # Success = P(success) * # dice

This is not the whole picture. This formula does not take luck into account.

Probability mathhammer is able to model luck

Any number of shots are distributed randomly. Here's how to get the probability distribution:

P(# success) = p^r * (1-p)^(n-r) * nCr

P(# success) => The probability of getting that exact number of successes

p = P(success) => The probability of success for a single die

n = # dice => The total number of dice you roll

r = # success => The exact number of successes

nCr is the binomial coefficient, you will find it on your calculator. Hit n (4 for example), then the nCr button, then r (2 for example).

Ok lets put this to the test with our 4 markerlight example.

Code: Select all

# success - P(# success)
0         - 0.0625
1         - 0.25
2         - 0.375
3         - 0.25
4         - 0.0625


Thus there is a 0.375 probability of 2 hits.

Ok back to basics for a moment. The chance of rolling a 5 is 1/6, and the chance of rolling a 6 is 1/6. You can add these probabilites to get the chance of rolling a 5 or a 6, 1/6 + 1/6 = 1/3.

You can also add the probabilities in the distribution. The chance of 2+ markerlight hits is: 0.375 + 0.25 + 0.0625 = 0.6875.

Vehicles

Vehicles can only die once. The mistake people make when calculating the probability of killing a vehicle is to double count the probability of killing it twice. This is how to get the probability to destroy a vehicle:

1 - {1 - [P(success)]}^# dice

For example: Two deathrains shoot at an open topped AV10 skimmer that's moved fast.

Correct way to do it:

1 - {1 - [P(success)]}^# shots = 1 - {1 - [8/9*2/3*1/2]}^4 = 1 - [1- 8/27]^4 = 0.755

The mistake: Probability of killing the skimmer is not:

P(success) * # dice = (8/9*2/3*1/2) * 4 = 1.19 ~ this is wrong.

Lets not forget that we also have the chance of stopping the vehicle from shooting. It will be useful to know how to work out the probability of doing nothing to a vehicle.

P(nothing) = [1 - P(success)]^# shots = [1 - 8/9*2/3]^4 = 0.0275

Dumbing it down

All that stuff can get quite confusing for the average person. It can get very frustrating for both the mathhammer and non mathhammer parties when discussing the effectiveness of units. It is often the mathhammer parties that are at fault. They use simplified models that are easy to understand, but are not very good. Experience counts for more than how many space marines you will statistically kill.

One concept that is particularly hard to grasp is turning shots at a unit into probabilities. Lets use an example. 5 Space Marines with bolters shoot at a unit of Chaos Space Marines. You pick up 5 dice, and roll to hit. You pick up the hits, then roll to wound. Finally for each wound the Chaos player rolls an armour save.

Unfortunately that was the easy part. Ok to get the actual chance of a single bolter killing a Chaos Space Marine, you multiply the probability of each event together.

P(success) = P(hit) * P(wound) * P(failed save)

If we try to predict the number of dead space marines using the very first formula in this article, we get 5/9. Cleary, we cannot kill 5/9 marines. Clearly 5/9 is misleading when the Chaos player fails 3 saves! This is the flaw of regular mathhammer. This is the beauty of probability mathhammer.

Code: Select all

# success - P(# success)
0         - 0.555
1         - 0.347
2         - 0.0867
3         - 0.0108
4         - 0.000677
5         - 0.0000169


Instead of rolling the dice three times, it is equally valid to roll one dice. In this case it would have to be a D9. Roll 5 D9's and all 9+'s will cause casualties. This has the same distribution as doing it normally.

Ok now imagine a D1000000, a one million sided dice. You could instead of rolling the 5 D9's, roll one D one million. If it is 999983+, you kill 5 marines. If it is between 999324 and 999983, you kill 4 marines. Similarly, divide the D one million into 6 total sections each representing the probability for each number of kills. If you roll less than 555000, you get zero kills.

This is exactly the same as rolling 5 dice, picking up hits, rolling the hits, picking up wounds, then for each wound the Chaos player rolls armour saves, and each failed save a Chaos Marine is removed as a casualty.

In this way, it is much easier to turn the shots into probabilities. You're just rolling one very large dice (physically impossibly large). Just like you have a 1/6 chance to roll a 6+, you have a 445000/1000000 chance to roll a 555000+ (and thus kill at least one marine).

Conclusion

I understand that no matter what I do, some people just won't get it. Some people will still not see the benefit of probability mathhammer.

What I am doing is not regular mathhammer. It is different. I often feel as though everyone is like "mathhammer does not take luck into account". This does take luck into account.

Clearly if this was mathhammer that is a contradiction, and unless you're not good at maths or English you understand how silly that stance is.

Either mathhammer can take luck into account (in which case, if it does, it's clearly better), or this is not mathhammer. It cannot be both.

As they say, single, attractive, mentally stable. Chose two.
Last edited by onlainari on Aug 21 2007 04:56, edited 10 times in total.
100/19/20 w/d/l
Tournament: 21/4/4 w/d/l

User avatar
Daemonic-Force
Fio
Posts: 64

Post#2 » Aug 17 2007 08:44

A good article and I think that articles like this would go a long way to address some issues that ocurr with some players approach to the mathematical side of the game. Unfortunately, (not being able to remember back to high school maths - although this did jog my memory a bit) I can't think of anything to add although there is probably some clarification or expansion.

Good job.

User avatar
onlainari
Por'Ui
Por'Ui
Posts: 304

Post#3 » Aug 17 2007 08:53

Ninja edit.
Last edited by onlainari on Aug 20 2007 08:53, edited 1 time in total.
100/19/20 w/d/l

Tournament: 21/4/4 w/d/l

User avatar
T0nkaTruckDriver
Shas'O
Shas'O
Posts: 1678

Post#4 » Aug 17 2007 09:14

Ugh, the word filter is replacing the letter between Q and S with the word 'are'. I'll have a go at trying to undo that.

theodorus
Shas
Posts: 123

Post#5 » Aug 17 2007 09:16

for more info on what onlainari is getting at, wiki "variance". basically, most mathhammer concentrates on averages and ignores variance, which is variation around the average. higher variance means more fluctuations: ie, a weapon that guarantees exactly 2 kills every turn has the exact average kill rate as a weapon which kills exactly 0 or 4 kills per turn, but the 2 guaranteed kills has a lower variance, and is thus more "reliable" (to refer to the CIB thread that's come up recently).

weapons like the plasma rifle have fairly low variance. weapons like the CIB may over, say, 30 turns, kill the same number of marines, but on any given turn, may kill anywhere from 0 to 5.

If you NEED a target to die, you want to look for a weapon with low variance. If you don't really care, and plan on simply taking pot shots over the course of a game, variance is less of an issue (though obviously still an issue).

Onlainari, in calculating the probability of each possibility, showed you a distribution of the likelihood of each occurance actually happening (wiki "binomial distribution" and "normal distribution"). Distributions with a low variance will have a "bell curve" that is very high, very concentrated around the middle, meaning outlying events do not happen very often. Distros with high variance will be flatter, meaning events outside of the average will occur quite frequently.

btw, if you think wiki isn't reliable enough, there's a very simple solution: take a course in statistics.

User avatar
onlainari
Por'Ui
Por'Ui
Posts: 304

Post#6 » Aug 17 2007 09:34

Ninja edit #2.
Last edited by onlainari on Aug 20 2007 08:53, edited 1 time in total.
100/19/20 w/d/l

Tournament: 21/4/4 w/d/l

User avatar
syntaxerror111
Shas
Posts: 8

Post#7 » Aug 17 2007 10:38

onlainari and theodorus- thanks for taking the time to explain variance in detail, especially how it relates to averages (I spelled variance right!).

I think I will sign up for a statistics class next semester...
Forgive my ignorance on the CIB thread- I'll leave any future mathhammer posts to the pros :)
The patient hunter gets the prey.

User avatar
kai'lore
Aun'O (Ret.)
Posts: 3480

Post#8 » Aug 17 2007 11:43

varience in the rouge trading devestators.
:P
Nice write up up, thanks O.
Please visit my New Online Gallery Scale120

§plit§econd
Kor'Ui
Kor'Ui
Posts: 492

Post#9 » Aug 18 2007 12:07

Good writeup.

If that does not convince you to use ML then I don't know what will.
For now I don't write Tacticas, I inspire them.

User avatar
Sansel
Shas
Posts: 14

Post#10 » Aug 18 2007 02:23

Hmm, maybe an Excelsheet with formulas? :eek:

I hate statistics from the depth of my heart ! :::(
You just read my signature

User avatar
onlainari
Por'Ui
Por'Ui
Posts: 304

Post#11 » Aug 18 2007 04:20

It gets very frustrating for both the mathhammer and non mathhammer parties when discussing the effectiveness of units.

The reason for this is the fault of the mathshammer parties. Their maths is not up to scratch. Experience counts way more than how many marines your mathhammer guys says you can kill.

If however people evolved their mathshammer into probabilities then there's a very simple way to win the argument.

<<<

<mathsguy> Ok ok, you don't like mathshammer, but can you at least agree that the chance of rolling a 6 is 1/6, and the chance of flipping heads on a coin is 1/2?

<nomaths> Sure I guess.

<mathsguy> Ok well what I've got here is just like that. I'm not telling you the usual maths, I'm telling you the actual chance of this event occurring. Just like there is 1/6 chance to roll a 6, you have a 0.0494 chance of killing a falcon with that lascannon. Same logic applies to both. And the chance of an autocannon killing a falcon is 0.0487.

>>>

So when arguing what's better for shooting a falcon, an autocannon, or a lascannon, no matter what the nomaths guy says, he's dead wrong. He's trying to prove that rolling a 4+ is easier than rolling a 3+.
100/19/20 w/d/l

Tournament: 21/4/4 w/d/l

User avatar
Master of Malfeasance
Shas
Posts: 52
Contact:

Post#12 » Aug 18 2007 05:48

I prefer Texas logic.

Mathhammer guy: Would you agree that the chance of a terminator failing an armor save is around 16%?

Texan: Nope. It's exactly 50%.

Mathhammer guy: 50? Five-oh? Where are you getting your data?

Texan: Either he makes it or he doesn't.

This logic, while a bit rustic has gotten me through all manner of tight spots. The overwhelming majority of armies I play against are space marines, therefore, they will almost always get their armor save. If I get an average of one dead marine per warfish I send to kill it, and I know it will take around 100 pulse shots to kill 5 terminators, I can usually eyeball my chances from there.

However, I have to get my army there first, which is where mathhammer fails. Mathhammer can only look at ideal circumstances from the most clincal perspective. One of the really neat things about 40k, and the Tau army specifically, is their propensity for beating the odds or failing them spectacularly. Variance is extremely high in the tau army simply because of the lack of low AP weapons. If you can't use precision engagement to kill your target, you have to use dominant maneuver and weight of fire to do the job.
Stealth by malfeasance!

User avatar
kai'lore
Aun'O (Ret.)
Posts: 3480

Post#13 » Aug 18 2007 08:38

This topic is good but it is slightly failing where I had hoped it might work -making the math more accessible for language based types.

Right now it's math for math guys. :biggrin:

Fair enough, it might be a pipe dream to try to bring the two camps together?
Please visit my New Online Gallery Scale120

User avatar
onlainari
Por'Ui
Por'Ui
Posts: 304

Post#14 » Aug 20 2007 08:37

Article is finished.

Tell me if I missed anything.

Otherwise, add to http://advancedtautactica.com/cms_articles.php

(see first post)
100/19/20 w/d/l

Tournament: 21/4/4 w/d/l

User avatar
kai'lore
Aun'O (Ret.)
Posts: 3480

Post#15 » Aug 20 2007 11:28

very nice, really like the new edited version. :biggrin:

Excellent point about what mathhammer is and what it can show. I like the explaination about real mathhammer modelling luck.

Your best work so far methinks Onlainari, thank you very much for your efforts on this.
Please visit my New Online Gallery Scale120

User avatar
PeterLageri
Shas'Ui
Shas'Ui
Posts: 35

Post#16 » Nov 13 2007 08:13

Hello.

I don't get it.

What is the nCr on your calculator? (It's 6 on mine)

How do you get the result for about 37% (I get 29,6%)

Could you be so kind and spell it out for me?

Kind Regards
Peter Lageri
Denmark

Lone Ranger
Shas'Ui
Shas'Ui
Posts: 260

Post#17 » Nov 13 2007 04:42

Yeah math :biggrin:

but honestly very useful as with non MEQ armies you really need to know the odds of an attack being sucessful before you assign troops to the attack. Sending a single crisis suit against a block of 50 IG conscripts is a waste of resources that can be used elsewhere. Instead math would dictate using a HH w/ a rail to blast chunks out of them or call in that barracuda strike....
Forget injuries, never forget kindnesses.

User avatar
PeterLageri
Shas'Ui
Shas'Ui
Posts: 35

Post#18 » Nov 14 2007 12:45

Thank you Lone Ranger.

But that really doesn't explain the calculus done in the tread's original e-mail. I get the notion of a calculation error on part of onlainari. Therefore I would really, really like to see the example of 4 markerlight roll and 2 successes spelled out digit by digit because my calculator and a web gives a different result.

I may be wrong but I think something is missing........

Kind Regards
Peter Lageri
Denmark

Return to “Tau Tactics”

Who is online

Users browsing this forum: Ifrit and 1 guest

cron