Find the number of integer non-negative solutions to $$3 x_1+5 x_2+x_3+x_4=10.$$
My proposed solution: First find the possible values for the pairs $(x_1,x_2)$ which are allowed: $(0,0),(0,1),(0,2),(1,0),(1,1),(2,0),(3,0)$, and count solutions for $x_3, x_4$ in each case. Counting for each case is, respectively: 11,6,1,8,3,5,2. They add to a total of 36 solutions.
My problems: Given solution in a book is 30 and I would like to know whether my solution is indeed wrong. Is there a more elegant way to solve this problem and similar problems? I believe my approach is kind of brute force.
your result is true the number of solutions are $36$ for sure. all solutions are listed here:
$ 1 : x_1=0, x_2=0, x_3=0, x_4=10$
$ 2 : x_1=0, x_2=0, x_3=1, x_4=9$
$ 3 : x_1=0, x_2=0, x_3=2, x_4=8$
$ 4 : x_1=0, x_2=0, x_3=3, x_4=7$
$ 5 : x_1=0, x_2=0, x_3=4, x_4=6$
$ 6 : x_1=0, x_2=0, x_3=5, x_4=5$
$ 7 : x_1=0, x_2=0, x_3=6, x_4=4$
$ 8 : x_1=0, x_2=0, x_3=7, x_4=3$
$ 9 : x_1=0, x_2=0, x_3=8, x_4=2$
$ 10 : x_1=0, x_2=0, x_3=9, x_4=1$
$ 11 : x_1=0, x_2=0, x_3=10, x_4=0$
$ 12 : x_1=0, x_2=1, x_3=0, x_4=5$
$ 13 : x_1=0, x_2=1, x_3=1, x_4=4$
$ 14 : x_1=0, x_2=1, x_3=2, x_4=3$
$ 15 : x_1=0, x_2=1, x_3=3, x_4=2$
$ 16 : x_1=0, x_2=1, x_3=4, x_4=1$
$ 17 : x_1=0, x_2=1, x_3=5, x_4=0$
$ 18 : x_1=0, x_2=2, x_3=0, x_4=0$
$ 19 : x_1=1, x_2=0, x_3=0, x_4=7$
$ 20 : x_1=1, x_2=0, x_3=1, x_4=6$
$ 21 : x_1=1, x_2=0, x_3=2, x_4=5$
$ 22 : x_1=1, x_2=0, x_3=3, x_4=4$
$ 23 : x_1=1, x_2=0, x_3=4, x_4=3$
$ 24 : x_1=1, x_2=0, x_3=5, x_4=2$
$ 25 : x_1=1, x_2=0, x_3=6, x_4=1$
$ 26 : x_1=1, x_2=0, x_3=7, x_4=0$
$ 27 : x_1=1, x_2=1, x_3=0, x_4=2$
$ 28 : x_1=1, x_2=1, x_3=1, x_4=1$
$ 29 : x_1=1, x_2=1, x_3=2, x_4=0$
$ 30 : x_1=2, x_2=0, x_3=0, x_4=4$
$ 31 : x_1=2, x_2=0, x_3=1, x_4=3$
$ 32 : x_1=2, x_2=0, x_3=2, x_4=2$
$ 33 : x_1=2, x_2=0, x_3=3, x_4=1$
$ 34 : x_1=2, x_2=0, x_3=4, x_4=0$
$ 35 : x_1=3, x_2=0, x_3=0, x_4=1$
$ 36 : x_1=3, x_2=0, x_3=1, x_4=0$