0

$2x_1+x_2+x_3+2x_4 = 54$. I know how to solve it when the coefficient of each variable is one but how to solve this kind of question?

What if I use this approach: Let $y1 = 2x_1, y2 = x_2, y3 = x_3, y4 = 2x_4,$
$y_1+y_2+y_3+y_4 = 54$
Without restriction:
C(54+4-1,4-1) = C(57,3)
Subtract y1 or y4 is odd:
C(53+4-1, 4-1) = C(56,3)
Add back y1 and y4 are odd:
C(52+4-1, 4-1) = C(55,3)

So the answer is like: C(57,3)-2*C(56,3)+C(55,3) = 55

Is this approach valid?

N. F. Taussig
  • 79,074
4445se
  • 35
  • I believe you might want to write what you have already tried yourself. Usually questions like this might get taken down (although not by me, currently) if there is nothing in the way of "I tried this, but this did not work". – Ben123 Oct 12 '23 at 00:35
  • 1
    Well, I'd start by noting that a necessary condition is for $x_2$ and $x_3$ to have the same parity, so that $x_2+x_3=2n$ for some non-negative even number $n.$ Then you can divide both sides by $2$ to solve. – Cameron Buie Oct 12 '23 at 00:38
  • Someone asked this exact question very recently. Was that you, 4a5es? – Gerry Myerson Oct 12 '23 at 12:54

3 Answers3

3

You can try using generating functions, it should be the coefficient of $x^{54}$ in the function $$f(x) = \left(\sum_{n\geq 0} x^{2n} \right)^2\left(\sum_{n \geq 0}x^n\right)^2 = \frac{1}{(1-x)^2(1-x^2)^2}.$$

You should be able to get the exact answer by doing a partial fraction decomposition.

Lee Fisher
  • 2,749
1

Your attempt is incorrect since the variables $y_1$ and $y_4$ can be odd. For instance, the ordered quadruple $(7, 9, 11, 10)$ satisfies the equation $2x_1 + x_2 + x_3 + 2x_4 = 54$, as do the ordered quadruples $(12, 5, 7, 9)$, and $(5, 13, 9, 11)$.

You evidently know that the number of solutions of the equation $$x_1 + x_2 + \cdots + x_k = n$$ in the nonnegative integers is given by the formula $$\binom{n + k - 1}{k - 1}$$

Since $x_2 + x_3 = 54 - 2x_1 - 2x_4$ is even, $x_2$ and $x_3$ must have the same parity, as Cameron Buie pointed out in the comments.

Let's consider cases.

Suppose $x_2$ and $x_3$ are both even. Then there exist nonnegative integers $y_2$ and $y_3$ such that $x_2 = 2y_2$ and $x_3 = 2y_3$. Substituting $2y_2$ for $x_2$ and $2y_3$ for $x_3$ in the equation $$2x_1 + x_2 + x_3 + 2x_4 = 54 \tag{1}$$ yields \begin{align*} 2x_1 + 2y_2 + 2y_3 + 2x_4 & = 54\\ x_1 + y_2 + y_3 + x_4 & = 27 \tag{2} \end{align*} Notice that equation $2$ is an equation in the nonnegative integers. Therefore, it has $$\binom{27 + 4 - 1}{4 - 1}$$ solutions.

Suppose $x_2$ and $x_3$ are both odd. Then there exist nonnegative integers $z_2$ and $z_3$ such that $x_2 = 2z_2 + 1$ and $x_3 = 2z_3 + 1$. Substituting $2z_2 + 1$ for $x_2$ and $2z_3 + 1$ for $x_3$ in equation $1$ yields \begin{align*} 2x_1 + 2z_2 + 1 + 2z_3 + 1 + 2x_4 & = 54\\ 2x_1 + 2z_2 + 2z_3 + x_4 & = 52\\ x_1 + z_2 + z_3 + x_4 & = 26 \tag{3} \end{align*} Notice that equation $3$ is also an equation in the nonnegative integers. Therefore, it has $$\binom{26 + 4 - 1}{4 - 1}$$ solutions.

Since the two cases are mutually exclusive and exhaustive, you can obtain the number of solutions of equation $1$ in the nonnegative integers by adding the number of solutions of equation $3$ to the number of solutions of equation $2$.

N. F. Taussig
  • 79,074
1

The generating function for the number of solutions in non-negative integers of $$2x_1+x_2+x_3+2x_4 = r$$ is $$f(x) = \frac{1}{(1-x)^2 (1-x^2)^2}$$ We want $[x^{54}]f(x)$, the coefficient of $x^{54}$ when $f(x)$ is expanded as an infinite series. Note that $$\begin{align} f(x) &= \frac{(1-x^2)^2}{(1-x)^2} \cdot \frac{1}{(1-x^2)^4} \\ &= (1+x)^2 \cdot \frac{1}{(1-x^2)^4} \\ &= (1+2x+x^2) \cdot (1-x^2)^{-4} \\ &= (1+2x+x^2) \cdot \sum_{i=0}^{\infty} \binom{4+i-1}{i} x^{2i} \end{align}$$ by the Binomial Therem for negative exponents. So $$\begin{align} [x^{54}]f(x) &= [x^{54}](1+2x+x^2) \cdot \sum_{i=0}^{\infty} \binom{4+i-1}{i} x^{2i} \\ &= [x^{54}] \sum_{i=0}^{\infty} \binom{4+i-1}{i} x^{2i} + 2[x^{53}]\sum_{i=0}^{\infty} \binom{4+i-1}{i} x^{2i} \\ & \qquad + [x^{52}]\sum_{i=0}^{\infty} \binom{4+i-1}{i} x^{2i} \\ &= \binom{4+27-1}{27} + 2 \cdot 0 +\binom{4+26-1}{26} \\ &= 7714 \end{align}$$

awkward
  • 15,626
  • Hi, could you have a look at how this problem could be solved using generating functions ? Regards. https://math.stackexchange.com/questions/4906875/combination-theory-solve-for-case-where-x-i-leq-1 – true blue anil Apr 30 '24 at 06:01