2
$\begingroup$

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.

1 Answers 1

2

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.

  • 0
    Thank you very much for the quick answer! I wonder, though, if it's possible to reach a solution in a way which didn't involve producing a table by hand, like in a stars-and-bars case? I'm asking this because the next step of the problem will envolve a third term of the form $4(x_{11}+\ldots)$, and so on. Although the answer you gave works, I was hoping there could be a way involving some general combinatorial result.2017-02-22
  • 0
    @GonçaloQuinta I would suggest generating functions. The expression you have above is equivalent to $(1+x^3)^4(1+x^2)^6$, and you then need to sum the coefficients from $x^5$ to $^{12}$. In general, a term $nx_i$ where $x_1=0,1$ multiplies the generating function by $1+x^n$, and this is easily implemented in a computer.2017-02-22
  • 0
    That is exactly what I was looking for! This is still magic to me, I'm not familiar with generating functions at all although I know that they exist and are very useful. Thank you very much.2017-02-22