In GCD, I have concluded that [ gcd(n,m) = a*n + b*m ]. If we have the condition that gcd(n,m)=1, then we can solve the modular inverse.
Below is the algorithm.
1. Write down 2 numbers, n and m. Also the vectors (1,0) and (0,1).
2. Reduce the larger to smaller one.
3. Apply the same computation to vectors.
4. Repeat until we have the number 1 and 0.
5. Preceding result will be the modular inverse.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDrmbbQJQv71zC_dd1A009E8CTQmKqtSobGPmO9DJ01faH6gtEP9-NIm9B8PHYIyg6uudeoZERLSOPm1VTMrrEHPncvaOY8JFKblIAzvMFIwr9HbK6cr8JVIKHtfzFNpRYatshBitcmv8/s320/untitled2.bmp)
No comments:
Post a Comment