# How many solution for the equation $x+y=m+6$

$$x+ y = m + 6$$ $$1 \le x,y \le 6$$

My calculations are definitely wrong.

I'm trying to solve the following equation instead:

$$w_1+ w_2 = m + 4$$ $$w_1=x-1, w_2=y-2$$ $$0 \le w_1,w_2 \le 5$$

• I'm having a hard time to understand why the amount of solutions for the above equation is equal to the number of solutions for the first one.

Thirdly, to solve the above, I will calculated how many solutions for:

$$w_1+ w_2 = m + 4$$ $$6 \le w_1 (or) 6 \le w_2$$

To calculate how many solutions for the above, I will calculate how many solutions for:

$$w_1+ w_2 = m + 4$$ $$0 \le w_1,w_2$$

Which is $\binom{m+5}{m+4} = m+5$. I solved it by ordering $(m+4)$ a and $1$ b in a line.

and how many solutions for:

$$z_1+ w_2 = m - 2,w_1+ z_2 = m - 2,z_1+ z_2 = m - 8$$ $$z_1=w_1-6, z_2=w_2-6$$ $$6 \le z_1,z_2,0 \le w_1,w_2$$

The amount of solutions for $z_1+ w_2 = m - 2$ is $m-1$. The amount of solutions for $w_1+ z_2 = m - 2$ is $m-1$. The amount of solutions for $z_1+ z_2 = m - 8$ is $m-7$.

So the amount of solutions for $w_1+ w_2 = m + 4$ with the restrication of $6 \le w_1 or 6 \le w_2$ is: (by the Inclusion–exclusion principle)

$$m-1 + m-1 - (m-7) = m+5$$

As you can notice, I'm definitely wrong because the amount of solutions to the same equation with and without restrictions is the same.

The final result for $x+ y = m + 6$ is $0$ which is absolutly wrong.

• Use "\le" for $\le$ Mar 17, 2018 at 12:05

Do u know that no. of "positive integer" solutions of the equation $x_1+x_2+...+x_n=m$ where $x_i$'s & $m$ is positive integer is $\binom{m-1}{n-1}$ So using this putting each $m$ from 0 to 5 , u get the number of solution and then sum it for total solution

• You did not take account the restrictions on x, y. Remember that $x\ge 1$ and $y\le 6$ Mar 17, 2018 at 11:57
• @Manthanein I guess he account cases $x \ge 1$ and $y \le 6$ Because $\binom{m-1}{n-1}$ works for natural solutions Mar 17, 2018 at 12:04
• @Manthanein so I guess the answer is $\sum_{m=0}^{6} \binom{m+5}{1} = 5+6+7+8+9+10+11=56$ Mar 17, 2018 at 12:06
• @openspace Nope that's not the answer. For $m=2$ solution is 7, while for $m=1$ is also 7. This is because the method he used don't account for $y\le 6$. For example in $m=0$ his method finds answer is 5 while answer is 6 Mar 17, 2018 at 12:18
• Why 6? (1,5), (2,4), (3,3), (4,2), (5,1) , there are 5 pairs Mar 17, 2018 at 12:20

Hints

You mean to say $x\ge 1$,$y\le 6$ and $0\le m\le 5$

Then try breaking question into parts like $$x+y=6$$ in this case $m=0$ . Hence by star and bars method we get answer for this case as $6$.

Then try finding solutions for $m=1$ i.e. $$x+y=7$$ again by star and bars method we get solution as $7$ for this case.

Similarly continue for $m=2,3,4,5$ and sum up the result to get final answer.

• $1<=x,y<=6$ . Are we on the same page? Mar 17, 2018 at 11:44
• @StavAlfi Yes of course but the only difference is that while applying star and bars there needs to be taken a precaution about restrictions on x, y which will be more prominent as we go from m=2 to m=5 Mar 17, 2018 at 11:50
• Can you please refer to my mistake in my calculations? Mar 17, 2018 at 17:01

So u have to subtract the case when $y\geq 7$ .

Now let, $x+y=n$ where $x\geq 1$ and $y\geq 7$ now consider $x'=x-1\geq 0$ and $y'=x-7\geq 0$ so this gives $x'+y'=n-8$ so non-negative solution for this is $\binom{n-7}{1}$. This is it u have subtract each step. Let me Know when you finished.

• this is what I have done..... What is my mistake? Mar 17, 2018 at 16:59
• Actually I didn't see your solution. It's totally fine dude Mar 17, 2018 at 17:41

Okay if you consider positive solutions , then answer should be $\displaystyle \sum_{m=0}^{5}\binom{m+5}{1}=45$

If you consider non-negative solutions , then number of solutions for some m is $\binom{n+m-1}{n-1}$, so there will be $\displaystyle \sum_{m=0}^{5}\binom{m+7}{1} = 57$

• I don't know what is your definition of natural but I explicitly specified the range of every variable. Can you please refer to my mistake instead of giving a final solution? Mar 17, 2018 at 18:02
• @StavAlfi edited Mar 17, 2018 at 18:03
• Agian, I explicitly specified the possible range for every variable. $1<=x,y <= 6$ and $0<=m<=5$ Mar 17, 2018 at 18:06
• @StavAlfi the question is : both of $x,y$ more than $1$ and less than $6$ ? Mar 17, 2018 at 18:07
• Sory, I didn't understand what are you asking. Mar 17, 2018 at 18:08