1

Determine the number of ordered triple $(x, y, z)$ of integer numbers (negatives and positives) satisfying $|x| + |y| + |z| \le 6$

I know that final answer is 377, but how?

Edit:

Drawing from David K's answer:

One way to count the ways is to first do the ways for which $x > 0,$ $y > 0,$ and $z > 0.$ That's the number of ways to put $6$ or fewer indistinguishable balls into $3$ numbered bins under the constraint that every bin must have at least one ball, which is the number of ways to put $3$ or fewer indistinguishable balls in $3$ numbered bins without that constraint, which is the number of ways of putting exactly $3$ indistinguishable balls in $4$ numbered bins. Multiply by $8$ to take into account all the cases where $x < 0$ or $y < 0$ or $z < 0.$

$x,y,z >0 => x + y + z <= 3, n = Cr(3+4-1,3) * (8) = 160$

Now let $x = 0,$ $y > 0,$ and $z > 0.$ Count the number of ways to put up to $6$ balls in $2$ bins if each bin must contain at least one ball. Multiply by four to account for all the cases were $y < 0$ or $z < 0.$ Multiply that result by $3$ to account for the fact that we could have chosen $y= 0$ or $z=0$ instead of $x = 0.$

$x=0, x,y>0 => y+z <=6, n = Cr(4+3-1, 4) * 3 * 14 = 180$

Now let $x = y = 0$ and $z > 0.$ There are $6$ ways for that to happen. Multiply by $2$ to account for $z < 0,$ then by $3$ to account for the other choices of which variables are zeros.

$x,y = 0, z>0 => z<=6, n = 6 * 2 * 3 = 36$

$x,y,z=0, n = 1$

Sum of all of them is : 160 + 180 + 36 + 1 = 377

robjohn
  • 345,667
Esmaeil
  • 121
  • 1
    I don't see how you can get to $377$ with just negatives and positives. Are you sure that zeroes are allowed? – bof Mar 21 '19 at 21:07
  • I am sure the answer is 377, because I have it from a book, but I don't know how they reach to this answer as well. – Esmaeil Mar 21 '19 at 21:11
  • @bof Good point. My Python says disallowing zeroes reduces the number of solutions to $160$, while allowing them gets $377$. – J.G. Mar 21 '19 at 21:11
  • 1
    Please give more context. Providing context not only assures that this is not simply copied from a homework assignment, but also allows answers to be better directed at where the problem lies and to be within the proper scope. Please avoid "I have no clue" questions. Defining keywords and trying a simpler, similar problem often helps. – robjohn Mar 21 '19 at 22:32
  • @Esmaeil: what book? What topics are covered in the section where this question arose? Have you tried anything? perhaps the number of pairs that sum to less than or equal to $m$? – robjohn Mar 21 '19 at 22:35
  • @Esmaeil: I have written an answer, but unless there is more context provided, it would not be in the best interests of the site, as explained in How to ask a good question, to post the answer. – robjohn Mar 21 '19 at 22:46
  • This is an test question, I find the answer key, but not solution. It must be solve with recursive methods. Thanks of all. – Esmaeil Mar 21 '19 at 22:51
  • And Thanks @robjohn, This is my first question. I will read your suggested document (how to ask a good question) it is very useful – Esmaeil Mar 21 '19 at 23:01
  • I have moved the attempt from the comment to David K's answer to the question. This seemed to be enough context that I undeleted my answer. – robjohn Mar 28 '19 at 15:44

5 Answers5

1

One way to count the ways is to first do the ways for which $x > 0,$ $y > 0,$ and $z > 0.$ That's the number of ways to put $6$ or fewer indistinguishable balls into $3$ numbered bins under the constraint that every bin must have at least one ball, which is the number of ways to put $3$ or fewer indistinguishable balls in $3$ numbered bins without that constraint, which is the number of ways of putting exactly $3$ indistinguishable balls in $4$ numbered bins. Multiply by $8$ to take into account all the cases where $x < 0$ or $y < 0$ or $z < 0.$

Now let $x = 0,$ $y > 0,$ and $z > 0.$ Count the number of ways to put up to $6$ balls in $2$ bins if each bin must contain at least one ball. Multiply by four to account for all the cases were $y < 0$ or $z < 0.$ Multiply that result by $3$ to account for the fact that we could have chosen $y= 0$ or $z=0$ instead of $x = 0.$

Now let $x = y = 0$ and $z > 0.$ There are $6$ ways for that to happen. Multiply by $2$ to account for $z < 0,$ then by $3$ to account for the other choices of which variables are zeros.

Finally add $1$ for the case $x = y = z = 0,$ which was not covered by any of the other cases.

The total will be $377$ if you do all these calculations correctly.

David K
  • 98,388
  • $x,y,z >0 => x + y + z <= 3, n = Cr(3+4-1,3) * (8) = 160$ as explained in paragraph one

  • $x=0, x,y>0 => y+z <=6, n = Cr(4+3-1, 4) * 3 * 14 = 180$ as explained in paragraph two

  • $x,y = 0, z>0 => z<=6, n = 6 * 2 * 3 = 36$ as explained in paragraph three

  • $x,y,z=0, n = 1$

  • Sum of all of them is : 160 + 180 + 36 + 1 = 377

    – Esmaeil Mar 21 '19 at 22:26
  • paragraph one where? paragraph two where? paragraph three where? This information should be included in the question, not simply a comment to an answer. – robjohn Mar 21 '19 at 22:39
  • I write in comment, because I try @David method. But he did not calculate it himself then I do to show he find correct method. – Esmaeil Mar 21 '19 at 22:56
  • @Esmaeil: Oh, I see. These are paragraphs in David K's answer. I didn't understand before. Good! Adding this to your question to show your attempt would be very good. – robjohn Mar 21 '19 at 23:17
  • @Esmaeil: It is pretty important that you add this attempt as context to the question; otherwise, the question may be closed (there is already one close vote) and possibly deleted. – robjohn Mar 21 '19 at 23:29
  • I have moved the attempt to the answer. – robjohn Mar 28 '19 at 15:40