What is MathHammer?
"MathHammer" is the use of probability and statistics to make more informed decisions before and during a game of Warhammer 40k. At its simplest, it's working out what a unit is likely to achieve when it attacks, so that you can choose between your options based on something better than a hunch.
You'll see it written as "MathHammer", "Mathammer" and "Math Hammer". They're interchangeable. Round here we say "MathHammer", which also seems to be the most common spelling in use.
The three forms of MathHammer
Nearly all MathHammer falls into one of three categories, in increasing order of both effort and usefulness.
1. The average of a dice roll
The plainest form. The average result of a D6 is 3.5, of 2D6 is 7, and of D6+3 is 6.5.
Worth knowing by heart, because it comes up constantly: charge distances, random shot counts, random damage.
2. The average outcome of an attack sequence
Work through the steps of the sequence in turn, multiplying by the probability of passing each one.
Take a weapon with 10 shots, hitting on a 3+, at Strength 4 with AP-1 and Damage 2, firing into a unit of Toughness 5 models with a 3+ save:
| Step | Chance | Running average |
|---|---|---|
| 10 shots, hitting on a 3+ | 4 in 6 | 6.67 hits |
| Strength 4 against Toughness 5, so wounding on a 5+ | 2 in 6 | 2.22 wounds |
| A 3+ save worsened to 4+ by AP-1, so failing on a 1 to 3 | 3 in 6 | 1.11 unsaved wounds |
| Damage 2 per unsaved wound | 2.22 damage |
So the answer is "a bit over 2 damage". You can do that on paper in a couple of minutes, and for one weapon against one target it's often all you need.
It gets awkward fast, though. Re-rolls, critical hits that trigger extra effects, Sustained Hits, cover, a Feel No Pain roll, damage spilling between models: each of those adds branches to the sequence, and several of them interact with each other. This is the point where most players reach for a spreadsheet or a dedicated tool.
3. Simulating the sequence many times over
Rather than calculating the average, roll the whole sequence out with randomly generated numbers, thousands of times over, and count what actually happened. That's a "stochastic simulation", and analysing the results this way is known as the Monte Carlo method. It's how UnitCrunch produces its numbers, and there's a fuller explanation of that here.
The reason to bother is that you get the full range of outcomes instead of a single number. That turns out to matter more than the average does.
Why the average can mislead you
Go back to those 10 shots averaging 2.22 damage. Each individual shot has to pass three separate rolls to get through, which works out at a 1 in 9 chance. Roll it out thousands of times and the picture is less comfortable than "a bit over 2 damage" suggests:
- Roughly 31% of the time, all ten shots achieve nothing whatsoever.
- About 9% of the time, three or more get through, for 6 damage or more.
The average is perfectly accurate and, on its own, not much use. What you want to know before committing the unit is how likely you are to whiff completely, and what a good result actually looks like.
Two ideas cover most of that:
- The shape of the results. How often each result came up, and how often you got that result or better. If the terms are new to you, there's a plain English guide to discrete and cumulative probability.
- The spread. Q1, Q2, Q3 and the interquartile range describe how consistent the outcome is. A narrow spread means the unit does roughly the same thing every time. A wide one means you're gambling.
A unit that reliably deals 4 damage and a unit that averages 4 damage by dealing nothing most of the time and 12 occasionally are very different tools. No average will tell you which one you're holding.
Using MathHammer to build a list
Before the game, MathHammer answers "can this unit do the job I'm buying it for?".
- Check a unit against the sorts of target you expect to face rather than against a single one. A weapon that looks efficient against light infantry can be close to useless into a 2+ save.
- Test the weaknesses you're worried about. If your list has one answer to heavy armour, find out what happens when that answer rolls badly, not just what it does on average.
- Compare two options directly. The interesting question is rarely "how much damage does this do?" but "which of these two does more of what I need?".
Using MathHammer during a game
In game, it's about ranking the options in front of you.
- Target priority. Which of the available targets gives you the most useful outcome, which is not always the most damage.
- Whether to risk a charge. A 9" charge needs a 9+ on 2D6, which is about 28%. Knowing that is the difference between a calculated risk and a hope.
- Splitting fire. Whether to concentrate everything on one unit or spread it about, given how much damage would be wasted either way.
- Getting value from a Stratagem. What a re-roll or a bonus to hit is actually worth on this specific attack, which is often less than it feels.
- When to take a risk that looks wrong. Re-rolling a successful roll to fish for a critical is the classic example. It costs you some successes to chase a trigger, and whether that's worth it depends entirely on the numbers.
There's another benefit that's easy to overlook: working through the probabilities is one of the better ways to learn how the game actually functions. Getting to the point where you can reason about a sequence tends to cement your grasp of the underlying mechanics.
What MathHammer won't tell you
Plenty. It's an input to a decision, not the decision.
MathHammer has nothing to say about board position, objective scoring, deployment, sequencing your activations, or what your opponent is about to do. It's also only as good as the assumptions you feed it: model the wrong target, forget a modifier, and you'll get a confident answer to the wrong question.
It's an addition to practice, not a replacement for it. The best players use both.
Working it out without doing the arithmetic
The first form of MathHammer you can do in your head. The second you can do on paper, until the modifiers pile up. The third needs a computer, which is what UnitCrunch is for: you describe the attacker, the defender and any modifiers in play, and it rolls the sequence out thousands of times and shows you the spread of results rather than just the average.