User guide All lessons Cookbook Function reference Open playground

Open this document in the playground · Download source

Round each result, not the average

Part E · L20 · Prerequisite: L19 · One modelling idea

Situation, question, and prediction

D&D 2014 Fireball at its base spell level deals 8d6 damage, halved on a successful Dexterity save. Given that the save succeeded, what is mean damage? Predict whether it is exactly half of 28.

Build

dice_pool(8, 6).sum() efficiently builds the ordinary total. // 2 divides each possible integer result and rounds down. This is a transformation of the entire distribution, not division of a summary number.

full = dice_pool(8, 6).sum()
half = full // 2
output("Damage given failed save", full)
output("Damage given successful save", half)

Damage given failed save · DieRoll · mean 28.000

outcome%fracX
80.0000.000
90.000.0000.000
100.000.0000.000
110.010.0000.000
120.021/50640.000
130.051/21170.000
140.101/9830.001
150.202/9970.002
160.374/10930.004
170.624/6410.006
181.0013/12990.010
191.5210/6590.015
202.1823/10530.022
212.995/1670.030
223.9244/11230.039
234.9049/9990.049
245.88424/72070.059
256.7784/12410.068
267.48115/15380.075
277.94128/16130.079
288.0948/5930.081
297.94128/16130.079
307.48115/15380.075
316.7784/12410.068
325.88424/72070.059
334.9049/9990.049
343.9244/11230.039
352.995/1670.030
362.1823/10530.022
371.5210/6590.015
381.0013/12990.010
390.624/6410.006
400.374/10930.004
410.202/9970.002
420.101/9830.001
430.051/21170.000
440.021/50640.000
450.010.0000.000
460.000.0000.000
470.000.0000.000
480.0000.000

Damage given successful save · DieRoll · mean 13.750

outcome%fracX
40.000.0000.000
50.010.0000.000
60.071/14950.001
70.301/3310.003
80.9937/37380.010
92.5231/12310.025
105.1845/8690.052
118.82395/44770.088
1212.7125/9880.127
1315.484/5450.154
1416.0193/12040.160
1514.251/3580.142
1610.8115/10660.108
176.9177/11140.069
183.7069/18640.037
191.6220/12310.016
200.572/3530.006
210.151/6720.001
220.031/37190.000
230.000.0000.000
240.0000.000

Run, read, and check

Full mean is 28; successful-save mean is 13.75, not 14. Half the possible probability mass is on odd totals, where rounding loses half a point, giving a mean loss of 1/4. Half-damage range is 4–24.

Change one thing

Use one d6 instead: full mean 3.5, rounded-half mean 1.5. Verify by writing transformed faces 0,1,1,2,2,3.

Try it yourself

Why is this not the overall expected damage to a target? Answer: it conditions on the save result. You must also know the target’s save chance; L32 builds that full scoped question. Checkpoint: keep the conditioning statement in every output label.

Rules and model notes

D&D Basic Rules 2014, Fireball and the basic round-down convention. Base third-level spell, one target; no resistance, vulnerability, Evasion, or other damage reductions.

What you now know / where next

Round each result, not the average is the reusable idea. Follow the generated previous/next links below, or return to the course index. For a complete self-contained application, see fireball-half-damage.

Content ID: L20 · Review status: pilot

Prerequisites: L19