Finding number of non negative integral solutions of $a+2b+3c+4d=20$

Solution 1:

See, that $d\leq 5$, $c\leq \left\lceil \frac{20-4d}{3}\right\rceil $, $a$ and $b$ can be then obtained in $n_{d,c}=\left\lceil\frac{20-4d-3c+1}{2}\right\rceil $ ways.

  1. $d=5$
    • $c=0$ : $n_{5,0}=1$ ($[0,0,0,5]$)
  2. $d=4$
    • $c=0$ : $n_{4,0} =3$ ($[0,2,0,4]$, $[2,1,0,4]$, $[4,0,0,4]$)
    • $c=1$ : $n_{4,1} =1$ ($[1,0,1,4]$)
  3. $d=3$
    • $c=0$ : $n_{3,0} =5$
    • $c=1$ : $n_{3,1} =3$
    • $c=2$ : $n_{3,2} =2$
  4. $d=2$
    • $c=0$ : $n_{2,0} =7$
    • $c=1$ : $n_{2,1} =5$
    • $c=2$ : $n_{2,2} =4$
    • $c=3$ : $n_{2,3} =2$
    • $c=4$ : $n_{2,4} =1$
  5. $d=1$
    • $c=0$ : $n_{1,0} =9$
    • $c=1$ : $n_{1,1} =7$
    • $c=2$ : $n_{1,2} =6$
    • $c=3$ : $n_{1,3} =4$
    • $c=4$ : $n_{1,4} =3$
    • $c=5$ : $n_{1,5} =1$
  6. $d=0$
    • $c=0$ : $n_{0,0} =11$
    • $c=1$ : $n_{0,1} =9$
    • $c=2$ : $n_{0,2} =8$
    • $c=3$ : $n_{0,3} =6$
    • $c=4$ : $n_{0,4} =5$
    • $c=5$ : $n_{0,5} =3$
    • $c=6$ : $n_{0,6} =2$

The number of ways is then equal to: $$1+4+10+19+30+44=108$$