Lecture 2- Euclidean and Extended Euclidean Algorithm
Lecture 2- Euclidean and Extended Euclidean Algorithm
Branch: B.Tech
Lecture – 2: Euclidean and Extended Euclidean Algorithms
Example #2
Integer Division
Integer Division
• When we use a computer or a calculator, r and q are negative
when a is negative.
• How can we apply the restriction that r needs to be positive?
• The solution is simple, we decrement the value of q by 1 and
we add the value of n to r to make it positive.
Integer Division
• Graph of division algorithm
Divisibility
• If a is not zero and we let r = 0 in the division relation, we get
Example #4
Divisibility
Divisibility
Example #5
Divisibility
Class Exercise #1
Divisibility
• Extended Euclidean Algorithm