Problem Q-4. The Euclidean algorithm is an efficient way of finding the greatest common divisor of two integers: Given two positive integers such as 30 and 56, replace the larger one by its remainder after division by the smaller one, and keep repeating this process until one of them is 0. Then the gcd is the other number left. For example, 30 and 56 become 30 and 26, which become 4 and 26, which become 4 and 2, which become 0 and 2, so the gcd is 2.
(a) Explain why this works. (Method: If the integers are
and
with
, if you divide
by
and
get quotient
and remainder
, then
.
Show that the set of positive integers that divide both
and
is exactly the same as the set of positive integers
that divide both
and
. How about the gcd of 0 and
, once you have reached that stage? If you wish, you may
use the notation common in number theory:
means ``
divides
''. Note: It is OK to divide into 0 but not by 0.)
(b) Find the gcd of 91 and 221 this way.
Problem
Q-5. Decide which two numbers
between 30 and 60
with
will take the most steps of the Euclidean
algorithm to get their gcd. (Give your reasoning.)
Problem Q-6. Solving for the gcd as a linear combination.
It is a theorem about integers that if
gcd
then
there exist integers
and
with
. For
example, there should be
and
so
.
Here is a method to find
and
by getting more
information out of the Euclidean algorithm. First, put the two
numbers as a column of a matrix augmented by the identity matrix:
. Then row-reduce as best you can
using integer operations only, as follows. At each step,
subtract off an integer multiple of one row from the other row
so that the left columns follow the Euclidean algorithm. Do
not scale rows. You don't need to swap rows either.
.
Now in the last matrix look at the row that has the gcd. This
row is in the row space of the original matrix. With what
coefficients? Easy--from the identity matrix part, we see that
this row with 2 is 7 times the first row of the original matrix
minus 13 times the second row. But this says
.
As a check on arithmetic, since these row operations do not
affect determinants, along the way the determinant of the
right-hand
submatrix should always be 1.
Do this procedure to express the gcd of 91 and 221 as an integer linear combination of these two integers.
(You are not asked to prove the theorem, but this procedure itself really amounts to the proof. Be careful about which coefficient goes with 91 and which with 221, and check your answer.)
Problem
Q-7.
is a prime. Find the multiplicative inverse
of
in the field
.
(Method: This sounds difficult but it's not. The gcd of a
prime
and a number not divisible by
is 1, so you can
find
and
with
. In
,
101 is the same as 0 so this expression says
,
so
is the multiplicative inverse. If
is among
0 to
, you'll need to change it by
a
multiple of
.)