Let there be an equation, $$a_1x_1+a_2x_2+\dots+a_nx_n=S$$ Here, $a_i$ where $i=1,2,\dots,n$ are positive integers, also S is a positive integer too. How many non-negative integral solutions does the above equation have?
For example $3x+y+z=24$ has 117 integral solutions. Can you also verify it with this result?
I am not looking for a Java program to solve it and I am in 10 standard so a bit of explanation will help a lot.
We can solve it with the help of "finding a probability using a multinomial". If in the equation, $$a_1x_1+a_2x_2+...+a_nx_n=S$$ a)Zeroes are not considered blanks, the number of solution of the equation =coefficient of $x^n$ in $$(1+x^{a_1}+x^{2a_1}+..)(1+x^{a_2}+x^{2a_2}+..)...(1+x^{a_n}+x^{2a_n}+..)$$ $$=(1-x^{a_1})^{-1}(1-x^{a_2})^{-1}...(1-x^{a_n})^{-1}$$ b)Zeroes are considered as blanks, the number of solution of the equation =coefficient of $x^n$ in $$(x^{a_1}+x^{2a_1}+..)(x^{a_2}+x^{2a_2}+..)...(x^{a_n}+x^{2a_n}+..)$$ $$=(x^{a_1+a_2+a_3+...+a_n})(1-x^{a_1})^{-1}(1-x^{a_2})^{-1}...(1-x^{a_n})^{-1}$$
Now there are many ways to find the coefficient i.e.,synthetic multiplication of polynomials, calculating the $n^{th}$ derivative of the multinomial using cauchy integral formula and many other ways.