Where am I going wrong in my linear Diophantine solution?

54 Views Asked by At

Let $-2x + -7y = 9$. We find integer solutions $x, y$.

These solutions exist iff $\gcd(x, y) \mid 9$. So,

$-7 = -2(4) + 1$

then

$-2 = 1(-2)$

so the gcd is 1, and $1\mid9$. OK.

In other words,

$(-7)(1) + (-2)(-4) = 1$

Multiply by 9 on each side to get

$(-7)(9) + (-2)(-36) = 9$

$\begin{align} a = -7\\ x_0 = 9\\ b = -2\\ y_0 = -36\\ \end{align}$

Then we end up with

$x' = 9 - 7t, y' = -36 + 2t$

But when $t = 2$, we get $x'(2) = 9 - 7(2) = -5$ and $y'(2) = -36 + 2(2) = -32$ but clearly that's not a solution....

Where am I going wrong?

3

There are 3 best solutions below

0
On BEST ANSWER

If you let $t=0,$ you can see the problem is still there. The issue is that $x_0$ and $y_0$ are the wrong way around: there was a switch after $9$ has been expressed as a linear combination of $-2$ and $-7.$ Since the original equation is $$-2x-7y = 9,$$ and you've shown that $$-2(-36) -7(9) =9,$$ we must have $x_0=-36,y_0=9,$ rather than vice versa.

4
On

$x_0$ should be $-36$ and $y_0$ should be $9$. Somehow they got switched.

0
On

1125588
$-2x-7y=9$
$2x+7y=-9$
$2x=-9-7y$
$x={-\frac{9+7y}2}=-5-4y+{\frac{1+y}2}$
New variable: $a={\frac{1+y}2}$
$y={2a-1}$
$x=-\frac{9+7(2a-1)}2=\frac{-9-14a+7}2=-1-7a$

Check it out: $-2(-1-7a)-7(2a-1)=2+14a-14a+7=9$