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

  • Context: Undergrad 
  • Thread starter Thread starter smoothman
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around calculating modular inverses, specifically how to find the inverse of a number "a modulo n" and its application in solving equations like 43x = 3 mod 125. Participants explore various methods and algorithms for determining modular inverses.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant asks for a general formula to find the modular inverse of "a modulo n" and provides an example with a = 29 and n = 78.
  • Another participant refers to the relationship ua = 1 (mod n) and suggests that it can be expressed as ua + vn = 1, implying a connection to a known theorem.
  • There is a suggestion that this relationship is related to Euclid's theorem, with a request for clarification on how to calculate the inverse for specific values.
  • Participants discuss whether Euclid's theorem includes an algorithm for computing modular inverses, with some confusion about its application.
  • One participant mentions the need for an algorithm rather than manually checking possibilities to find the inverse.
  • A suggestion is made to look up "diophantine equation" as a potential method for finding the inverse.
  • Another participant introduces the Euler phi function as an alternative method to determine the modular inverse, providing a specific calculation for the case of 29 modulo 78.

Areas of Agreement / Disagreement

Participants express differing views on the methods for calculating modular inverses, with some advocating for the use of Euclid's theorem and others suggesting the Euler phi function. No consensus is reached on a single method or formula.

Contextual Notes

Participants have not fully resolved the steps or assumptions required for calculating modular inverses, and there is uncertainty about the applicability of different algorithms and theorems discussed.

Who May Find This Useful

Readers interested in number theory, modular arithmetic, or those looking to solve equations involving modular inverses may find this discussion relevant.

smoothman
Messages
38
Reaction score
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
 
Physics news on Phys.org
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?
 
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
 
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?
 
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 :)
 
search wikipedia or google for ``diophantine equation''. There is an algorithm.
 
thnx :D just what i wanted :)
 
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.
 
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]
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K