You are on page 1of 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