[Math] Number of non-negative distinct integer solutions of $x+y+z+w=10$

combinatoricsinteger-partitions

I understand that there are already many questions relating to this, but my question is regarding some concept of mine that should be working but doesn't produce the right result.

So, I follow an approach similar to stars-and-bars. Let there be 10 underscores like this: _ _ _ _ _ _ _ _ _ _ such that I can insert a | at any of the $11$ empty positions. So, ||_ _ _ _ _ _ _|_ _ _ means $x=0,y=0,z=7,w=3$, which is indeed a solution of given equation. Therefore, to figure out number of distinct solutions for $x+y+z+w=10$, I have to find the number of sets of $3$ places, where I can insert 3 bars, out of the available $11$ places (allowing repetition)

I cannot use $^{11}C_3$ because that does not allow repetitions. By repetition, I mean a combination like |||_ _ _ _ _ _ _ _ _ _ ($x=y=z=0, w=10$) or |_ _ _||_ _ _ _ _ _ _
($x=z=0,y=3,w=7$), i.e. more than 1 bars at same place.

Therefore, each of the three bars has $11$ available positions, and so the result should be $11\cdot11\cdot11=1331$

But the answer is obviously wrong since I already know (from textbook) that it should be $^{N+n-1}C_{n-1}=^{13}C_3=286$

I have read my solution again and again but can't figure out exactly what's the problem with it. Could anybody please spot the problem in my solution?

Best Answer

In your counting method, you would count |||_ _ _ _ _ _ _ _ _ _ once but |_ _ _||_ _ _ _ _ _ _ three times, because you give 11 choices for each bar, so you would count the latter once for each combination of choices:

1_ _ _23_ _ _ _ _ _ _ (note that swapping 2 and 3 here corresponds to the same choices)

2_ _ _13_ _ _ _ _ _ _

3_ _ _12_ _ _ _ _ _ _

Similarly, you would count |_ _ _|_|_ _ _ _ _ _ six times.

Related Question