# Probability Mass Function of infinitely re-rolled dice

I play a game called Shadowrun. It is a role-playing game that uses a dice pool mechanic. A player has a dice pool of $x$ six-sided, unbiased dice. Every 5 or 6 counts as a success. The more successes, the better. Calculating this probability is easy (it's a simple binomial distribution with number of trials $n = x$ and probability of success $p = \frac{1}{3}$).

However, every player has an additional attribute called Edge, $y$. Edge can be used in one of two ways:

a) It allows a player to take all the dice that didn't roll a success in the first attempt and roll them again. Any successes achieved this way add to the result.

b) It allows a player to add their Edge to the total number of dice they roll and any dice that rolled a 6 can be rolled again and if they roll a success, that adds to the result; if any of the dice rolled a 6 again, they can be rerolled. This can be done until the dice no longer roll a six. This is called "exploding dice".

The player can only do one or the other, not both and they can use this ability a limited number of times per game.

My question is: which one is better, given a pool of $x$ and Edge $y$ - or more precisely - is there a simple way of expressing the probability mass function of method B? I have found a simple function for method A and a long, computationally intensive one for method B, but I wonder if there is a way of simplifying it. Below is my work so far.

Thanks for your help and I apologise if this question has been asked before (I looked, I could find things regarding exploding and adding the result, but not just adding 1 to the successes with infinite explosions) and sorry if I'm breaking unwritten community rules - it is my first post here.

# A. The Reroll

The first method is to reroll the dice that failed on the first try. This means the methods of achieving a success are:

• Roll a 5 or 6 (probability $\frac{1}{3}$)
• Roll a 1, 2, 3, 4 (probability $\frac{2}{3}$) and then reroll to a 5 or 6 (probability $\frac{1}{3}$) Therefore the probability of succeeding on a single dice roll is: $$p = \frac{1}{3} + \frac{2}{3} \cdot \frac{1}{3} = \frac{5}{9}$$ This leads to a binomial distribution: $$Pr(X = s) = \binom{x}{s} \left(\frac{5}{9}\right)^s \left(\frac{4}{9}\right)^{x-s}$$ Where $x$ is the dice pool and $s$ is the desired number of successes.

# B. The Exploding Dice

For this part I am going to simplify my notation a bit. I am going to use a subscript to indicate the number of dice rolled and I am going to ommit the $X =$ part in the probability function, e.g. $Pr_7(4)$ is the probability of achieving 4 successes on 7 dice. I will be using $s$ to denote a number of successes

## 1 die

I didn't have a clear idea how to approach this, so I started with a single die. In order to achieve:

• 0 successes: the roll must be 1-4
• 1 success: the roll must be 5 or a 6 followed by a 1-4
• 2 successes: the roll must be 6 followed by a ,5 or followed by a 6 followed by a 1-4 I can note that as: $$Pr_1(0) = \frac{2}{3}$$ $$Pr_1(1) = \frac{1}{6} + \frac{1}{6} \cdot \frac{2}{3} = \frac{1}{6} \cdot \frac{5}{3}$$ $$Pr_1(2) = \frac{1}{6} \cdot \frac{1}{6} + \frac{1}{6} \cdot \frac{1}{6} \cdot \frac{2}{3} = \left(\frac{1}{6}\right)^2 \cdot \frac{5}{3}$$ $$Pr_1(s) = \left(\frac{1}{6}\right)^s \cdot \frac{5}{3} \quad for \; s > 0$$

## 2 dice

So here my approach was similar, using combinations:

• 0 successes: the number of successes must be 0 on Dice 1 and 0 on Dice 2
• 1 success: the number of successes must be 1 on Dice 1 and 0 on Dice 2; or 0 on Dice 1 and 1 on Dice 2
• 2 successes: the number of successes must be 2 on Dice 1 and 0 on Dice 2; or 1 on Dice 1 and 1 on Dice 2; or 0 on Dice 1 and 2 on Dice 2

Similarly, I can note this using the previously calculated one-die probabilities: $$Pr_2(0) = Pr_1(0)Pr_1(0)$$ $$Pr_2(1) = Pr_1(1)Pr_1(0) + Pr_1(0)Pr_1(1)$$ $$Pr_2(2) = Pr_1(2)Pr_1(0) + Pr_1(1)Pr_1(1) + Pr_1(0)Pr_1(2)$$ $$Pr_2(s) = \sum_{n=0}^{s} Pr_1(s-n)Pr_1(n)$$

## 3 dice

