"Find y and x such that by + ax = gcd(a,b) in the Gaussian integers"

ksdhart2

Senior Member
Joined
Mar 25, 2016
Messages
1,297
Hi all. I'm having a big brainfart and I can't seem to grasp what I really think is an easy problem. The full text says:

4) For the following pairs (b, a) find y and x such that by + ax = d where d = GCD(a, b).

b) (b, a) = (18 - 16i, 7 - 2i) in the ring Z\displaystyle \mathbb{Z}


I started by dividing

1816i72i=1585376i53\displaystyle \dfrac{18-16i}{7-2i}=\dfrac{158}{53}-\dfrac{76i}{53}

I then rounded each of these values to the nearest Gaussian integer to get 3 - i

(3i)(72i)=1913i    1816i=(3i)(72i)(1+3i)\displaystyle (3-i)(7-2i)=19-13i \implies 18-16i=(3-i)(7-2i)-(1+3i)

That gives me the quotient and remainder to "feed" to the next round of division

72i13i=110+23i10\displaystyle \dfrac{7-2i}{-1-3i}=\dfrac{-1}{10}+\dfrac{23i}{10}

Rounding these values again gives me 0 + 2i

(0+2i)(13i)=62i    72i=(0+2i)(13i)+1\displaystyle (0+2i)(-1-3i)=6-2i \implies 7-2i=(0+2i)(-1-3i)+1

Got another quotient and non-zero remainder, so I go again

13i1=1(13i)+0\displaystyle \dfrac{-1-3i}{1}=1(-1-3i)+0

The remainder is zero, so I stop here. But now I have to build back up, to figure out what x and y are. I tried using the matrix method, but it fell apart:

(1110)(2i110)(3i110)(01)=(1+2i2i)\displaystyle \begin{pmatrix}1&1\\ 1&0\end{pmatrix} \cdot \begin{pmatrix}2i&1\\ 1&0\end{pmatrix} \cdot \begin{pmatrix}3-i&1\\ 1&0\end{pmatrix} \cdot \begin{pmatrix}0\\ 1\end{pmatrix} = \begin{pmatrix}1+2i\\ \:2i\end{pmatrix}

Ought to give me my values for x and y, but it's wrong for some reason.

(1+2i)(1816i)+(2i)(72i)=54+34i\displaystyle (1+2i)(18-16i)+(2i)(7-2i)=54+34i

Instead of giving me the GCD(18-16i, 7-2i) = 1.

Every step I did matches up nicely with the in-class examples we worked... only the end result is wrong for this problem. The only thing I can maybe think of is that the examples we worked all involved only real numbers. Does this method just not work for complex numbers, or something? Any help or insight would be greatly appreciated.
 
Hi ksdhart2,

I notice that this question has been left unanswered for some time, and I don't know if you are still interested in the answer. Anyway, here it goes.;)

I'm not quite familiar with your "matrix method". I will start by explaining how I would solve that using another method, and I will come back later to your method, because the first method can help understanding what is wrong with your approach.

Iin this method, the total amount of computation is the same as with matrices, but it has the advantage that you can check each line of the computation. If the final answer is wrong, this allows you to locate the error more easily.

Let b=1816i\displaystyle b=18-16i and a=72i\displaystyle a=7-2i. The idea is to write a series of equations:

by+ax=z\displaystyle \displaystyle\qquad by + ax = z

and to combine them until we get an equation with z=gcd(b,a)\displaystyle z=\gcd(b,a). Note that gcd(b,a)\displaystyle \gcd(b,a) is defined up to a unit (±1\displaystyle \pm1 or ±i\displaystyle \pm i).

We start with the obvious two equations:

\(\displaystyle \displaystyle\qquad\begin{align*}
1\cdot b + 0\cdot a &= 18-16i\\
0\cdot b + 1\cdot a &= 7 - 2i
\end{align*}
\)

Next, we divide 1816i\displaystyle 18-16i by 72i\displaystyle 7 - 2i; the rounded quotient is 3i\displaystyle 3-i. We subtract 3i\displaystyle 3-i times the second equation from the first, giving:

\(\displaystyle \displaystyle\qquad
1\cdot b + (-3 + i)\cdot a = -1 - 3i
\)

You can then repeat the process (the next quotient is 2i\displaystyle 2i) until you get an equation with z=0\displaystyle z = 0. The next to last equation will have z=gcd(b,a)\displaystyle z = \gcd(b,a) and will be your answer.

In fact, it is not necessary to write all the equations in full. You can simply keep a table with all the variables.

\(\displaystyle \displaystyle
\qquad\begin{array}{c|c|c|c}
y & x & z & q\\[2pt]
\hline
1 & 0 & 18 - 16i & \\
0 & 1 & 7 - 2i & 3 - i\\
1 & -3+i & -1 - 3i & 2i\\
-2i & 3+6i & 1 & -1-3i\\
7-2i & -(18-16i) & 0 &
\end{array}
\)

The column labeled q\displaystyle q contains the rounded quotient of the last two z\displaystyle z values. The next to last row contains the answer:

\(\displaystyle \displaystyle\qquad
(-2i)(18-16i) + (3+6i)(7-2i) = 1
\)

As I mentioned before, if the answer is wrong, you can check each line of the table to locate the error.

As far as your matrix method is concerned, you are apparently building the solution from the bottom up. This means that you should multiply the matrices in the reverse order. Indeed, we have:

\(\displaystyle \displaystyle\qquad
\begin{pmatrix}3-i & 1\\ 1 & 0\end{pmatrix}
\begin{pmatrix}2i & 1\\ 1 & 0\end{pmatrix}
\begin{pmatrix}1 & 1\\ 1 & 0\end{pmatrix}
\begin{pmatrix}0 \\ 1\end{pmatrix}
=\begin{pmatrix}3+6i\\2i\end{pmatrix}
\)

This gives you the solution, except that one sign is wrong. The explanation is in the last line of the table. You are actually rebuilding the solution from a solution of byax=0\displaystyle by - ax = 0 instead of by+ax=0\displaystyle by + ax = 0. You should check your course material for the exact definition of the method.
 
Top