**Question:**

Argue that there are exactly $\displaystyle \binom{r}{k}\binom{n-1}{n-r+k}$ solutions of $\displaystyle x_{1}+x_{2}+\cdots+x_{r}=n$ for which exactly $\displaystyle k$ of the $\displaystyle x_{i}$ are equal to $\displaystyle 0$.

**My Logic:**

I started by interpreting $\displaystyle \binom{r}{k}$ to be the number of ways you can select $\displaystyle k$ out of the $\displaystyle r$ terms to be zero. But, I can't figure out what \binom{n-1}{n-r+k} does. I think the $\displaystyle n-1$ part is essentially saying you line up $\displaystyle n$ ones and create a spot between each one where you can insert a bar. I.e. if $\displaystyle n=8$ you have something like:

1 | 1 | 1 | 1 | 1 | 1 | 1 | 1

Where the |'s are possible places to insert a bar. In which case it seems to me that you would want to choose $\displaystyle r-k-1$ bars giving you $\displaystyle \binom{n-1}{r-k-1}$. Can someone please point out to me where my logic is flawed? Thanks.