The math behind exploding dice rolls
Exploding dice is a mechanic that appears in various tabletop games. It works like this: a dice is rolled, if it lands on its maximum values, it “explodes” — the dice is then rolled again, adding the new value to the max value of the dice. If dice again lands on its maximum, the dice explodes a second time. This process continues and may lead to chains of explosions that push the roll total far beyond what is normally expected.
This mechanic appears in a number of tabletop games, with Savage Worlds likely being the most popular system within the RPG space that uses it. In this post, we dig into the infinite nature of exploding dice and explore the math and expected outcomes from this fun mechanic.
Exploding probabilities
Suppose we roll an sided exploding dice. The probability of rolling a non-exploded value, that is between and is no different than a normal dice roll. Each face below appears with equal probability . If instead the dice explodes — which happens with the remaining probability — we add to the outcome of a new exploding dice roll.
Let’s look at an example when we are rolling a 6-sided dice, so . Any result between 1 and 5 appears with probability . How about the probability of rolling a 7? Rolling a 7 requires rolling a 6 on the first roll, triggering the explosion, and then rolling a 1 on the second:
Any value of the exploded dice roll can be written like this — as powers of . Suppose we want to know the probability of rolling a 25 on an exploding d6. Well that’s just rolling 6 four times in a row followed by a 1, so . In general, for an sided dice, the probability of rolling any given value is:
Where represents the rounded down result of dividing by . The probability of rolling a multiple of is 0, because every time a multiple of would show up, it triggers a dice explosion. The below graph shows the outcome probabilities when rolling an exploding d6.
Within a given number of explosions, each outcome is equally likely. As the number of explosions increases, the probability decays rapidly due to the rarity of rolling many 6s in a row. This particular graph cuts off at 18, but in reality it continues to infinity with ever decreasing probabilities.
The probability of at least explosions on an sided dice is . Continuing with the d6 example, we have:
While one or two explosions is fairly common, more beyond that are quite rare, with a less than 1-in-1000 chance that you roll at least 4 explosions on a d6.
Explosive expectations
Another way to understand the effect of the exploding dice mechanic is to look at how it changes the average or expected outcome of a roll. In a previous post, we showed that the expectation of a normal sided dice roll is . It is clear that exploding dice would have a higher average, but by how much?
We’ll calculate this by appealing to something called the law of total expectation. It allows us to write the expectation of an exploding dice roll as follows:
By breaking up our expectation into two distinct cases — exploding and not exploding — we simplify our approach. First, the probability statements are are easily addressed by our previous work:
Next, we consider the expected value of a roll with no explosion. Since each outcome below the maximum value is equally likely, this the same as the expected result of an sided roll. Plugging in to , we get:
The last term, which is the expected value of an exploded dice is less clear, but we can get around it with a little trick. Recall that once a dice explodes, you can view it as a new exploding dice roll with added to the final result. We can express this as:
While it may seem odd to write the original thing that we were trying to solve for — — on the right hand side, it’s perfectly valid to do and will help us later. Now that we have expressions for all four terms in our original expectation equation, we can plug in to get:
The above simplifies to:
We take advantage of our trick by subtracting from both sides to gather all the terms on the right and solve to get:
Careful inspection of our final result shows that the expectation of a normal dice roll appears on in our result, . A succinct way to summarize the effects of the exploding dice mechanic is that it increases the expected result by a factor of .
Revisiting our case, we plug in to see that . A notable increase over the normal average of 3.5. The below graph summarizes the differences over the standard dice from d4 up to d20.
While the effect is of a similar magnitude across different types, it is most significant for low-faced dice. The factor of increase, , quickly approaches 1 as increases, but with few sides it is relatively large. For a d4, the increase from an average roll of 2.5 to one of 3.33, represents a 33% increase. On the other hand, the d20’s 10.5 to 11.05 increase is a meager 5%. The graph below shows percent increase of the exploding mechanic across the standard dice types:
Despite explosions having a consistent increase the expected outcome, as a percent difference, the effect is attenuated for high-sided dice. Such a difference suggests some reasoning behind the prevalence of exploding dice in d6 systems, but less so in those with a greater d20 focus.
Regardless of those differences, exploding dice is a fun mechanic that leads to some interesting math and meaningfully alters outcomes in systems that employ it.