ConceptsFundamentals → Expected value

Expected value, in dice — what the long-run average is, and what it isn't.

The expected value of a roll is the weighted average of every possible outcome, weighted by how likely each outcome is. It's the number a fair-dice infinite-time bookkeeper would converge to, and it's the single most-used number in dice math. It is also, famously, often the wrong number to ask for.

Definition

For a discrete random variable X with possible outcomes x₁, x₂, … and probabilities p₁, p₂, …, the expected value is

E[X] = Σᵢ xᵢ · pᵢ

Read out loud: add up, over every outcome, the outcome times its probability. For 1d6:

E[1d6] = 1·1/6 + 2·1/6 + 3·1/6 + 4·1/6 + 5·1/6 + 6·1/6 = 21/6 = 7/2 = 3.5

The exact rational is 7/2. Not 3.5. The engine tracks the exact form because rounding to 3.5 throws away information that comes back to bite you when you start summing or multiplying these. Tap the mean on any panel below to see the rational.

1d6
min 1 max 6 mean 3.50 7/2
P(finish at 4 HP) = 50.00% (1/2)
  • 1 16.67%
  • 2 16.67%
  • 3 16.67%
  • 4 16.67%
  • 5 16.67%
  • 6 16.67%

The shortcut for fair dice

For a fair die with M faces, the expected value simplifies to

E[1dM] = (M + 1) / 2

Drop in M = 6: E[1d6] = 7/2. Drop in M = 20: E[1d20] = 21/2 = 10.5. Drop in M = 100: E[1d100] = 101/2 = 50.5. The half-integer comes from the dice having no zero face — symmetry around the midpoint of an integer range puts the average half a step above the integer count.

Linearity of expectation

The single most useful fact in elementary probability:

E[X + Y] = E[X] + E[Y]

That is, the expected value of a sum is the sum of the expected values. Always. It does not require X and Y to be independent. It does not require them to be identically distributed. It does not require anything except that the two expectations exist.

Worked through:

  • E[2d6] = E[1d6] + E[1d6] = 7/2 + 7/2 = 7. Check it against the engine — the panel below shows mean = 7.
  • E[1d8 + 1d6 + 3] = 9/2 + 7/2 + 3 = 11. Constants pass through (a constant is a random variable that's always itself, so its expectation is itself).
  • E[3d4 + 4] = 3 · 5/2 + 4 = 15/2 + 4 = 23/2 = 11.5. Three independent 1d4s sum, then add 4.
2d6
min 2 max 12 mean 7.00 7
P(finish at 7 HP) = 58.33% (7/12)
  • 2 2.78%
  • 3 5.56%
  • 4 8.33%
  • 5 11.11%
  • 6 13.89%
  • 7 16.67%
  • 8 13.89%
  • 9 11.11%
  • 10 8.33%
  • 11 5.56%
  • 12 2.78%

Linearity is what lets you compute the mean of any complicated dice expression by mental arithmetic — break it into pieces, take each piece's expectation, sum. The engine doesn't need linearity (it has the full distribution and can integrate it directly), but you do, because in practice you'll want to ballpark damage on the back of a napkin.

Where expected value lies

The mean is the centre of mass of the distribution. It is not necessarily a likely outcome. E[1d6] = 3.5, but a fair 1d6 never rolls 3.5. It's not the median either — those are different numbers in general (they coincide for symmetric distributions like sums of fair dice).

And — the punchline of why the rest of this site exists — expected value is not the question, when there's a threshold. Suppose you need to deal at least 11 damage in one swing. 2d6+5 has mean 12; 3d4+4 has mean 11.5. The first has the higher mean; the first also has the higher chance of landing the kill. So far so consistent. But shift the comparison and the means stop predicting the kill rate at all: against an 11 HP target, 2d6+5 finishes in 13/18 ≈ 72.22% of swings, while 3d4+4 finishes in 11/16 ≈ 68.75% of swings — a 3.5-point gap that comes from the shape of the two distributions, not the centre.

That's the leap from "what's the average?" to "what's the chance of clearing the bar?" — and the entire variance-vs-mean discussion that the rest of /concepts builds on.

Try it yourself

Next: Variance and standard deviation — once you know where a distribution is centred, the next question is how spread-out it is. After that, the variance and kill probability pillar is where mean and variance meet thresholds, and the intuition you'd build from "just compute the mean" stops working.