Probability Mass Function of infinitely re-rolled dice

615 Views Asked by At

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]$$

1

There are 1 best solutions below

3
On BEST ANSWER

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\;. $$