Number of Integer solution of the equation |x|+|y|+|z| = 10
We will use
combination with repetition.
Suppose |x|,|y|,|z| are all positive. In that case, if we rewrite |x|=a+1, |y|=b+1, |z|=c+1, we will get a+b+c=7.
There are C(7+3-1, 7)= 36 ways to distribute 7 objects into 3 boxes.
But x=-a-1, y=-b-1, z=-c-1 are also solutions. So there are 2
3x36=288 ways.
Suppose two of |x|, |y|, |z| are 0. These two can be selected in C(3, 2) ways.
So there are 2xC(3, 2) = 6 ways.
Suppose only one of |x|, |y|, |z| is 0. This one can be selected in C(3, 1) ways.
Let |x|=0 and |y|=b+1, |z|=c+1.
We will get b+c = 8.
There are C(8+2-1,8) = 9 ways to distribute 8 objects into 2 boxes.
Since y, z can be negative, there are 2
2xC(3, 1)xC(8+2-1,8) =108 ways.
In total, there are 288+108+6 = 402 ways.
More general case:|x
1|+|x
2|+...+|x
r| = n
Suppose k of them are non-zero.
Let |x
i| = a
i + 1 where i is a positive integer less than k+1.
Σa
i+1 = n
Σa
i = n-k
n-k objects can be distributed k boxes in C((n-k)+k -1, n-k) = C(n-1, n-k) ways.
The non-zero ones can be selected in C(r, k) ways.
Each none-zero can be negative.
So if k of r numbers are non-zero,
z
k = 2
k.C(r, k).C(n-1, n-k)
Total number of ways is
Σ
rk=1 2k.C(r, k).C(n-1, n-k)For our case:r=3, n=10
Σ
3k=1 2k.C(3, k).C(10-1, 10-k) = 2
1.C(3, 1).C(10-1, 10-1) + 2
2.C(3, 2).C(10-1, 10-2)[/b] + 2
3.C(3, 3).C(10-1, 10-3)
= 2.C(3,1).C(9,9) + 4.C(3,2).C(9,8) + 8.C(3,3).C(9,7)
= 6 + 108 + 288
= 402