# Probability question

Homework Helper
Gold Member
Show that there are $\binom{r}{k}\binom{n-1}{n-r-k}$ solutions to the equation $x_1+...+x_r=n$ for which exactly k of the r terms of the sum are nul.

There are $\binom{r}{k}$ ways of choosing which k of the r $x_i$'s are zero, and there are

$$\binom{n+(r-k)-1}{n}$$

distinc solutions to the resulting equation. What is wrong with that? If nothing, how are the two binomial coefficients equal?

0rthodontist
It says exactly k must be null. So once you've chosen your 0's, the remaining variables must take values >= 1.

AKG
There are $\binom{r}{k}$ ways to choose which boxes will be empty. Now put your n balls in a row, and observe there are n-1 gaps between adjacent balls. Pick r-k-1 of these gaps (there are $\binom{n-1}{r-k-1} = \binom{n-1}{(n-1)-(r-k-1)} = \binom{n-1}{n-(r-k)}$ ways to do this). The bunch of balls occuring before the first chosen gap goes in the first of the boxes that wasn't chosen to be empty. The next bunch of balls (occuring between the first and second chosen gaps) goes in the next of the boxes that wasn't chosen to be empty.