Finding number of non negative integral solutions of $a+2b+3c+4d=20$ How to find out the number of non negative integral solutions of an equation containing 4 variables, for eg, say, ${a+2b+3c+4d=20}$?
I mean, we can calculate it quite easily for equations containing 2 variables, but what about equations containing 4 variables.?
 A: 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.


*

*$d=5$


*

*$c=0$ : $n_{5,0}=1$ ($[0,0,0,5]$)


*$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]$)


*$d=3$


*

*$c=0$ : $n_{3,0} =5$ 

*$c=1$ : $n_{3,1} =3$ 

*$c=2$ : $n_{3,2} =2$ 


*$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$ 


*$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$ 


*$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$$
A: The number of non-negative integral solutions of the equation a+2b+3c+4d=20 is:
P(20,1)+P(20,2)+P(20,3)+P(20,4) = 1+10+33+64 = 108
The meaning of the notation P(n,k)= m (partition of n into k parts) is the following:
there are m different ways to write n as summation of exactly k non-zero terms.The order of terms doesn't matter.
Note that the general formula giving the number of integral solutions of equations of the type a+2b+3c+4d+...wz=n is  P(n,1)+P(n,2)+P(n,3)+...P(n,w)
