The number of ways to put $N$ balls in $M$ boxes without any other restrictions is given by $\dbinom{N+M-1}{M-1}$. However, I couldn't find any simple explanation as to why it is true, is there any intuitive way to understand it?
Thanks in advance.
The number of ways to put $N$ balls in $M$ boxes without any other restrictions is given by $\dbinom{N+M-1}{M-1}$. However, I couldn't find any simple explanation as to why it is true, is there any intuitive way to understand it?
Thanks in advance.
Imagine we want to put $7$ stars in $3$ bins. We can use a visual representation to show how we organise them: $$★ ★ ★ ★ | ★ | ★ ★$$
The bars split the different bins. So, according to this graph, $4$ stars are in the first bin, $1$ star is in the second bin and $2$ stars are in the third bin.
Then, the total number of ways to put $7$ stars in $3$ bins is just the number of ways to sort the $7$ stars and $2$ bars. The number of ways happen to be $\binom{7+3-1}{7}$ since there are $7+3-1$ objects and $3-1$ bars in total in the visual representation.
In general, a visual representation of sorting $N$ balls into $M$ bins would have $M-1$ bars and $N+M-1$ objects in total. The number of ways to sort these objects is $$\binom{N+M-1}{M-1}$$