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