An alternative to the Euclidean algorithm uses subtraction rather than division to compute greatest common divisors. (After all, division is repeated subtraction.) It is based on the following lemma.
Lemma 4.10.3
If
Algorithm 4.10.3 Computlng gcd's by Subtraction [Given two positive integers A and B, variables a and b are set equal to A and B. Then a repetitive process begins. If
After the last repetition,
Hence, after the last repetition,
Input: A, B [positive integers]
Algorithm Body:
while (
if
else
end while
if a = 0 then
else
[After execution of the if—then-else statement,
Output: gcd [a positive integer]
a. Prove Lemma 4.10.3.
b. Trace the execution of Algorithm 4.10.3 for
c. Trace the Execution of Algorithm 4.10.3 for
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
WEBASSIGN F/EPPS DISCRETE MATHEMATICS
- When we divide a polynomial P(x) by a divisor D(x), the Division Algorithm tells us that we can always obtain a quotient Q(x) and a remainder R(x). State two forms in which the result of this division can be written.arrow_forwardWrite and as given in Exercises, find the and that satisfy the condition in a Division Algorithm. 13. ,arrow_forward
- Elements Of Modern AlgebraAlgebraISBN:9781285463230Author:Gilbert, Linda, JimmiePublisher:Cengage Learning,College AlgebraAlgebraISBN:9781305115545Author:James Stewart, Lothar Redlin, Saleem WatsonPublisher:Cengage LearningAlgebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:Cengage
- College Algebra (MindTap Course List)AlgebraISBN:9781305652231Author:R. David Gustafson, Jeff HughesPublisher:Cengage LearningLinear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage Learning