# Different solutions of $x+y+z=10$ where $x$, $y$, $z$ are positive integers.

The number of solutions $(x,y,z)$ of the equation $x + y + z =10$, where $x$, $y$ and $z$ are positive integers.

1) $(x,y,z)$ any two can be same integers also.
2) $(x,y,z)$ different integers.

What are the different methods by which we can solve this?

• When I meant (x,y,z) are the same integers. x=y and z not equal to x or y. Any two can be equal.
– Zero
Apr 11, 2013 at 18:24
• Hint: Every solution can be represented in a unique way by a binary string of zeroes and ones.
– user60725
Apr 11, 2013 at 18:25

$$(1)$$ For the first problem, we have a version of the "stars and bars" problem (see Theorem 1 at the link): this is where x, y, z must be non-zero. The explanation given at the link (entry from Wikipedia) provides a very nice description of the nature of this sort of problem, and how the solution can be obtained.

The number of solutions to the equation $$x + y + z = 10$$ where $$x, y, z$$ are positive integers, is given by $$\binom{k - 1}{n - 1},\;\;\text{where in this case} \quad k = 10,\;\;n = 3,\;\;\text{ giving us}\quad \binom{9}{2}$$

$$(2)$$ Since $$x + y + z = 10$$, the only way that $$x = y = z$$ is a solution is if $$x + y + z = x + x + x = 3x = 10$$, but this means $$x$$ would not be an integer. So there is no solution in integers for the equation for which all three variables are equal integers. Hence, for the second part of your question, the answer will be precisely what it is for the first part.

For the second question, if you cannot have that any $$2$$ of $$x, y, z$$ are equal, then we can subtract the cases when $$x = y, y = z, x = z$$ from the total number of solutions obtained from $$(1)$$.

• Is it 9 choose 2?
– Koba
Apr 11, 2013 at 18:40
• Yes, $\binom{9}{2}$ reads "$9$-choose-$2$" Apr 11, 2013 at 18:41
• With links and all! +1 Apr 12, 2013 at 0:31