# Number of solutions with restrictions

What did I do wrong ?

How many integer solutions are there to the equation $x_1 + x_2 + x_3 = 15$ subject to the constraints that $x_1 ≥ 1$, $x_2 ≥ 1$, $x_3 ≥ 1$?

Putting $y_1=x_1-1$, $y_2=x_2-1$ and $y_3=x_3-1$, we have the equation $y_1+y_2+y_3=10$.

So now I can use the proposition that says that the number of solutions of $x_1+x_2+...+x_k=n$ is $\binom {n+k-1}{k-1}$.

So, for $y_1+y_2+y_3=10$ we have $\binom {10+3-1}{3-1}=\binom {12}{2}=66$.

However, Wolfram Alpha says it has $90$ solutions.

• @windircurse I tried it on Wolfram Alpha but it says it has $90$ solutions. However $\binom {12} {2} =66$ – Amateur Mathematician Jun 15 '17 at 12:56

When you swapped the variables, you wrongly subtracted 1s.

$$x_1+x_2+x_3=15$$ $$y_1+1+y_2+1 +y_3+1=15$$

$$y_1+y_2+y_3=12$$

So the solution is

$$\binom{12+3-1}{3-1}=\binom{14}{2}=91$$

• It looks correct to me too. Thanks for noticing my error. Still, do you know why Wolfram says $90$ instead of $91$ solutions? – Amateur Mathematician Jun 15 '17 at 13:13
• @AndreMath says 91 right here, maybe you typed it wrong wolframalpha.com/input/?i=x%2By%2Bz%3D15,+x%3E0,+y%3E0,+z%3E0 – windircurse Jun 15 '17 at 13:16
• @AndreMath It says here wolframalpha.com/input/… it has 90 solutions, but I think they treated (for some reason) the solution $x=13, y=1, z=1$ seperately and didn't count it with other solutions. You can see that solution is separated from others under the Solutions tab – windircurse Jun 15 '17 at 13:23
• @windicurse Thanks mate. I'm back to study. Cya around – Amateur Mathematician Jun 15 '17 at 13:26