0

I wish to know how many elements are there in the set $$ S_{n,k} = \left\{(n_1,\ldots, n_k): \forall i,n_i \in \mathbb Z, n_i \geq 0, \sum_i n_i = n\right\}. $$

It appears to me that we have a simple formula for $|S_{n,k}|$ presumably in terms of binomial coefficients, but I find it hard to come up with that.

At least for $k=3,$ we have the simple expression $|S_{n,k}| = \frac12 (n+1)(n+2)$, and this is very easy to derive. But after this point, the sums gets very complicated.

Ma Joad
  • 7,420

1 Answers1

0

We wish to put $k-1$ bars among $n$ stars. The number of ways to do this is simply $$ {n+k-1 \choose k-1}. $$

Ma Joad
  • 7,420