Learnify Academy is a tuition centre in Bahrain. Classes are for students in Bahrain only.Tuition classes in Bahrain only

Euclid’s algorithm · 3 marks

The above modified algorithm can be carried out concisely using the “long division” method given by Indians at least from the time of Āryabhaṭa. We illustrate the method through the following examples—

  1. 1. gcd(99, 2)
  2. 2. gcd(825, 375)
  3. 3. gcd(60, 16)
Answer: 1. gcd(99, 2) = 1 2. gcd(825, 375) = 75 3. gcd(60, 16) = 4

Step-by-step solution

Idea: Divide the larger number by the smaller. Then divide the old divisor by the remainder, and keep going. When the remainder is 0, the last divisor is the gcd. Each division is one reduction gcd(m, n) → gcd(n, m mod n).

gcd(60, 16)= gcd(16, 12)= gcd(12, 4)= gcd(4, 0) = 416)60(34812)16(1124)12(3120

1. gcd(99, 2)

  1. 2 ) 99 ( 49: 49 × 2 = 98, remainder 99 − 98 = 1. So gcd(99, 2) = gcd(2, 1).½ mark
  2. 1 ) 2 ( 2: 2 × 1 = 2, remainder 0. The last divisor is 1, so gcd(99, 2) = 1.½ mark
gcd(99, 2) = 1

2. gcd(825, 375)

  1. 375 ) 825 ( 2: 2 × 375 = 750, remainder 825 − 750 = 75. So gcd(825, 375) = gcd(375, 75).½ mark
  2. 75 ) 375 ( 5: 5 × 75 = 375, remainder 0. The last divisor is 75, so gcd(825, 375) = 75.½ mark
gcd(825, 375) = 75

3. gcd(60, 16)

  1. 16 ) 60 ( 3: 3 × 16 = 48, remainder 12. So gcd(60, 16) = gcd(16, 12).
    12 ) 16 ( 1: 1 × 12 = 12, remainder 4. So gcd(16, 12) = gcd(12, 4).½ mark
  2. 4 ) 12 ( 3: 3 × 4 = 12, remainder 0. The last divisor is 4, so gcd(60, 16) = 4.½ mark
gcd(60, 16) = 4
gcd(99, 2) = 1, gcd(825, 375) = 75 and gcd(60, 16) = 4: in each case the last non-zero divisor (the divisor that leaves remainder 0) is the gcd.

Check: 60 = 4 × 15 and 16 = 4 × 4, with 15 and 4 sharing no factor, so 4 is the gcd ✓. 825 = 75 × 11 and 375 = 75 × 5 ✓.

Answer to write in the exam

1.

99 = 49 × 2 + 1 ⇒ gcd(99, 2) = gcd(2, 1)

2 = 2 × 1 + 0 ⇒ gcd(2, 1) = gcd(1, 0)

∴ gcd(99, 2) = 1

2.

825 = 2 × 375 + 75 ⇒ gcd(825, 375) = gcd(375, 75)

375 = 5 × 75 + 0 ⇒ gcd(375, 75) = gcd(75, 0)

∴ gcd(825, 375) = 75

3.

60 = 3 × 16 + 12 ⇒ gcd(60, 16) = gcd(16, 12)

16 = 1 × 12 + 4 ⇒ gcd(16, 12) = gcd(12, 4)

12 = 3 × 4 + 0 ⇒ gcd(12, 4) = gcd(4, 0)

∴ gcd(60, 16) = 4

Common mistakes that cost marks

  • Taking the last remainder (0) or the last quotient (3) as the gcd. The gcd is the last divisor, the one that leaves remainder 0.
  • Dividing the remainder by the dividend instead of dividing the old divisor by the remainder.
  • Subtracting wrongly in a step (e.g. 825 − 750 = 85); one wrong remainder spoils every later step.

How this can come in the exam

MCQ (1 mark)

In the long division method for gcd(96, 36), the divisions are 36 ) 96 ( 2, then 24 ) 36 ( 1, then 12 ) 24 ( 2 with remainder 0. The gcd is

  1. 2
  2. 12
  3. 24
  4. 36
Show answer

(B) 12
The divisor that leaves remainder 0 is 12, so gcd(96, 36) = 12.

Short answer (2 marks)

Use the long division method to find gcd(126, 56).

Show answer56 ) 126 ( 2: 112, remainder 14. 14 ) 56 ( 4: 56, remainder 0. gcd(126, 56) = 14.

Try one yourself

Find gcd(135, 48) by the long division method.

Show answer

48 ) 135 ( 2: remainder 39. 39 ) 48 ( 1: remainder 9. 9 ) 39 ( 4: remainder 3. 3 ) 9 ( 3: remainder 0. gcd(135, 48) = 3.

More questions like this

All Algorithms questions · All maths questions