Question 1. Find all non-negative integer a, b, c,d, e such that $$ a+b+c+d+e = 8$$
Question 2. Find all non-negative integer a, b, c,d such that $$ a+b+c+d = 8$$
Question 3. Find all non-negative integer a, b, c such that $$a+b+c = 8$$
Is there any method for this? I have no idea. I can just fix the limit. Thanks!
I think must calculate on Maple or Sage math program. I hope that that someone can help.
Thanks!
I will answer to question 3. For the other answers you can follow a similar reasoning but probably using sage would be a better solution.
1) assume $a,b,c>0$.
Then by stars and bars method you know that there are $\binom{8-1}{3-1}=21$ possible combinations of values between $1$ and $6$ to form you solutions.
(1, 1, 6), (1, 2, 5), (1, 3, 4), (1, 4, 3), (1, 5, 2), (1,6,1)
(2, 1, 5), (2, 2, 4), (2, 3, 3), (2, 4, 2), (2, 5, 1)
(3, 1, 4), (3, 2, 3), (3, 3, 2), (3, 4, 1)
(4, 1, 3), (4, 2, 2), (4, 3, 1)
(5, 1, 2), (5, 2, 1)
(6, 1, 1)
2) assume that either that there is one (and only one) $0$ in $a, b, c$
Then you should find $\binom{3}{1}\binom{8-1}{2-1}=21$ solutions:
(0, 1, 7), (0, 2, 6), (0, 3, 5), (0, 4, 4), (0, 5, 3), (0, 6, 2), (0, 7, 1)
same as before but exchange the first two components
same as before but exchange the first and last components
3) assume that 2 variables out of 3 are zero. Then you should look for $\binom{3}{2}\binom{8-1}{1-1}=3$ solutions
(8, 0, 0), (0, 8, 0), (0, 0, 8)
and you are done. But as you can see Sage would be much quicker!
Edit:
Here it is the Sage script for creating the list of all solutions for the case of 5 variables:
for j in range(5): pippo = Partitions(8, length=j) for i in pippo: Permutations(i+[0]*j).list()Solutions are listed according to the number of variables that are set to 0.