Integral solutions of a linear equation with constraints

29 Views Asked by At

For linear equation like: $$x_1+ x_2+ x_3+ \dots x_r = n$$ All non negative integral solutions are: $\binom{n+r-1}{r-1}$

CASE I: If constraint is given like $x_1\geq a, x_2\geq b,\dots$ We can approach it like: $$(x_1'+ a)+ (x_2'+ b)+ \dots = n$$

CASE II: But if constraint is given like $a< x_1< a', b< x_2< b',\dots$ For this case, is there any general approach like CASE I ?

Any kind of help would be highly appreciated. Thanks in advance.