Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 1.2.41 ($|x_{j+1}| = c/g$ and $|y_{j+1}| = b/g$)

Exercise 1.2.41 ($|x_{j+1}| = c/g$ and $|y_{j+1}| = b/g$)

In the foregoing notation, if g = ( b , c ) , show that | x j + 1 | = c g and | y j + 1 | = b g .

Answers

Proof. The Euclidean algorithm makes sense only for b 0 , c 0 . The fraction c g has no signification if g = 0 , so we may assume that b and c are not both zero, so that g = b c 0 .

(a)
Suppose first that b > 0 and c > 0 , as in the hypothesis of Theorem 1.11.

If we write the relations r i = b x i + y i c for i = j and i = j + 1 , we obtain

{ g = r j = b x j + c y j , 0 = r j + 1 = b x j + 1 + c y j + 1 .

Therefore

x j + 1 g = c ( x j y j + 1 x j + 1 y j ) , y j + 1 g = b ( x j y j + 1 x j + 1 y j ) .

By Problem 40, x j y j + 1 x j + 1 y j = ( 1 ) j + 1 , so

( 1 ) j x j + 1 g = c , ( 1 ) j + 1 y j + 1 g = b .

By Problem 39, | x j + 1 | = ( 1 ) j x j + 1 , | y j + 1 | = ( 1 ) j + 1 y j + 1 , thus

| x j + 1 | = c g , | y j + 1 | = b g .

(b)
The extended Euclidean algorithm (or Bézout algorithm) gives (see Problem 39) r 1 = b , r 0 = c , r j + 1 = 0 ,

Then x i and y i , such that r i = b x i + c y i , 1 i j + 1 , satisfy for all i [ [ 1 , j 1 ] ] ,

r i + 2 = r i q i + 2 r i + 1 , (1) x i + 2 = x i q i + 2 x i + 1 , (2) y i + 2 = y i q i + 2 y i + 1 , (3)

where

x 1 = 1 , y 1 = 0 , x 0 = 0 , y 0 = 1 ,

  • If b = 0 , then g = a c = 0 c = c (and c 0 ), and the Euclidean algorithm gives

    0 = c q 1 + r 1 , q 1 = 0 , r 1 = 0 ,

    so that j = 0 . Then

    x j + 1 = x 1 = x 1 q 1 x 0 = 1 , y j + 1 = y 1 = y 1 q 1 y 0 = 0 ,

    thus

    | x j + 1 | = | x 1 | = 1 = c g , | y j + 1 | = | y 1 | = 0 = b g .

  • If c = 0 , then g = b c = b . There are no Euclidean division, the algorithm doesn’t enter in the loop (see the note). Since r 0 = 0 = r j + 1 , we have j = 1 , and

    x j + 1 = x 0 = 0 , y j + 1 = y 0 = 1 ,

    thus

    | x j + 1 | = | x 0 | = 0 = c g , | y j + 1 | = | y 0 | = 1 = b g .

Note: the Bézout’s algorithm for a 0 , b 0 is given by the following program, written in ipython:

In [1]: def bezout(a,b):
   ...:     (r0, r1)=(a, b)
   ...:     (u0, v0) = (1, 0)
   ...:     (u1, v1) = (0, 1)
   ...:     while r1 != 0:
   ...:         q = r0 // r1
   ...:         (r2, u2, v2) = (r0 - q * r1, u0 - q * u1, v0 - q * v1)
   ...:         (r0, r1) = (r1, r2)
   ...:         (u0, u1) = (u1, u2)
   ...:         (v0, v1) = (v1, v2)
   ...:     return u0, v0, r0
   ...:

In [2]: bezout(5, 0)
Out[2]: (1, 0, 5)

In [3]: bezout(0, 5)
Out[3]: (0, 1, 5)

User profile picture
2024-10-01 09:31
Comments
  • Hi Richard, I am a little confused here. In the first line you write g=(a,b)>0. Where did that a come from? Also, in the hint in the book says use Theorem 1.10(Euclid's Lemma: If c divides ab and (b,c)=1 then c divides a. Is this a typo in the text hint? I must be missing an important idea. The rest is correct, but lacking the missing the cases when either b or c is zero.
    BretSherfinski2025-02-22
  • The definition p.7 defines the greater common divisor $d$ of $b$ and $c$ except in the case $b = c= 0$, so $d$ is always a positive integer. This restriction is useless. In more recent courses, if $(b,c) \in \mathbb{Z}^2$, the $d = \mathrm{gcd}(b,c)$ is defined by $$d = b \wedge c \iff (d \geq 0 \text{ and } d \mathbb{Z} = b \mathbb{Z} + c \mathbb{Z}).$$ Then the gcd is characterized (see the solution of Problem 18) by \begin{align*} &d = a \wedge b \iff \left\{ \begin{array}{l} d \geq 0,\\ d \mid b \text{ and } d \mid c,\\ \forall k \in \mathbb{Z},\ (k \mid b \text{ and } k \mid c) \Rightarrow k \mid d. \end{array} \right. \end{align*} (Here $a \mid b$ means $\exists \lambda \in \mathbb{Z},\ b = \lambda a$, so that $a \mid 0$.) Taking this definition or the characterization, we see that $a \wedge b = 0$ if and only if $a = b = 0$, so this definition is not incompatible with the definition p.7, it is only a more general one. When I say that $g = b \wedge c >0$ in the solution, this is equivalent to $g \ne 0$, and this is true except in the case $b = c = 0$. The hypothesis of Theorem 1.11 (and not Th. 1.10 quoted by error) are $b>0, c>0$ so that I retained this hypothesis (the hypothesis of the Problems are not always explicit). Moreover, the "forgoing notations" are those of Theorem 1.11, and the first line $b = cq_1 + r_1, \ 0 < r_1 < c$ has no signification if $c = 0$, and if $b = 0$, the second line has no more signification. Nevertheless, the Bézout's algorithm (see the note) makes sense even if $b = 0$ or $c = 0$. I don't always follow the hints, but you are right: the hint indicates that we must consider the cases $b = 0$ or $c = 0$, so I will add a paragraph to consider this case.
    richardganaye2025-02-23