L05_CalculatingInverses_print

L05_CalculatingInverses_print - Alternative Methods for...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Alternative Methods for Calculating Inverses
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 We will now see two alternative ways of calculating inverses; they also start from the extended gcd algorithm The first notes that it is not necessary to use a formal algorithmic approach, we can just unwind the equations to find the inverse. In class, we saw how to use the extended gcd algorithm to build a formal algorithm for calculating inverses .
Background image of page 2
Idea: “Iterate backwards”: Starting with step 0 , number steps of Euclidean algorithm. The equation at step i , will be denoted by m i = n i q i + r i . After carrying out step i of Euclidean algorithm, transform it into r i = m i - n i q i . Let r k (step k ) be last non-zero remainder. Recall that if r k = 1 , n 0 has an inverse mod m 0 (If r k 6 = 1 , then n 0 has no inverse mod m 0 ) Recall that m i = n i - 1 and n i = r i - 1 . Iterate backwards starting with = n k - 1 - r k - 1 q k = n k - 1 - ( m k - 1 - n k - 1 q k - 1 ) q k = - m k - 1 q k + n k - 1 (1+ q k - 1 q k ) . . . r
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

L05_CalculatingInverses_print - Alternative Methods for...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online