1

Let's consider rolling a fair dice (d6) three times (3d6) and summing up their number of points. Therefore, you have a minimum sum of 3 and a maximum of 18. For both, the amount of permutations with repetition equals 1 ({1,1,1} {6,6,6}). For a sum of 4, one has 3 permutations {1,1,2} {1,2,1} {2,1,1}. I was wondering if there is any way to calculate this using a formular. Especially, this gets interesting when combining multiple non-cubic dices, increasing the complexity. Basic combinatoric formulars seem to not appeal to this problem. I also thought about using the normal distribution, however this set of data is discreet. Binomial distribution also does not work here, as we consider 6 pathways at each knot.

Thank you very much in advance. :)

xByNilzz
  • 13
  • 2
  • See this answer for a blueprint of how to combine Inclusion-Exclusion with Stars-And-Bars to attack this generic type of problem. Basically, you want the number of solutions to $~x_1 + \cdots + x_k = n,~$ where $~n~$ is the desired sum, and $~k~$ is the number of dice. Each variable $~x_i~$ is constrained by $~x_i \in {1,2,\cdots,6}.~$ – user2661923 Feb 18 '24 at 15:56
  • 1
    You can use generating functions: for example $(x+x^2+x^3+x^4+x^5+x^6)$ represents a six-sided die (and similarly with other numbers of sides). Take the cube of this for $3$ six-sided dice (more generally use products if the dice vary) and then expand to get $x^3+3x^4+6x^5+ \cdots+ x^{18}$, which tells you there is $1$ way of getting a sum of $3$, $3$ ways of getting a sum of $4$, $6$ ways of getting a sum of $5$, and so on to $1$ way of getting a sum of $18$. This also works for larger more complicated cases, though it may be easier to use recursion to do the practical calculations. – Henry Feb 19 '24 at 13:34

1 Answers1

1

You need to distribute a sum between three summands, each is not greater than $6$. This is the inclusion-exclusion with limitations type of a problem. The answer can be found here. The formula is right at the end of the page ($m=3$ is the number of rolls, $R=6$ is a maximum roll, $k=13$ is the sum, $\binom ab=0$ if $a<b$).

For example let us calculate the number of permutations with the sum equal to $13$:

$$ \sum_{t=0}^3(-1)^t\binom3t\binom{3+13-(6+1)t-1}{3-1}=$$ $$= \sum_{t=0}^3(-1)^t\binom3t\binom{15-7t}{2}=$$ $$= \binom{15}2-\binom31\binom{8}2 =105-3\cdot 28=105-84=21.$$

Indeed, here are all $21$ of the rolls:

661 652 643 634 625 616

562 553 544 535 526

463 454 445 436

364 355 346

265 256

166

Aig
  • 4,178
  • At first I'd like to thank you for your helpful response. Second, I'd like to ask if one can modify this term in a way so it fits for multiple dices that are not of the same type, for example rolling 1d6 and 1d10 (which would technically not be a dice ofc.) and calculating their number of permutations with the sum qual to a number? – xByNilzz Feb 19 '24 at 16:33
  • I think, for this type of situation it is easier to use generating functions, i.e. consider the product $(x+x^2+…+x^6)(x+x^2+…+x^{10})$, expand and calculate its coefficients. – Aig Feb 19 '24 at 16:42
  • For example look at the coefficient of $x^{13}$ in this expansion. You will find the same $21$ as in my answer. – Aig Feb 19 '24 at 16:46