Inverse of b mod n: Find, Steps, Examples

  • Context: High School 
  • Thread starter Thread starter LordCalculus
  • Start date Start date
  • Tags Tags
    Inverse
Click For Summary
SUMMARY

The discussion focuses on finding the inverse of a number b modulo n, specifically using the example of finding the inverse of 5 modulo 7. The procedure involves solving the equation 5x ≡ 1 (mod 7) by expressing it in the form 5x - 7y = 1, where x is the inverse and y is an integer. The existence of the inverse is guaranteed when the greatest common divisor (GCD) of b and n is 1, indicating that the two numbers are coprime. The extended Euclidean algorithm is the key method to compute the inverse, as detailed in the provided resources.

PREREQUISITES
  • Understanding of modular arithmetic
  • Familiarity with the concept of coprime numbers
  • Knowledge of the extended Euclidean algorithm
  • Basic algebraic manipulation skills
NEXT STEPS
  • Study the extended Euclidean algorithm in detail
  • Practice finding modular inverses with different pairs of coprime numbers
  • Explore applications of modular inverses in cryptography
  • Review resources on GCD and its properties
USEFUL FOR

Mathematicians, computer scientists, cryptographers, and anyone interested in number theory and modular arithmetic.

LordCalculus
Messages
12
Reaction score
0
What's the basic procedure in finding the inverse of b modulo n? What are the steps? Say, for example, the inverse of 5 modulo 7.
 
Physics news on Phys.org
Hi,
in your example, you look for the value of x in the equation
5x == 1 (mod 7)
The definition of congruence tells you that 5x-1 must be a multiple of 7. That is,
5x - 1 = 7y
for some integer y. Then
5x - 7y = 1
and you look for integer values of x and y that satisfy this equation; you can throw away the y, and the x is your inverse.

The inverse will exist in your example because 5 and 7 are coprime. This is a general rule: the GCD of the two numbers must be 1. In the last equation, if 5 and 7 had a common factor, then the right-hand side (which is just 1) would have to have that factor too!

To solve this equation, the keyword you have to google for is "extended Euclidean algorithm". The Wikipedia page has all the information, but is not necessarily the clearest explanation. Here are two very simple examples,
http://www.mast.queensu.ca/~math418/m418oh/m418oh04.pdf
In these examples the GCD of the two numbers is not 1, but the method is the same: you obtain two coefficients that solve a linear expression, as in the last equation above.

Hope this helps --

P.S.: Forum admins... is there something wrong with the LaTeX feature? All equations would just show as repetitions of the first one (as if the produced images were going to the same rewritten file, if you wish).
 

Similar threads

  • · Replies 34 ·
2
Replies
34
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
Replies
6
Views
2K