How Do You Find the Modular Multiplicative Inverse?

  • Thread starter scouter
  • Start date
  • Tags
    Inverse
In summary: SsSsSsIn summary, the conversation discusses the process of finding the modular multiplicative inverse (MMI) of a mod n using the extended Euclidean algorithm. The output of the algorithm is three numbers (d, x, y), with x being the MMI. However, the results obtained by the speaker do not match those of the book, leading to confusion. Eventually, it is discovered that the issue was not with the Euclidean algorithm, but with a misunderstanding of the Chinese remainder theorem.
  • #1
scouter
6
0
Hi all,

i would like to tell me, how to find the modular multiplicative inverse (MMI), of a mod n...


Untill now, my thought was that we can find the MMI, with the extended euclidean algorithm, by calculating
gcd (a,n)...
As an output, we will take 3 numbers (d,x,y)... and i have been told that x is the MMI that i am looking for...
For example, if i am looking the MMI of 36mod5, with the extended euclidean algorithm, we will take at the output (1,1,-7) and 1 is the answer..

But as i am trying to do, some examples, my results are not the same, as the book ones...
So what is the solution?
 
Physics news on Phys.org
  • #2
You dont' say what results you got or what the books says so I don't see how anyone can help here. Can you give an example from the book where your answer and the book's answer are different? And, of course, give both answers.

(Using the Euclidean algorithm to find the multiplicative inverse of 36 mod 6 seems like overkill. 36= 1 (mod 5) and of course the multiplicative inverse of 1 is 1!)
 
  • #3
Well, the algorithm i am talking about is, from the book
Handbook of Applied Cryptography by A. Menezes, P. van Oorschot and S. Vanstone.
amd the exact algorithm is:
Code:
INPUT: a ε Z[SUB]n[/SUB].
OUTPUT: a[SUP]−1[/SUP] mod n, provided that it exists.
1. Use the extendedEuclidean algorithm to find integers x and y such
that ax + ny = d, where d = gcd(a, n).
2. If d > 1, then a[SUP]−1[/SUP] mod n does not exist. Otherwise, return(x).

I found an example, from a greek book, which want us to calculate, the modular multiplicative inverse, of 45modulo4.. the results that is given is 45.. my result is 1.. if the algorithm above is correct, then maybe my problem is with the extended euclidean algorithm, so i will write you exactly how i found 1...
 
  • #4
mod 4, 45 =1, so the inverse is also 1, with no great effort.
 
  • #5
mathwonk said:
mod 4, 45 =1, so the inverse is also 1, with no great effort.

So the problem is with the euclidean algorithm.. not with the mod multiplicative inverse algorithm... :\
 
  • #6
I asked before what result you got using the Euclidean algorithm and you still have not answered. I suspect that the problem is NOT with the Euclidean algorithm but with your mis-use of it.

The multiplicative inverse of 45, mod 4, is the number, n such that 45n= 1 (mod 4) which is the same as saying 45n= 1+ 4m for some integer m. That is the same as 45n- 4m= 1. 4 divides into 45 11 times with remainder 1: 45- 11(4)= 1 so one solution to 45n- 4m= 1 is n= 1, m= 11.
The Euclidean algorithm gives n= 1 just as it should.
 
  • #7
i think i can answer or give an answer to that question u guys are eatin ur mouths on.
 
  • #8
Well, i found the solution... i couldn't undestand the chinese theorem, so i missused the result x...
you were right HallsofIvy.. thanksSsSs
 

FAQ: How Do You Find the Modular Multiplicative Inverse?

What is a modular multiplicative inverse?

A modular multiplicative inverse is a mathematical concept that refers to the number which when multiplied by another number (called the modulus) gives a remainder of 1 when divided by a third number. In simpler terms, it is the number that "undoes" the modular multiplication operation.

Why is modular multiplicative inverse important?

Modular multiplicative inverse is important in many areas of mathematics, particularly in modular arithmetic. It is used in cryptography, coding theory, and number theory, among others. It also has practical applications in computer science and engineering.

How is modular multiplicative inverse calculated?

The modular multiplicative inverse can be calculated using the extended Euclidean algorithm. This algorithm finds the greatest common divisor of the modulus and the number, and then uses it to calculate the inverse. There are also other methods, such as Fermat's little theorem and Euler's theorem, for finding the modular multiplicative inverse.

What is the notation used for representing modular multiplicative inverse?

The notation used for representing modular multiplicative inverse is (a^-1) mod m, where a is the number and m is the modulus. It can also be written as a^-1 (mod m) or simply as a^-1.

Can any number have a modular multiplicative inverse?

No, not all numbers have a modular multiplicative inverse. For a number to have an inverse, it must be coprime (have no common factors) with the modulus. If the number and the modulus are not coprime, then the inverse does not exist.

Similar threads

Back
Top