Q:

Number of integer solutions of two inequalities

The problem is the following: I have the condition
$$5\le3(x_1+x_2+x_3+x_4)+2(x_5+x_6+x_7+x_8+x_9+x_{10})\le12$$
where each $x_i$ can be either 0 or 1. What I need is the total number of possible combinations of $x_i$ that satisfy this condition. 
I get the feeling that this fits into a stars-and-bars type of problem, but in all questions I have found they considered the $x_i$ to have some range of values, not just 0 or 1. I could rename the variables such that the condition would be just the sum of the $x_i$, but I would still need to deal with the fact that the variables could only assume two values.

A:

Let $a$ be the sum of $x_1$ to $x_4$ and $b$ the sum of $x_5$ to $x_{10}$. Clearly $0\le a\le4$ and $0\le b\le6$, and the condition given can be simplified to $5\le3a+2b\le12$. We can make a table showing the $a,b$ values where this condition holds:
  4*
  3**
a 2****
  1 ****
  0   ****
   0123456
      b

Each such pair $(a,b)$ then contributes $\binom4a\binom6b$ distinct ways of assigning 0 or 1 to the ten $x_i$. Summing, this yields 547 valid combinations.

