3

I am trying to solve a problem using permutation/combination but cannot figure out how to proceed.

Suppose the sum of three variables $x, y, z$ is $30$. If $x\ge2, y\ge0, z\ge-3$, how many integer solutions exist?

I understand that $2\le x\le33, 0\le y\le31, -3\le z\le28$. A simple simulation shows that there are $528$ solutions. However, I am unable to calculate this mathematically. I would like a hint so that I can try this on my own.

N. F. Taussig
  • 76,571
an4s
  • 3,716
  • There is a way to count solutions to $x+y+z=n$, where $x,y,z$ are the variables and $n$ is constant, and you are given $x,y,z\ge 0$, using stars and bars. See if you can transform your question into this one. – Mike Earnest Sep 07 '18 at 21:24
  • I just made the 1k th profile view of your account! – Arjun Aug 22 '20 at 18:49

4 Answers4

3

From $$x+y+z=30 \Rightarrow (x-2)+y+(z+3)=31 \Rightarrow x_1+y+z_1=31\\ x_1\geq0,y\geq0,z_1\geq0$$ which has $\binom{33}{2}=528$ integer solutions.

With more details, this is the generating function:

$$(1+x+x^2+...+x^k+...)^3=\frac{1}{(1-x)^3}= \frac{1}{2}\left(\frac{1}{1-x}\right)^{''}=\\ \frac{1}{2}\left(\sum\limits_{k=0}x^k\right)^{''}= \sum\limits_{k=2}\frac{k(k-1)}{2}x^{k-2}$$ and the coefficient of $x^{31}$ is the answer.

rtybase
  • 16,907
2

Set $a=x-2$, $b=y$ and $c=z+3$.

The problem is the same as finding the number of sums $a+b+c=31$ where $a,b,c$ are nonnegative integers.

Now apply stars and bars.

drhab
  • 151,093
2

I started by fixing x=2, and counting all the solutions in y and z. For x = 2, we need $y+z=28$. Now, fixing y determines z. For y=0, z=28; y=1, z=27; ...; y=31, z = -3. So, we can count 32 solutions when x=2.

Then, I fixed x=3 and counted all the solutions in y and z again. A pattern emerges quickly.

Another hint:

$\sum_{i=0}^{32}$ i = 528$

  • 1
    So as we increase the value of $x$ by $1$, the number of solutions for that value of $x$ decreases by $1$ as well until we are left with $x = 33, y = 0, z = -3$. Therefore, the total number of solutions is essentially $32 + 31 + 30 + \cdots + 1$. – an4s Sep 07 '18 at 21:41
2

We wish to find the number of solutions of the equation $$x + y + z = 30 \tag{1}$$ in the integers subject to the restrictions that $x \geq 2$, $y \geq 0$, and $z \geq -3$.

Let $x' = x - 2$, $y' = y$, and $z' = z + 3$. Then $x', y', z'$ are nonnegative integers. Substituting $x' + 2$ for $x$, $y'$ for $y$, and $z' - 3$ for $z$ in equation 1 yields \begin{align*} x' - 2 + y' + z' + 3 & = 30\\ x' + y' + z' & = 31 \tag{2} \end{align*} Equation 2 is an equation in the nonnegative integers. A particular solution of equation 2 corresponds to the placement of two addition signs in a row of $31$ ones. For instance, $$1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 +$$ corresponds to the solution $x_1 = 21$, $x_2 = 10$, $x_3 = 0$, while $$1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1$$ corresponds to the solution $x_1 = 7$, $x_2 = 11$, $x_3 = 13$. The number of solutions of equation 2 is the number of ways we can place two addition signs in a row of $31$ ones, which is equal to the number of ways we can select which $2$ of the $33$ positions required for $31$ ones and $2$ addition signs will be filled with addition signs.

$$\binom{31 + 2}{2} = \binom{33}{2} = \frac{33!}{2!31!} = \frac{33 \cdot 32 \cdot 31!}{2 \cdot 1 \cdot 31!} = \frac{33 \cdot 32}{2} = 33 \cdot 16 = 528$$

N. F. Taussig
  • 76,571