Euclid's Division Algorithm
The Euclidean Division Algorithm is a method used in mathematics to find the greatest common divisor (GCD) of two integers. It is based on Euclid's Division Lemma. In this algorithm, we repeatedly divide and find remainders until the remainder becomes zero. This process is fundamental in number theory and helps in simplifying problems involving divisors and multiples.
According to the Euclidean Division Algorithm, two positive integers a and b, where a = bq + r, a common divisor of a and b is also a common divisor of b and r, and vice versa, GCD(a, b) = GCD(b, r).
Steps to find the GCD(A, B) using the Euclidean Division Algorithm:
- Express A in quotient-remainder form:
- A = B ⋅ Q + R, where Q is the quotient and R is the remainder.
- Apply the Euclidean Algorithm to find GCD(B, R), since GCD(A, B) = GCD(B, R).
- Repeat the process until the remainder becomes zero. as, GCD(0, X) = X.
- If A = 0, then GCD(A, B) = B, because GCD(0, B) = B. In this case, the process stops.
- If B = 0, then GCD(A, B) = A, because GCD(A, 0) = A. In this case, the process stops.
Proof Of Euclidean Division Algorithm
To Prove: For a = bq + r, any common divisor of a and b is also a common divisor of b and r, and vice versa.
Proof: Let c be a common divisor of a and b. This means:
- c divides a, so a = cq1 for some integer q1.
- c divides b, so b = cq2 for some integer q2.
Now, using the relation a = bq + r, we can write: r = a − bq.
Substitute a = cq1 and b = cq2: r = cq1 − cq2q.
Factor out c: r = c(q1 − q2q)...............(i)
This shows that c∣r. Hence, c divides both b and r, meaning c is a common divisor of b and r.
Thus, any common divisor of a and b is also a common divisor of b and r.
Now, let d be a common divisor of b and r. This means:
- d divides b, so b = r1d for some integer r1.
- d divides r, so r = r2d for some integer r2.
Using the relation a = bq + r , substitute b = r1d and r = r2d: a = r1dq + r2d.
Factor out d: a = d(r1q + r2)...............(ii)
This shows that d divides a. Thus, d divides both a and b, meaning d is a common divisor of a and b.
From the two parts above (i) and (ii), we conclude that:
GCD(a, b) = GCD(b, r)
The Euclidean Algorithm repeatedly applies the division a = bq + r by replacing (a, b) with (b, r). At each step, the remainder r strictly decreases because 0 ≤ r < b0.
Since r is a non-negative integer, the sequence of remainders: a, b, r1, r2, … , a > b > r1 > r2 > …, must eventually reach r = 0 after a finite number of steps.
When the algorithm terminates(r = 0), the last non-zero value of b is the greatest common divisor (GCD) of the original integers a and b.
Thus, the Euclidean Division Algorithm is both valid and guaranteed to terminate in a finite number of steps, providing the greatest common divisor (GCD) of the original integers a and b.
GCD of Two Numbers Using Euclid’s Division Algorithm
The GCD of two numbers can be found by using the Euclidean division algorithm as shown in the steps below.
Given two integers a (dividend) and b (divisor), where a ≥ b > 0,
Step 1: Divide a by b to get a quotient q and a remainder r:
a = b ⋅ q + r where 0 ≤ r < b.
Step 2: Replace a with b and b with r.
Step 3: Repeat the process until r = 0.
Step 4: When you get a remainder of zero, the last non-zero remainder you found is the greatest common divisor (GCD) of the original two numbers as GCD( 0, A ) = GCD( A, 0 ) = A
Example 1: Find the GCD of 252 and 105
Solution:
Divide 252 by 105:
252 = 105 × 2 + 42 ( Quotient = 2, Remainder = 42)Replace a with 105 and b with 42, then divide again, since GCD(252, 105) = GCD(105, 42):
105 = 42 × 2 + 21 ( Quotient = 2, Remainder = 21)Replace a with 42 and b with 21, then divide again, since GCD(105, 42) = GCD(42, 21):
42 = 21 × 2 + 0 ( Quotient = 2, Remainder = 0)Stop here because the remainder is now 0 and GCD(42, 21) = GCD(21, 0).
And GCD(21, 0) = 21then, GCD(252, 105) = GCD(105, 42) = GCD(42, 21) = GCD(21, 0) = 21
GCD(252, 105) = 21.
Example 2: Find the GCD of 360 and 96
Solution:
Divide 360 by 96:
360 = 96 × 3 + 72 (Quotient = 3, Remainder = 72)Replace a with 96 and b with 72, then divide again, since GCD(360, 96) = GCD(96, 72):
96 = 72 × 1 + 24 (Quotient = 1, Remainder = 24)Replace a with 72 and b with 24, then divide again, since GCD(96, 72) = GCD(72, 24):
72 = 24 × 3 + 0 (Quotient = 3, Remainder = 0)Stop here because the remainder is now 0 and GCD(72, 24) = GCD(24, 0).
And GCD(24, 0) = 24
then, GCD(360, 96) = GCD(96, 72) = GCD(72, 24) = GCD(24, 0) = 24GCD(360, 96) = 24
➣ Also Check - Extended Euclidean Algorithm
For Programmers – Euclidean Algorithm's basic and extended
Practice Problem Based on Euclid's Division Algorithm
Question 1. Find the GCD of 120 and 45 using the Euclidean Division Algorithm.
Question 2. Find the GCD of 144 and 60 using the Euclidean Division Algorithm.
Question 3. Find the GCD of 462 and 192 using the Euclidean Division Algorithm.
Question 4. Find the GCD of 84 and 56 using the Euclidean Division Algorithm.
Answer:-
- GCD of 120 and 45 = 15
- GCD of 144 and 60 = 12
- GCD of 462 and 192 = 6
- GCD of 84 and 56 = 28