1

Rebound from this question: Debug back-substitution in extended Euclidean algorithm

My professor is telling me the correct answer to modular inverse of $28$ mod $45$ is $37$ and NOT $-8$. He says it has to be an answer in the range of 0-45. Is he correct?

My understanding of the definition suggests that both $-8$ and $37$ are valid answers.

Does the modular inverse definition requires a number within the range?

There is no context, I was asked on a homework problem to calculate the modular inverse of 28 mod 45. No clarification, no context.

EDIT: Well there was context that I was unaware of. My bad.

  • 2
    You can suit any restriction on which number you use to represent a particular residue class to the problem you are working on. A lot of computer languages implement $[0,m-1]$ as the chosen values, which might explain your professor's remark. Context might clarify. – Joffan Apr 26 '21 at 15:47
  • @Joffan So you're telling me he restricted it because it was required for the class? and if he only asked me to do 28 mod 45 then -8 would then still be valid? Sorry, I have no context, because all I was asked was to find the inverse of 28 mod 45. I just assume he's wrong and made a mistake. – i am bad at coding Apr 26 '21 at 15:48
  • 1
    Obviously I wasn't there, so I don't *know* with confidence why the required range to use was the (fairly common) one of small non-negative numbers. But it might suit a particular application, or it might just be for marking convenience. If you are comfortable handling negative residues, they can be useful. – Joffan Apr 26 '21 at 15:52
  • @Joffan let's suppose he made no mention of any specific range requirement before giving the problem. He'd be wrong right? – i am bad at coding Apr 26 '21 at 15:54
  • 4
    Without any further restriction on the task, $a=-8$ is a correct answer to "Find $a$ such that $28a\equiv 1\bmod 45$" – Joffan Apr 26 '21 at 15:55
  • @Joffan thank you for the confirmation. – i am bad at coding Apr 26 '21 at 15:55
  • 1
    In my opinion he is wrong. When we say "the modular inverse of 28" we are asking for the equivalence class of integers that that when multiplied by 28 will have a result congruent to $1$ we are asking for a class and any representative (such as $-8, 37, - 53, 4537$) will accurately represent it. If he had specified on day 1 that by convention we will always use representatives $0,...44$ he'd a case, but not that $-8$ isn't an inverse but that $37$ is the way we write $-8$. But if so I think he is missing the point of modular arithmetic. – fleablood Apr 26 '21 at 18:54

1 Answers1

1

In modular arithmetic, all elements are members of an equivalence class and as such, referencing any member of a class is an acceptable way to represent that class.

For example, modulo $45$, the element $28$ is a representative of the equivalence class comprising integers of the form $28 + 45k$, where $k$ is any integer, where the equivalence relation $\equiv$ between two elements $a$ and $b$ is $45 \mid (a-b)$; i.e., their difference is divisible by $45$.

Because of this, there is no such thing as a unique representative of the set of equivalence classes; you can choose any representation you wish. The representation $\{0, 1, 2, \ldots, 44\}$ is in some sense "canonical," but it is not forced, because in referring to a class by a representative element, say $37$, we are not speaking of the specific element itself, but the entire class it represents.

Consequently, to accept $37$ as an answer but not $-8$ is mathematically incorrect. Both are multiplicative inverses of $28$ modulo $45$ since as was previously noted, $(37)(28) = 1036$ and $(-8)(28) = -224$, both of which are members of the same equivalence class $1$, modulo $45$. In order to make such a preference acceptable, the desired group representation must be explicitly stated in advance; e.g., "find the least nonnegative integer $a$ that $28a \equiv 1 \pmod {45}$," or something to that effect. Otherwise, simply saying "find the multiplicative inverse of $28$ modulo $45$" is misleading because the word "the" erroneously implies such an inverse is unique when in fact any member of the corresponding equivalence class is a solution.

heropup
  • 135,869
  • ah I got it now, "The set {0, 1, 2,..., m-1} along with addition and multiplication mod m defines a closed mathematical system with m elements called a ring. The ring {0, 1, 2,..., m-1} with addition and multiplication mod m is denoted by Zm. Many different kinds of rings are studied in abstract mathematics. In this material, we will only be concerned with rings of the form Zm for some integer m greater than 1. The addition and multiplication tables for Z5 are given below." – i am bad at coding Apr 27 '21 at 20:30
  • There was a context in the textbook that I did not read. He must've mentioned it during class and I never paid attention. – i am bad at coding Apr 27 '21 at 20:30