Dice: Rolling at least N successes where number of succeses vary by dice value

combinatoricsdiceprobability

Rules

I have four different types of dice: six-, eight-, ten- and twelve-sided (d6, d8, d10 & d12, respectively).

The number of successes vary by the value rolled (and thus indirectly by dice type).

  • One success is gained by rolling 6 or 7.
  • Two successes are gained by rolling 8 or 9.
  • Three successes are gained by rolling 10 or 11.
  • Four successes are gained by rolling 12.

This means that a 1d6 can result in at most 1 success, 1d8 1-2 successes, 1d10 1-3, and 1d12 1-4.

Successes are added together after the roll, so rolling 6 dice and getting [12, 3, 8, 7, 10, 1] will result in 4 + 2 + 1 + 3 = 10 successes.

Input is the number of dice and how many sides they have, and the minimum amount of successes I want to achieve.

Question

My main question is this:

Given that I roll a known combination of d6s, d8s, d10s and d12s, how do I calculate the probability of rolling N or more successes? Q1

(though feel free to answer any other questions in this post as well, indexed Q$n$ for your convenience)

Context

I know how to calculate the probability of rolling at least $N$ successes for an arbitrary number of d6's, since they can only yield one success at most.

I am stuck, however, when it comes to calculating at least $N$ successes when rolling a mix of differently sided dice, where some of them can yield more than one success.

For example, with $5$d6, $1$d8, $1$d12, how likely am I to roll $\geq$ 4 successes? Q2


EDIT: It's been brought to my attention that there is no closed form solution to this question.

That is fine; any solution or clever approximation that's more efficient than running 100k simulated rolls is a sufficient answer.

Can the problem be split into separate probabilities that can later be combined? E.g., given 5d6 & 1d12 and that I'm looking for the probability of at least $k$ successes, can I calculate the probabilities for each die type separately and later combine them somehow? Q3

Also, how would I go about calculating $\geq k$ successes for 1d12? For 2d12? For $n$d12? Q4

Currently, I can 'solve' the problem by running a simulation, but it irks me that I am not able come up with anything better.

Best Answer

Representation via generating functions

This isn't satisfactory in the sense that we still cannot obtain a closed form, but the representation is concise and easily programmable. Suppose we have $(k_6, k_8, k_{10}, k_{12})$ dice of types d6, d8, d10, and d12 respectively. Let \begin{align*} f_6(x) &= \left(\frac{5}{6}+\frac{1}{6}x\right)^{k_6} \\ f_{8}(x) &= \left(\frac{5}{8}+\frac{2}{8}x+\frac{1}{8}x^2\right)^{k_8} \\ f_{10}(x) &= \left(\frac{5}{10}+\frac{2}{10}x+\frac{2}{10}x^2+\frac{1}{10}x^3\right)^{k_{10}}\\ f_{12}(x) &= \left(\frac{5}{12}+\frac{2}{12}x+\frac{2}{12}x^2+\frac{2}{12}x^3+\frac{1}{12}x^4\right)^{k_{12}} \\ f(x) &= f_6(x)f_8(x)f_{10}(x)f_{12}(x) \end{align*} Let $N$ be the random variable denoting the total number of successes (slightly different notation from your post, where you let $N$ represent the value of interest). Then, the probability of getting exactly $n$ successes is \begin{align*} P(N = n) =[x^n]f(x) \end{align*} where $[x^n]f(x)$ is the coefficient of $x^n$ of $f(x)$. The cumulative distribution function (i.e. the probability of getting $n$ successes or fewer) is \begin{align*} P(N \le n) = [x^n]\frac{f(x)}{1-x} \end{align*} And so \begin{align*} P(N \ge n) = 1 - [x^{n-1}]\frac{f(x)}{1-x} \end{align*}

Finite-Sample Upper Bound

Let \begin{align*} K = k_6 + k_{8} + k_{10} + k_{12} \end{align*} and so the proportion of the $K$ dice which are d6, d8, d10, and d12 are respectively \begin{align*} (p_6, p_8, p_{10}, p_{12}) = (k_6, k_8, k_{10}, k_{12})/K \end{align*} Let $N_k \in \{0, \cdots, 4\}$ ($k = 1, \cdots, K$) be the random variable denoting the success number for each die, and \begin{align*} X_m = \sum_{k=1}^{K}\mathbb{I}(N_k = m) \end{align*} denote the number of successes produced from the $K$ dice. Then the proportion of the $K$ dice falling in each $m$ ($m = 0, \cdots, 4$), is \begin{align*} q_0 &= \frac{5}{6}p_6 + \frac{5}{8}p_8 + \frac{5}{10}p_{10} + \frac{5}{12}p_{12} \\ q_1 &= \frac{1}{6}p_6 + \frac{2}{8}p_8 + \frac{2}{10}p_{10} + \frac{2}{12}p_{12} \\ q_2 &= \frac{0}{6}p_6 + \frac{1}{8}p_8 + \frac{2}{10}p_{10} + \frac{2}{12}p_{12} \\ q_3 &= \frac{0}{6}p_6 + \frac{0}{8}p_8 + \frac{1}{10}p_{10} + \frac{2}{12}p_{12} \\ q_4 &= \frac{0}{6}p_6 + \frac{0}{8}p_8 + \frac{0}{10}p_{10} + \frac{1}{12}p_{12} \end{align*} So, $(X_0, \cdots, X_4) \sim \text{Multinomial}(K, (q_0, \cdots, q_4))$.

Finally, \begin{align*} P(N \ge n) &= P\left(\sum_{m=0}^{4} mX_m \ge n\right) \\ &= P\left(\exp\left(t\sum_{m=0}^{4} mX_m\right) \ge \exp(tn)\right) & z \mapsto e^{tz} \text{ is increasing for } t>0\\ &\le \frac{E\left[\exp\left(t\sum_{m=0}^{4} mX_m\right)\right]}{e^{tn}} & \text{Markov's inequality} \\ &= e^{-nt}\left(\sum_{m=0}^{4}q_m e^{mt}\right)^K \\ &= \left(\sum_{m=0}^{4}q_m e^{t(m - K^{-1}n)}\right)^K \end{align*} and so we can form the Chernoff bounds \begin{align*} P(N \ge n) \le \left(\inf_{t>0}\sum_{m=0}^{4}q_m e^{t(m - K^{-1}n)}\right)^K \end{align*}

Example

Let's suppose we have $(k_6, k_8, k_{10}, k_{12}) = (5, 7, 11, 13)$ and want to find $P(N \ge 30)$. Then \begin{align*} P(N \ge 30) = 1 - [x^{29}]\frac{f(x)}{1-x} = 1- \frac{56649270689104302470179125877}{148888471031133469396697088000} \approx 0.6195 \end{align*} Using the Chernoff bound with \begin{align*} K = 36, \mathbf{q} = (0.5405, 0.1931, 0.1456, 0.0907, 0.0301) \end{align*} We find that the infimum is attained at $t^* = 0.0894$ giving us $P(N \ge 30) \le 0.8453$.