Sum of m dice rolled n times where sum of each dice is lower than some value

62 Views Asked by At

Let there be $m$ dice (not neccessarily all same-sided, but even when they are I don't have a solution).
Each dice is rolled $n$ times.
The sum of $n$ rolls of all dice needs to be $T$.
The sum $X_i$ of $n$ rolls of die $i$ should be smaller than $K_i$

Let's call the sum of rolls of die i $X_i$, then I'm looking for:

$Prob(\sum^m_{i=1} X_i = T \ |\ X_i<K_i \ \forall i)$

Or just the number of possibilities (the count).

$Prob(\sum^m_{i=1} X_i = T)$ and $Prob(X_i<K_i \ \forall i)$ is easy to compute but I don't know how to compute the intercept.

1

There are 1 best solutions below

2
On

I can only do this numerically for given $m$, $n$, and $K_1,K_2,\ldots, K_m$.

Let me lead you through an example. Suppose that all the dice are six sided, $n=3$, $m=4$, $K_1=8$, $K_2=10$, and $K_3=12$, $K_4=13$.

Let $P_{ij}$ be the probability that $X_i=j$ given that $X_i<K_i$ with $j=1,2, \ldots, 18$.

The probabilities that $X_i$ is $3,4,5,\ldots$, and 18 are $\frac{1}{216},\frac{1}{72},\frac{1}{36},\frac{5}{108},\frac{5}{72},\frac{7}{72},\frac{25}{216},\frac{1}{8},\frac{1}{8},\frac{25}{216},\frac{7}{72},\frac{5}{72},\frac{5}{108},\frac{1}{36},\frac{1}{72}$, and $\frac{1}{216}$ respectively.

To get the first row of the $P$ matrix, we just take the probabilities that $X_1$ is $1,2,\ldots 7$ and divide them by Prob($X_1<8$) to get $$ \left(0,0,\frac{1}{35},\frac{3}{35},\frac{6}{35},\frac{2}{7},\frac{3}{7},0,0,0,0,0,0,0,0,0,0,0\right). $$ Proceeding similarly, we get the matrix $$ P=\left( \begin{array}{cccccccccccccccccc} 0 & 0 & \frac{1}{35} & \frac{3}{35} & \frac{6}{35} & \frac{2}{7} & \frac{3}{7} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & \frac{1}{81} & \frac{1}{27} & \frac{2}{27} & \frac{10}{81} & \frac{5}{27} & \frac{7}{27} & \frac{25}{81} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & \frac{1}{135} & \frac{1}{45} & \frac{2}{45} & \frac{2}{27} & \frac{1}{9} & \frac{7}{45} & \frac{5}{27} & \frac{1}{5} & \frac{1}{5} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & \frac{1}{160} & \frac{3}{160} & \frac{3}{80} & \frac{1}{16} & \frac{3}{32} & \frac{21}{160} & \frac{5}{32} & \frac{27}{160} & \frac{27}{160} & \frac{5}{32} & 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} \right). $$

Now that we have the probabilities of $P_{ij}=$Prob($X_i=j| X_i<K_i$), we use convolution to compute the probability that $\sum X_i=T$ when the $X_i$ are less than the $K_i$.

The probability distribution of $X_1+X_2$ given that the $X_i$ are less than the $K_i$ is merely the convolution of rows 1 and 2 of the $P$ matrix. $$ P_1*P_2 =(0,0,0,0,0,\frac{1}{2835},\frac{2}{945},\frac{1}{135},\frac{8}{405},\frac{2}{45},\frac{11}{135},\frac{368}{2835},\frac{167}{945},\frac{13}{63},\frac{113}{567},\frac{25}{189}). $$ So, for example P($X_1+X_2=7|\, X_1<8\ \mathrm{and\ } X_2<10$) is 2/945.

We convolve all four rows of $P$ to get the PDF of $T$ $$ (0,0,0,0,0,0,0,0,0,0,0,\frac{1}{61236000},\frac{1}{5103000},\frac{13}{10206000},\frac{13}{2187000},\frac{13}{583200},\frac{23}{324000},\frac{1}{5040},\frac{47}{94500},\frac{1931}{1701000},\frac{146081}{61236000},\frac{18989}{4082400},\frac{21589}{2551500},\frac{15767}{1093500},\frac{235639}{10206000},\frac{355267}{10206000},\frac{3028889}{61236000},\frac{16901}{255150},\frac{63149}{756000},\frac{673583}{6804000},\frac{2243929}{20412000},\frac{2325041}{20412000},\frac{3351011}{30618000},\frac{98533}{1020600},\frac{14029}{182250},\frac{331291}{6123600},\frac{32821}{1020600},\frac{269}{18144},\frac{25}{6048},0). $$

For example, the probability that $T$ is 35 given that $X_1<8, X_2<10, X_3<12$, and $X_4<13$ is 14029/182250.