[Math] The number of k-element multisets whose elements all belong to [n]

combinatoricselementary-number-theoryproof-writing

$\binom{n+k-1}{k}$

Hello. The above formula refers to the number of k-element multisets whose elements all belong to [n]. I am unsure of the proof, particularly the proof involving bijections. Could someone provide the proof?

Best Answer

For any $k$-element multiset of $[n]$,

Let $a_i=\#\text{of occurrences of}~i~\text{in the multiset}$

We have then $a_1+a_2+\dots+a_n = k$ and each $a_i$ is a non-negative integer.

The set of solutions to the above equation are in direct bijection with the $k$-element multisets of $[n]$ using an obvious bijection: $(a_1,a_2,\dots,a_n) \leftrightarrow \{a_1\cdot 1,a_2\cdot 2,\dots,a_n\cdot n\}$ using multiplicity notation for multisets.

Now, the non-negative integer solutions to $a_1+a_2+\dots+a_n=k$ can be seen via "stars and bars", relating such a solution as a sequence of $n-1$ bars and $k$ stars. The bijection being

  • $a_1=\#$of stars to the left of the first bar
  • $a_n=\#$ of stars to the right of the final bar
  • $a_i = \#$ of stars between the $i^{th}$ and $(i -1)^{st}$ bar for each other $i~$

So, the question has been reduced to how many sequences of length $n-1+k$ have exactly $n-1$ $B$'s and $k$ $S$'s. The answer being $\binom{n-1+k}{n-1}=\binom{n-1+k}{k}$