A question related to stars and bars method

combinatorics

I was reading this question on quora, number of ways to distribute 8 identical balls in 3 different boxes, none being empty, Kavita Chawdhary gave an excellent answer but I was thinking if I remove the condition none being empty then what the answer would be.

★ ★ ★ ★ ★ ★ | ★ | ★

There will be $8$ stars and the $2$ bars can go to any of the $9$ places because there is no restriction now. But it gives $\binom{9}{2}$. But it is not of course what stars bars algorithm says, $\binom{n + k – 1}{n}$. What am I getting wrong?

Best Answer

You have reduced the problem to counting strings of $n=8$ stars and $k-1=2$ bars. There are actually 10 places that the bars can go, not 9, so $\binom{10}{2}$ options. This is equal to the $\binom{n+k-1}{n}=\binom{10}{8}$ by symmmetry of Pascal's triangle.

Related Question