1

What is the number of m-tuples of non-negative integers, each less than k, whose sum is n ?

For example, if m=3, k=4 and n=5 then there are only 12 possibilities: (0 2 3), (0 3 2), (1 1 3), (1 2 2), (1 3 1), (2 0 3), (2 1 2), (2 2 1), (2 3 0), (3 0 2), (3 1 1), (3 2 0).

1 Answers1

2

Using generating functions is one way to go!

In your example, we want the coefficient of $x^5$ in the expansion of $(1+x+x^2+x^3)^3$. The coefficient does check out to be $12$. (I will let you check for yourself)

In general, you would want the coefficient of $x^n$ from the expansion of $(1+x+ \dots + x^{k-1} )^m$

WaveX
  • 5,580