I am going to spare you the repeat - this time I need to iterate through three dice, which I can write as: $$Pr_3(s) = \sum_{m=0}^{s-n}\sum_{n=0}^{s} Pr_1(s-n-m)Pr_1(n)Pr_1(m)$$

## Any pool

So techinically, for $x + y$ dice (remembering that we add the Edge to the pool in method B) I can write an extremely cumbersome formula that basically iterates through all the possible combinations of parameters and uses single-die probabilities to calculate the total probability. The problem is that for pools even as small as 10 dice, this is thousands of possible combinations and just seems a bit brute-force-y. Does anybody have any idea how to simplify this. For completeness, I am attaching the formula:

$$Pr_{x+y}(s)= \sum_{n_{1}=0}^{s} \sum_{n_{2}=0}^{s - n_{1}} \sum_{n_{3}=0}^{s - n_{1} - n_{2}} \cdots \sum_{n_{x+y}=0}^{s - \sum_{a=1}^{x+y-1} n_a} \left[Pr_1\left(s- \sum_{b=1}^{x+y} n_b\right) \cdot \prod_{c=1}^{x+y} Pr_1(c) \right]$$

• What a great username for a SR question! Just to make sure I got all the parameters: Given a pool $x$ and edge $y$, and a desired number of successes $s$, we want to determine if method A (having an option on a reroll) or method B (adding edge to your pool and having explosive dice) has the higher probability to get at least $s$ successes? Would some kind of simulation satisfy you? – Roland May 27 '16 at 17:18
• Yes, that is correct. Technically I have a method, but it requires a huge amount of computation for larger pools, so I'm looking for something simpler. – Mr Johnson May 27 '16 at 17:19
• "It allows a player to add their Edge to the total number of dice they roll." I'm not sure I understand this. It reads like if Edge $= y$, then the player rolls $x+y$ dice instead of $x$ dice (and then the successful dice all explode in the manner described above). Is that right? Can you clarify if not? – Brian Tung May 27 '16 at 17:22
• You are correct. – Mr Johnson May 27 '16 at 17:25
• For method A, the current formula is assuming that you are going to use the reroll action every time - but you only have to use it if you don't hit at least $s$ successes. Since the use of edge is a limited resource, this could also be reflected somehow. – Roland May 27 '16 at 17:46

Scenario $B$ is equivalent to a scenario where each die has success probability $\frac23$ on the first roll and $\frac16$ on all further rolls, and is rerolled as long as it succeeds. We can use this to express the distribution as a single convolution, instead of the $(x+y)$-fold convolution that you wrote.

The probability for $k$ of $m=x+y$ dice to succeed on the first roll is

$$\binom mk\left(\frac13\right)^k\left(\frac23\right)^{m-k}\;.$$

In the second part of the experiment, instead of rerolling $k$ dice we can imagine the same die being rerolled until it has failed $k$ times. The probability for this to happen after $s$ additional rolls, yielding $s-k$ additional successes, is

$$\binom{s-1}{k-1}\left(\frac56\right)^k\left(\frac16\right)^{s-k}\;.$$

Thus, the probability for a total of $s$ successes is

$$\sum_{k=0}^s\binom mk\left(\frac13\right)^k\left(\frac23\right)^{m-k}\binom{s-1}{k-1}\left(\frac56\right)^k\left(\frac16\right)^{s-k}\\ =\left(\frac23\right)^m\left(\frac16\right)^s\sum_{k=0}^s\binom mk\binom{s-1}{k-1}\left(\frac52\right)^k\;.$$

• ...so in order to get the probability to get at least $S$ successes, one needs to sum the last expression from $s$ to $\infty$, correct? – Roland May 28 '16 at 9:37
• This answer seems to overlook parts of OP's problem. First of all, rolling a 5 or a 6 always counts as 1 success, no matter if it's after the initial roll or not. So [...] where each die has success probability 2/3 on the first roll and 1/6 on all further rolls is not true. Scenario B is equivalent to a scenario where each die always has a success chance of 1/3 (not 2/3) and a 1/6 chance to add another die to the pool to follow these same rules For instance I have 4 dice, I roll 6 6 5 3, reroll the two 6s I get 6 5, reroll the one 6 again to a 5 : This roll yielded 6 success : 6 6 5 6 5 5 – Eregrith Oct 10 '18 at 17:38
• Thus, the following part is also not correct. You don't get one reroll per success, and so you can't equate additionnal successes = k = rerolled successes at 1/6 chance. But, your answer might be completed by adding those non-rerollable successes on top of the formula, it simply is an additionnal 1/6 chance per reroll to have a "normal" success. – Eregrith Oct 10 '18 at 17:40