What is Extended Euclidean Algorithm
Hey, Guys in this part we are going to know about what is Extended Euclidean Algorithm and how we can apply this concept in our programs. In our last blog we know about what is Euclidean Algorithm , now in this part we exlore more about extended Euclidean Algorithm. The extended Euclidean algorithm is an algorithm to compute integers x and y such that a.x + b.y = gcd(a,b) , for given a and b . The existence of such integers is guaranteed by Bézout's lemma . Explanation (Recursive version) Let , gcd=gcd(a,b) & x,y be the co-efficient of a,b in x.a + y.b = gcd equation.----(i) If we recall the Eculidean algorithm, we can see that the algorithm ends with b = 0 and a=gcd in such condition x should be 1 and y be 0 so, 1.a+ 0.0 = gcd . So starting coefficient of (x,y)=(1,0). Now we have to calculate futher coefficient for (b,a%b) , which also satisfy equation(i) , x1.b + y1.(a%b) = g