This preview shows pages 1–14. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 11Alternative Methods for CalculatingInverses21In class, we saw how to use theextendedgcdalgorithmto build a formal algorithmforcalculating inverses.22We will now see two alternative ways ofcalculating inverses; they also start fromtheextendedgcdalgorithmIn class, we saw how to use theextendedgcdalgorithmto build a formal algorithmforcalculating inverses.23We will now see two alternative ways ofcalculating inverses; they also start fromtheextendedgcdalgorithmThe first notes that it is not necessaryto use a formal algorithmic approach, wecan justunwindthe equations to find theinverse.In class, we saw how to use theextendedgcdalgorithmto build a formal algorithmforcalculating inverses.31Idea: “Iterate backwards”:32Idea: “Iterate backwards”:•Starting with step, number steps of Euclidean algorithm.33Idea: “Iterate backwards”:•Starting with step, number steps of Euclidean algorithm.•The equation at stepi, will be denoted bymi=niqi+ri.34Idea: “Iterate backwards”:•Starting with step, number steps of Euclidean algorithm.•The equation at stepi, will be denoted bymi=niqi+ri.•After carrying out stepiof Euclidean algorithm,transform it intori=miniqi.35Idea: “Iterate backwards”:•Starting with step, number steps of Euclidean algorithm.•The equation at stepi, will be denoted bymi=niqi+ri.•After carrying out stepiof Euclidean algorithm,transform it intori=miniqi.•Letrk(stepk) be last nonzero remainder.Recall that ifrk= 1,⇒nhas an inversemodm36Idea: “Iterate backwards”:•Starting with step, number steps of Euclidean algorithm.•The equation at stepi, will be denoted bymi=niqi+ri.•After carrying out stepiof Euclidean algorithm,transform it intori=miniqi.•Letrk(stepk) be last nonzero remainder.Recall that ifrk= 1,⇒nhas an inversemodm(Ifrk6= 1, thennhasnoinversemodm)37Idea: “Iterate backwards”:•Starting with step, number steps of Euclidean algorithm.•The equation at stepi, will be denoted bymi=niqi+ri.•After carrying out stepiof Euclidean algorithm,transform it intori=miniqi.•Letrk(stepk) be last nonzero remainder.Recall that ifrk= 1,⇒nhas an inversemodm(Ifrk6= 1, thennhasnoinversemodm)•Recall thatmi=ni1andni=ri1.38Idea: “Iterate backwards”:•Starting with step, number steps of Euclidean algorithm.•The equation at stepi, will be denoted bymi=niqi+ri.•After carrying out stepiof Euclidean algorithm,transform it intori=miniqi.•Letrk(stepk) be last nonzero remainder.Recall that ifrk= 1,⇒nhas an inversemodm(Ifrk6= 1, thennhasnoinversemodm)•Recall thatmi=ni1andni=ri1.•Iterate backwards starting with39Idea: “Iterate backwards”:•Starting with step, number steps of Euclidean algorithm....
View
Full
Document
This note was uploaded on 08/25/2010 for the course COMP COMP170 taught by Professor M.j.golin during the Spring '10 term at HKUST.
 Spring '10
 M.J.Golin
 Computer Science

Click to edit the document details