Good Day! How are you doing?
I recently learnt that the formula for the number of non-negative solutions to the equation ${x_1 + x_2 + ... + x_r = n}$ is ${n+r-1 \choose r-1}$. It can also be easily proven using the circles and bars (or whatever you wanna call it). But my reasoning was as follows:
To find the number of non-negative integer solutions to the equation ${x_1 + x_2 + ... + x_r = n}$, suppose that there are $n$ balls and $r$ boxes to put it. Then the number of ways to put the $n$ balls into $r$ boxes is ${r^n}$ (There are $r$ ways to put the balls into the boxes). But this is clearly different.
I know I am over-counting but I don't know how exactly. I would be grateful to you if you helped me. I know I am missing out on something and not realizing it. This question may sound stupid or trivial to you, but I am just not able to realize where I am over-counting.
Thanks!