Number of solutions to linear equation $x_1+x_2+\dots+x_n=m$ when the domain of $x_i\ne$ domain of $x_j$

63 Views Asked by At

In the lecture notes of one of my previous classes, it was used that if we have an equation of the form $$\tag{1} x_1+x_2+\dots+x_n=m $$ then the total number of solutions, when each $x_i$ is a non-negative integer, can be written $$\tag{2} C(m+n-1, m)=\frac{(m+n-1) !}{(n-1) ! \cdot m !} $$ so that, for example, $$\tag{3} x_1+x_2+x_3=14,\qquad x_{1,2,3}\in\mathbb{N}\cup\{0\} $$ has $C(14+3-1,14)=120$ solutions. However, what if each $x_i$ is restricted to a different subset of the positive integers? For example, if we in eq. $(3)$ need $x_1>1$, $x_2>0 $, and $x_3>3$, is there a formula to determine the total number of solutions?