The following sentence could be added to the loop invariant for the Euclidean algorithm:
There exist integers u, v, s, and t such that
a. Show that this sentence is a loop invariant for
while
end while
b. Show that if initially a = A and b = B, then sentence (5.5.12) is true before the first iteration of the loop.
c. Explain how the correctness proof for the Euclidean algorithm together with the results of (a)
and (b) above allow you to conclude that given any integers A and B with
d. By actually calculating u, v, s, and t at each stage of execution of the Euclidean algorithm, find integers u and v so that
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Discrete Mathematics With Applications
- Elements Of Modern AlgebraAlgebraISBN:9781285463230Author:Gilbert, Linda, JimmiePublisher:Cengage Learning,Linear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage Learning