Bullet-pointed notes on Euclidean Algorithm
Euclidean Algorithm and Its Extensions
Euclidean Algorithm
The Euclidean Algorithm is a classical method used to determine the greatest common divisor (GCD) of two integers. It operates on the principle that the GCD of two integers also divides their difference.
Procedure:
- Given two integers and where , divide by .
- Replace with and with the remainder from the division.
- Repeat the process until becomes 0. The non-zero remainder is the GCD.
Example:
To find the GCD of 252 and 105:
The GCD of 252 and 105 is 21.
Alternative layout:
watch?v=_rRu1jg7Kus
Variant: Negative Remainders
Instead of always having a positive remainder, it’s possible to use negative remainders, which can sometimes simplify calculations.
Procedure:
- Divide integer by .
- If the remainder is greater than , subtract from the remainder to get a negative remainder and add 1 to the quotient.
Example:
For and :
with a remainder of 15. Since 15 is less than , we keep the positive remainder.
Extended Euclidean Algorithm
The Extended Euclidean Algorithm is an enhancement of the Euclidean Algorithm. It computes the GCD of two integers and also determines the coefficients of Bézout’s identity.
Bézout’s Identity:
For any integers and , there exist integers and such that:
Procedure:
- Start with two integers, and , where . Initialize two coefficient pairs: and .
- Divide by , obtaining quotient and remainder , such that .
- Update coefficients:
- Replace with , with , with , and with . Repeat until becomes 0. Extended Euclidean Algorithm Example.excalidraw Shown in red, working bottom to top from the original Euclidean algorithm, rearranging for the remainder and substituting into the below equation - simplifying each time into a linear combination.
Least Common Multiple (LCM)
The LCM of two integers and is the smallest positive integer divisible by both and . It can be denoted as or and can be computed using the GCD:
or equivalently,
Proofs of the Four Arithmetical Lemmas
-
Lemma: If and , then .
Proof: Given , there exists an integer such that . Similarly, given , there exists an integer such that . Summing these two equations, we get: This demonstrates that divides .
-
Lemma: If , then for all integers .
Proof: Given , there exists an integer such that . Multiplying both sides by , we obtain: This shows that divides .
-
Lemma: If and , then .
Proof: Given , there exists an integer such that . Similarly, given , there exists an integer such that . Multiplying these two equations, we get: This demonstrates that divides .
-
Lemma: If and , then .
Proof: Given , there exists an integer such that . Similarly, given , there exists an integer such that . Using the first equation, we can substitute for in the second equation to get: This implies or . Thus, and are either 1 or -1. This means .