0

$k$ different dice are thrown. Find generating function for number of ways the sum of dice numbers can be maximum $n$.

My approach is this:

$x_1+x_2+...+x_k \leq n$ so that $1 \leq x_i\leq 6$

Next, I want $x$ to be $0 \leq x_i\leq 5$, and I will have equation:

$x_1+x_2+...+x_k \leq n - k$

I know how to solve the problem if $x_1+x_2+...+x_k = n - k$, but I do not know how to solve if it is $\leq$. Is my approach okay?

untitled
  • 413
  • 1
    For the moment, ignore that the variables have upper bounds. To enumerate all non-negative integer solutions to $$x_1 + \cdots + x_k \leq n,$$ simply alter the equation to $$x_1 + \cdots + x_k + c = n,$$ where $c$ is also required to be a non-negative integer. Just in case you need help dealing with the upper bounds on $x_1,\cdots, x_k$, you can consult this more general problem. – user2661923 Sep 20 '22 at 08:38
  • 1
    Re my last comment, for what it's worth, I don't know anything about generating functions. So, while I can solve the problem (i.e. enumerate the number of satisfying solutions) without generating functions, I have no idea how to set up the corresponding generating function. – user2661923 Sep 20 '22 at 08:43
  • 1
    See https://math.stackexchange.com/questions/1696372/generating-function-question-with-an-inequality-and-finding-the-closed-form – Magdiragdag Sep 20 '22 at 08:53

1 Answers1

1

Fix $k$, let $a_n$ be the number of ways to get sum exactly $n$, and let $A(z)=\sum_{n=0}^\infty a_n z^n$ be the generating function. Then $$A(z)=(z^1+z^2+z^3+z^4+z^5+z^6)^k.$$ To obtain the generating function for the number of ways to get sum at most $n$, compute $$\sum_{n=0}^\infty \sum_{m=0}^n a_m z^n = \sum_{m=0}^\infty a_m \sum_{n=m}^\infty z^n = \sum_{m=0}^\infty a_m\frac{z^m}{1-z} =\frac{A(z)}{1-z}.$$

RobPratt
  • 50,938