Finding the Inverse Integer Modulo n

In summary: Least absolute residues is not the most common choice for this problem.Least nonnegative residues is the most appropriate choice for addition on Z/nZ, least absolute residues for multiplication. I don't know that there is a standard for finding inverses, but I think least nonnegative residues would be the "most standard." This is because when checking for the existence of an inverse, gcd(n,a) = 1 is the condition. If we allow ourselves to use any residues we want, we could always choose a to be 0 or 1, and we don't get as much information from gcd(n,0) and gcd(n,1) as we do from gcd(n,a).That said, I think the most important thing is to
  • #1
PsychonautQQ
784
10

Homework Statement


in mod 35, find the inverse of 13 and use it to solve 13x = 9
gcd(35,13) =1 so the inverse exsists:
35 = 2*13 + 9
13 = 1*9 + 4
9 = 2*4 + 1
4 = 4*1
and then to find the linear combination
1 = 9 - (2*4) = 9 - 2(13-9) = 3*9 - 2*13 = 3* (35 - 2*13) - 2*13 = 3*35 - 8*13 = 1
but mostly
3*35 - 8*13 = 1..
so -8 is the inverse of 13 in modulo 35.. using that to solve the equation
x = -72

but the back of my book says the inverse is 27, which would make x = 243... where did I go wrong? I can't find my mistake


Homework Equations





The Attempt at a Solution

 
Physics news on Phys.org
  • #2
PsychonautQQ said:

Homework Statement


in mod 35, find the inverse of 13 and use it to solve 13x = 9
gcd(35,13) =1 so the inverse exsists:
35 = 2*13 + 9
13 = 1*9 + 4
9 = 2*4 + 1
4 = 4*1
and then to find the linear combination
1 = 9 - (2*4) = 9 - 2(13-9) = 3*9 - 2*13 = 3* (35 - 2*13) - 2*13 = 3*35 - 8*13 = 1
but mostly
3*35 - 8*13 = 1..
so -8 is the inverse of 13 in modulo 35.. using that to solve the equation
x = -72

but the back of my book says the inverse is 27, which would make x = 243... where did I go wrong? I can't find my mistake


Homework Equations





The Attempt at a Solution


The numbers modulo 35 range from 0-34, so any number out of that range needs to be moved into it. -8 is out of that range :wink:
 
  • Like
Likes 1 person
  • #3
In short, you worked the problem correctly, but there is some confusion about what you are regarding as the "inverse" and "answer." You used a different set of residues, which gives you different numbers from the book, but you and the book still arrived at the same answer, because the answers are congruence classes, not single numbers (note that your inverse is congruent to their inverse, and your solution is congruent to their solution!).

-8 is certainly an inverse of 13 mod 35, and 27 is an inverse of 13 mod 35 (note that -8 and 27 are congruent) but neither is the inverse, and 27 is not more correct than -8. There are many inverses. Namely, any member of the congruence class [27] (which we could also call [-8] with equal validity - they are exactly the same) is an inverse.

The same applies to the value of x. x = 243 and x = -72 are equally valid solutions. Any member of [-72] (or [243] - again, same thing) is a solution. To say that x = 243 is "the" solution is wrong. To say that [243] is "the" solution is correct.

I would expect that your book said that [27] is the inverse, not the number 27. Both the inverse and value for x are entire congruence classes, not single numbers.


Mentallic said:
The numbers modulo 35 range from 0-34, so any number out of that range needs to be moved into it. -8 is out of that range :wink:

This is not true. There is nothing special about the set of nonnegative residues, one may use the set of least absolute residues to solve problems (as I think the OP did), and it is often advantageous. One may use any other, really. Using numbers outside of that specific range you chose is not incorrect and can never lead one to an incorrect answer.

When reporting your answers, it is nice to pick a set of residues and report your congruence classes in those terms, but that is purely a matter of notation. If one reports [-8] as the inverse (thereby using least absolute residues), they should report [-2] as the solution. If one reports [27] as the inverse (thereby using least nonnegative residues), they should report [33] as the solution. These are the same answer, though.
 
Last edited:
  • #4
From my experience at least, when dealing with inverses in modulo arithmetic, it is expected that the solutions be given in the appropriate range. Just because any integer of the form 35n-8 for all integers n can be chosen, doesn't mean there aren't more appropriate choices of n in this particular situation.
 
  • #5
Mentallic said:
From my experience at least, when dealing with inverses in modulo arithmetic, it is expected that the solutions be given in the appropriate range. Just because any integer of the form 35n-8 for all integers n can be chosen, doesn't mean there aren't more appropriate choices of n in this particular situation.

The point being that it is not the source of any mathematical error to use a different set of residues.

I would disagree that the least nonnegative residues is the most appropriate choice though. I think most people would pick the least absolute residues simply because most people would rather multiply -8 and 13 than multiply 27 and 13. Least absolute residues is usually the way to go when talking about any type of function also (for the same reason).

It would be weird to use 13, 14, 1, 2, 38... Indeed. But using {-17, -16,... 16, 17} is actually what most people would use to solve this problem.
 

1. What is an inverse integer modulo n?

An inverse integer modulo n is a number that, when multiplied by a given number and then taken modulo n, results in a remainder of 1. In other words, it is the number that "undoes" the modulo operation.

2. Why is finding the inverse integer modulo n important?

Finding the inverse integer modulo n is important in many areas of mathematics, including cryptography, number theory, and computer science. It is also a fundamental operation in modular arithmetic, which has numerous practical applications in fields such as coding theory and data compression.

3. How do you find the inverse integer modulo n?

The most common method for finding the inverse integer modulo n is using the extended Euclidean algorithm. This algorithm involves finding the greatest common divisor of the given number and n, and then using a series of steps to determine the inverse integer. There are also other methods, such as using modular exponentiation, that can be used in certain cases.

4. Can every number have an inverse integer modulo n?

No, not every number has an inverse integer modulo n. In order for a number to have an inverse, it must be relatively prime to n (meaning they have no common factors other than 1). This is why, in some cases, it is necessary to choose a different value of n in order to find the inverse integer of a given number.

5. Are there any applications of finding the inverse integer modulo n in real life?

Yes, there are many real-life applications of finding the inverse integer modulo n. One example is in the field of cryptography, where modular arithmetic is used to encrypt and decrypt messages. In addition, the concept of inverse integers modulo n is also used in error-correcting codes, which are used in data storage and transmission to ensure accurate information transfer.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
507
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
847
Replies
4
Views
210
  • Precalculus Mathematics Homework Help
Replies
2
Views
792
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
285
  • Calculus and Beyond Homework Help
Replies
1
Views
723
Back
Top