How can you calculate modular inverses and use them to solve equations?

  • Thread starter smoothman
  • Start date
In summary: Mod 7829^{24} \equiv 1 Mod 78 therefore 29^{-1} \equiv 29^{23} Mod 78.In summary, the conversation discusses finding the inverse modulo of "a modulo n" and using it to solve equations. The inverse is denoted as a^{-1} and can be calculated using Euclid's theorem or an algorithm for solving diophantine equations. The Euler phi function can also be used to determine the inverse, as shown in the example provided.
  • #1
smoothman
39
0
Hi is there a general formula to find the inverse modulo of "a modulo n"...
i know its denoted as [itex]a^{-1}[/itex] and
[itex]a.a^{-1} = 1 mod n[/itex]

for example if a=29 and n = 78 then the inverse is 35 since: 29.35 = 1 mod 78...

(a)
but HOW DO U CALCULATE THE INVERSE? is there a formula?? please help me out here?

(b)
and how can this be used to solve 43 modulo 125, hence solve 43x = 3 mod 125

thanks
 
Mathematics news on Phys.org
  • #2
Well, if you unroll the definition, you have

ua = 1 (mod n)

if and only if you can find a v such that

ua + vn = 1.

Does that look familiar at all?
 
  • #3
thats euclids theorem I am guessing?

could u show me how to calculate for a = 29 and n =78?
so that u get the inverse of 29 as 35??
then ill try part B and see if i can do it :) thanks
 
  • #4
smoothman said:
thats euclids theorem I am guessing?
Well, if you mean what I think you mean... then doesn't Euclid's theorem come with an algorithm for doing computation?
 
  • #5
yea but that's for just finding HCF...
i need to know if there's a formula for finding the inverse
you said :

"if and only if you can find a v such that
ua + vn = 1."

to do this.. do i have to manually go through all the possibilites or is there an algorithm etc? thnx :)
 
  • #6
search wikipedia or google for ``diophantine equation''. There is an algorithm.
 
  • #7
thnx :D just what i wanted :)
 
  • #8
smoothman said:
yea but that's for just finding HCF...

It is more than that - it gives a way to express the HCF of x and y as ax+by.
 
  • #9
There is another way. Using the Euler phi function, we can determine the n such that 29^n==1 Mod 78 for example. In this particular case it is 2(1-1/2)*3(1-1/3)*13(1-1/13) = 24. So that:

[tex]29^{23}\equiv\frac{1}{29} Mod 78[/tex]
 

FAQ: How can you calculate modular inverses and use them to solve equations?

What is a modular inverse?

A modular inverse is a number that, when multiplied by another number, gives a remainder of 1 when divided by a specified modulus. In simpler terms, it is the number that can "undo" the modular arithmetic operation.

Why are modular inverses important?

Modular inverses are important in many areas of mathematics and computer science. They are used in encryption algorithms, solving linear congruences, and in solving equations in modular arithmetic. They also have applications in fields such as cryptography, coding theory, and number theory.

How do you find a modular inverse?

The easiest way to find a modular inverse is by using the extended Euclidean algorithm. This algorithm calculates the greatest common divisor (GCD) of two numbers and expresses it as a linear combination of those numbers. The modular inverse is then the coefficient of the original number in this linear combination.

Can all numbers have a modular inverse?

No, not all numbers have a modular inverse. For a number to have a modular inverse, it must be coprime (have no common factors) with the modulus. If the number and the modulus share a common factor, then their GCD will not be 1 and a modular inverse cannot be found.

What is the relationship between modular inverses and modular arithmetic?

Modular inverses and modular arithmetic are closely related. In modular arithmetic, numbers "wrap around" after reaching the modulus, creating a cyclic pattern. Modular inverses are used to "undo" this wrapping and bring the numbers back to their original values. They also play a crucial role in solving equations and finding solutions in modular arithmetic.

Similar threads

Back
Top