# Find the number of solutions?

Find the number of integral solutions for the equation $x_1+ x_2 + x_3 + x_4 + x_5 + x_6 = 31$

where $x_1 ≥ 1, x_2 ≥ 2, x_3 ≥ 2, x_4 ≥ 4, x_5 ≥ 6, x_6 ≥ 5?$

I have no idea how to proceed here ? I read somewhere that this question can also be done using generating function, an approach using generating function's will be appreciated.

• Call $x_1'=x_1-1, x_2'=x_2-2$ and so on. Then you have to solve how many solutions for $x_1'+ \dots + x_6' = 31-1-2-2-4-6-5$ for nonnegative integers $x_i'$. Oct 27, 2016 at 9:04
• It isn't specified that $x_i's$ are integers. So how many solutions can then be there ? Oct 27, 2016 at 9:08
• @trueblueanil thanks for pointing out my mistake. Corrected now:) Oct 27, 2016 at 9:10
• Just look around some and you will get your question answered plenty times. E.g math.stackexchange.com/questions/1171340/…
– ctst
Oct 27, 2016 at 9:18

Let $y_1 = x_1, y_2 = x_2-1, y_3 = x_3-1, y_4 = x_4-3, y_5 = x_5-5, y_6 = x_6 - 4$. Then $y_1+y_2+y_3+y_4+y_5+y_6 = 17$ and we have all $y_i$ positive integers. The number of solutions, by stars and bars method is $\binom{16}{5}$

• here $y_i \geq 1$ right? Oct 27, 2016 at 9:30
• Positive integer means $\geq 1$.
– user348749
Oct 27, 2016 at 9:37
• Yes i know that, i mean to say $y_1+y_2+y_3+y_4+y_5+y_6 = 11$ when $y_i \geq 0$ gives $\left(\begin{array}{c}16\\ 5\end{array}\right)$ Oct 27, 2016 at 9:44
• Yes, you are correct.
– user348749
Oct 27, 2016 at 9:46

If it is given, $x_i \geq a_i,$ we may say $x_i=y_i+a_i(y\geq0). [i=1,2,...,r]$

So, $\sum x_i=n$ can be transformed to $\sum (y_i+a_i)=n\implies \sum y_i=n- \sum a_i=N.$

Now, you know that the number of solutions to this equation as $y \geq 0$ is $\binom{N+r-1}{r-1}.$

Hope this helps you solve the probelem yourslf as it's always more fun to do so.

• $(y_1 - 1) + (y_2 - 2) +(y_3 - 2) + (y_4 - 4) + (y_5 - 6) + (y_6 - 5) = 31$. So, $\sum_{i=1}^6 y_i = 11$ and number of non-negative solutions is equal to coefficient of $x^{11}$ in expansion of $(1-x)^{-6}$ which is equal to $\left(\begin{array}{c}16\\ 11\end{array}\right)$ Oct 27, 2016 at 9:24
• what if we are required to find positive integral solutions only? can same be applied. Oct 27, 2016 at 9:27
• @mcjoshi As you have been given bounds for $x_i$, see that they are positive integers only. Oct 27, 2016 at 9:47
• Ohh! i get it now I confused $y_i$ as the solution which includes $y_i = 0$ too, but the actual solutions are $x_i$ which are positive integrals. Thanks! Oct 27, 2016 at 9:51
• @mcjoshi As $y_i$ are non-negative, we use $\binom{N+r-1}{r-1}$. If $y_i$ were positive then we would have used $\binom {N-1}{r-1}$. Do some research yourself, This is a very common problem. Oct 27, 2016 at 9:52