How does one find the number of integral solutions of equations like,
$2x + 5y + 4z = 20$
I know how to do this counting if the coefficient of every variable on the LHS is $1$. But I don't know how to do this counting with arbitrary coefficients.
How does one find the number of integral solutions of equations like,
$2x + 5y + 4z = 20$
I know how to do this counting if the coefficient of every variable on the LHS is $1$. But I don't know how to do this counting with arbitrary coefficients.
The linear equation $2x + 5y + 4z = 20$ has a two-parameter family of infinite solutions in integers. Note that $y$ has to be even. Further any even $y$ will give a one parameter family of infinite solutions for the equation $2x + 4z = 20 - 5y$.
Let $y = 2y_1$. Then we need to solve $2x + 4z = 20 - 10y_1 \implies x + 2z = 10 -5y_1$.
Hence, the set of all integer solutions is the two parameter family $$(10-5y_1-2z_1,2y_1,z_1)$$ where $y_1,z_1 \in \mathbb{Z}$
If you are interested in non-negative integral solutions for $(x,y,z)$, then we need $y_1 \geq 0$,$z_1 \geq 0$ and $5y_1 + 2z_1 \leq 10$.
This implies $y_1 \in \{0,1,2\}$.
If $y_1 = 0$, then $z_1 = \{0,1,2,3,4,5\}$.
If $y_1 = 1$, then $z_1 = \{0,1,2\}$.
If $y_1 = 2$, then $z_1 = \{0\}$.
Hence, the set of all non-negative solutions are $$\{ (10,0,0),(8,0,1),(6,0,2),(4,0,3),(2,0,4),(0,0,5),(5,2,0),(3,2,1),(1,2,2),(0,4,0) \}$$
The set of all positive solutions are $$\{(3,2,1),(1,2,2)\}$$