0
$\begingroup$

I am trying to derive a closed form for computing the number possible outcomes of rolling $k$ dices such that the sum is $n$.

This seems to be the problem of finding number of positive integral solution of an equation $$x_1+x_2+\cdots+x_k=n$$ with $x_1,x_2,\cdots,x_n \in [1,6] $,but here a solution $(a,a,a,a,\cdots \text { k-times} )$ is not considered different.

Direct application of stars and bars gives a closed form $\binom{n-1}{2} \times k \binom{n-7}{2}$ but this is not working for all the cases, For example the case of $n=16$ and $k=3$,what exactly should I modify in my approach?

Similar (but particular) question in M.SE.

$\endgroup$
4
  • $\begingroup$ A much better fit for m.se. $\endgroup$ Oct 24, 2011 at 21:19
  • 2
    $\begingroup$ The definition of "different" is incomprehensible. Difference is a binary relation. State precisely when two dice roles are considered the same. $\endgroup$ Oct 25, 2011 at 0:43
  • 2
    $\begingroup$ One problem with directing this question to Math.StackExchange is that it has been asked there before but most of the answers have been wrong or misleading. $\endgroup$ Oct 25, 2011 at 8:49
  • $\begingroup$ @Douglas Zare:That is the reason I posted it here,I see it is closed now,but I guess I got my answer :) $\endgroup$
    – user18748
    Oct 25, 2011 at 13:46

1 Answer 1

1
$\begingroup$

Answer is given by the coefficient of $z^n$ in $$(z+z^2+\dots+z^6)^k = \left(z\frac{1-z^6}{1-z}\right)^k = z^k (1-z^6)^k(1-z)^{-k}.$$ An explicit formula for this coefficient is: $$\sum_{i=0}^{\min(k,\lfloor (n-k)/6\rfloor)} (-1)^{n+i} \binom{k}{i} \binom{-k}{n-k-6i} = \sum_{i=0}^{\min(k,\lfloor (n-k)/6\rfloor)} (-1)^i \binom{k}{i} \binom{n-6i-1}{k-1}.$$

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.