0% found this document useful (0 votes)
18 views

Euclidean Algorithm

The document summarizes the proof of correctness of the Euclidean algorithm for finding the greatest common divisor (GCD) of two integers. It first states two lemmas about properties of integers and division remainders. It then outlines the algorithm, which repeatedly divides the larger number by the smaller until the remainder is zero, proving that the last non-zero remainder is the GCD. Finally, it uses induction and the two lemmas to prove the algorithm will always find the true GCD.

Uploaded by

f20210467
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Euclidean Algorithm

The document summarizes the proof of correctness of the Euclidean algorithm for finding the greatest common divisor (GCD) of two integers. It first states two lemmas about properties of integers and division remainders. It then outlines the algorithm, which repeatedly divides the larger number by the smaller until the remainder is zero, proving that the last non-zero remainder is the GCD. Finally, it uses induction and the two lemmas to prove the algorithm will always find the true GCD.

Uploaded by

f20210467
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

EUCLIDEAN ALGORITHM

Proof of Correctness
• Lemma 1: If and are integers and and , then .

• Lemma 2: If is a positive integer and b, q, and


r are integers with then .
Finding GCD
and such that
• Theorem: Prove that .
• Proof: First we show that the algorithm
terminates. Since , where are integers. This
shows that the remainders are montonically
strictly decreasing positive integers until the
last one. Therefor the algorithm stops after no
more than divisions.
• Property: For each

• Base Case: is trivially true.


• Inductive Case: For each we have by Lemma
2.
• Thus
• Now using this claim for we have .
• Hence proved.

You might also like