# Linear Diophantine Equation Signs

How to determine the coefficient signs for the solution of a linear diophantine equation?

Take $24x + 69y = 33$ for example.

I know the solution is $x = 33 − 23k , y = −11 + 8k$, and I understand fully how to arrive at the values, but how do I determine the sign on the coefficients?

In other words, why is $23k$ negative, and why is $8k$ positive?

Through all the examples I can find, there seems to be no pattern.

• All that matters here is that these two signs are opposite: $33+23k$ and $-11-8k$ work just as well. – Lord Shark the Unknown Aug 17 '18 at 4:10
• – farruhota Aug 17 '18 at 5:16

You want to parameterize the solutions to the equation$$24x + 69y = 33$$

You know that $(x_0, y_0) = (33, -11)$ is a solution.

\begin{align} 24(\phantom{3}x) + 69(\phantom{-1}y) &= 33 \\ 24(33) + 69(-11) &= 33 &\text{(subtract)} \\ \hline 24(x-33) + 69(y+11) &= 0 \end{align}

Since $24$ divides $24(x-33)$, then it must also divide $69(y+11)$.

Since $24$ and $69$ are relatively prime to each other, then we must have $24$ divides $y+11$. So, for some integer $t, \ y+11 = 24t$. Hence $y=24t-11$. We can now solve for $x$.

\begin{align} 24(x-33) + 69(y+11) &= 0 \\ 24(x-33) + 69(24t-11+11) &= 0 \\ 24(x-33) + 69(24t) &= 0 \\ 24(x-33) &= -69(24t) &\text{Note the change in sign.} \\ x-33 &= -69t \\ x &= -69t + 33 \end{align}

And you get \begin{align} x &= -69t + 33 \\ y &= 24t - 11 \end{align}

If you let $t=-u$, you get \begin{align} x &= 69u + 33 \\ y &= -24u - 11 \end{align}