0% found this document useful (0 votes)
6 views12 pages

Lecture #8b Extended Euclidean Algorithm

The document outlines key concepts related to the Extended Euclidean Algorithm, including the Greatest Common Divisor (GCD), congruence, residue classes, and inverses in modular arithmetic. It explains how to find GCD using the Euclidean Algorithm and provides examples of additive and multiplicative inverses. Additionally, it demonstrates the application of the Extended Euclidean Algorithm to find the multiplicative inverse in a given modulo system.

Uploaded by

sajjalmandana661
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views12 pages

Lecture #8b Extended Euclidean Algorithm

The document outlines key concepts related to the Extended Euclidean Algorithm, including the Greatest Common Divisor (GCD), congruence, residue classes, and inverses in modular arithmetic. It explains how to find GCD using the Euclidean Algorithm and provides examples of additive and multiplicative inverses. Additionally, it demonstrates the application of the Extended Euclidean Algorithm to find the multiplicative inverse in a given modulo system.

Uploaded by

sajjalmandana661
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

EXTENDED EUCLIDEAN

ALGORITHM
2

OBJECTIVES

 GCD & Relatively Prime numbers


 Congruence
 Residue Class
 Inverse in Modulo
• Additive Inverse
• Multiplicative Inverse
 Euclidean Algorithm
 Extended Euclidean Algorithm
3

GREATEST COMMON DIVISOR (GCD)

 The greatest common divisor (GCD) of two positive integers is


the largest integer that can divide both integers.
 The divisors of 30 are 1, 2, 3, 5, 6, 10, 15, 30
 The common divisors of 12 and 30 are 1, 2, 3, 6.
 GCD(12,30) = 6.
 When gcd (a, b) = 1, we say that a and b are relatively
prime (or coprime).
4

CONGRUENCE

 Two integers are congruent if their mod(n) gives the same result
 congruence operator ( ≡ ).

 -8, 2, 12, 22 are all congruent modulo 10


5

RESIDUE CLASS

 A residue class [a] or [a]n is the set of integers congruent


modulo n
 x = a mod(n)
 Suppose n = 5, so we have 5 sets 0,1,2,3,4 reduced to 0 if we
apply modulo 5
6

INVERSE IN MODULO

 In modular arithmetic, we often need to find the inverse of a


number relative to an operation.
 Additive inverse (relative to an addition operation)
 Multiplicative inverse (relative to a multiplication operation).
7

ADDITIVE INVERSE IN MODULO

 In Zn , two numbers a and b are additive inverses of each other


if:
a + b ≡ 0 (mod n)
 In modular arithmetic, each integer has an additive inverse. The
sum of an integer and its additive inverse is congruent to 0
modulo n.
 Six pairs of additive inverses pairs in Z10 are (0, 0), (1, 9), (2,
8), (3, 7), (4, 6), and (5, 5).
 The additive inverse of every number modulo exists
8
MULTIPLICATIVE INVERSE IN
MODULO

 In Zn , two numbers a and b are multiplicative inverses of each


other if:
a x b ≡ 1 (mod n)
 In modular arithmetic, an integer may or may not have a
multiplicative inverse. The product of an integer and its
multiplicative inverse is congruent to 1 modulo n.
 A multiplicative inverse of a modulo n exists only when ‘a is coprime to n’ , or
when gcd(a, n) = 1
 (1, 1), (3, 7) and (9, 9) pairs have multiplicative inverse in Z10
 0, 2, 4, 5, 6, and 8 do not have a multiplicative inverse.
EUCLIDEAN ALGORITHM 9

 An efficient way to find the GCD(a,b)

 Uses theorem that:

GCD(a,b) = GCD(b, a mod b)

 Euclidean Algorithm to compute GCD(a,b) is:

Euclid(a,b)

if (b=0) then return a;

else return Euclid(b, a mod b);


10

EUCLIDEAN ALGORITHM EXAMPLE

Find gcd (25, 60) = 5 using Euclidean algorithm Here a = r1


b = r2
EXTENDED EUCLIDEAN ALGORITHM 11
EXAMPLE
• Multiplicative Inverse of 11 in Z26
• The GCD of (26,11) is 1, the inverse of 11 is -7 or 19
• r = r1 - q*r2
• t = t1 - q*t2
ANY QUESTIONS?

You might also like