-1

I am asked to find the inverse of the congruence class $\{x : x \equiv 5 \,\, (mod \,\, 13)\}$.

Below is my work:

Congruence class can be rewritten as $\{x : x - 13k = 5\}$

$1 = 13 - 12 *1$ $5 = 5 * 13 - 60 * 1$

$-60 \equiv -60 + 6(13) \equiv 18 \equiv 5^{-1} \,\, (mod \,\, 13)$

So in other words, is the inverse to this congruence class $\{x : x \equiv 18 \,\, (mod \,\, 13)\}$? What I am confused by is that I can always add a different multiple of $13$ to $-60$ so I can also have $\{x : x \equiv 31 \,\, (mod \,\, 13)\}$. How do I know which one is the right inverse?

Bill Dubuque
  • 272,048
  • $5=513-601 \Rightarrow -60\equiv 5 \pmod{13}$, not $5^{-1}$. To find $5^{-1}$ you should find $a$, such that $5a\equiv 1\pmod{13}$. $1+39=40=5*8 \Rightarrow 8\equiv 5^{-1} \pmod {13}$. As to second question: $-60\equiv 31\pmod{13}$, so these numbers are in one congruence class. You can choose number from 0 to 12 as a basic number for specifying congruence class, but you can also use other numbers. – Ivan Kaznacheyeu Nov 04 '21 at 11:58
  • Always work with representative elements. Let us write $\hat 5$ for the class of $5$ when working modulo $13$, i.e. in the group $\Bbb Z/13$. Then $\dots =\hat{-8}=\hat 5=\hat{18}=\dots$ - and for the inverse we have also more representatives, but all correspond to the same class. E.g. from $\hat 5\cdot \hat 5=\hat{25}=\hat{-1}$ we can already see that (the class of) $-5$ is the inverse of the (class of) $5$ in the ring $\Bbb Z/13$. Usually, the hats are omitted when we once for all mention we work modulo $13$. – dan_fulea Nov 04 '21 at 12:00
  • It's because $\bmod 13!:\ a\equiv b\Rightarrow a^{-1}\equiv b^{-1},$ by the linked dupe. There is no "right one" but usually one choose the least nonnegative rep of the congruence class, i.e. $,5^{-1}\equiv -18\equiv 8,$ is the least nonnegative in $,-18+13\Bbb Z = {\ldots , -31,-18,-5,8,\ldots}\ \ $ – Bill Dubuque Dec 16 '21 at 14:30

2 Answers2

0

We have that

\begin{align} 13 &= 2*5 +3\\ 5 &= 1*3 +2\\ 3 &= 1*2 +1\\ \end{align}

and this implies that \begin{align} 1 &= 3 - 1*2\\ &= 3 - 1*(5-1*3)\\ &= 2*3 - 1*5\\ &= 2*(13 - 2*5) - 1*5\\ &= 2*13 - 5*5 \end{align}

As a result, $5^{-1} \equiv -5 \equiv 8 \mod 13$. Therefore, the inverse congruence class of $5$ equals $\{x : x \equiv 8 \mod 13\}$.

Note: you can always add or substract multiples of 13, so $$\{x : x \equiv 8 \mod 13\} = \{x : x \equiv -5 \mod 13\} = \{x : x \equiv 21 \mod 13\} = \ldots$$

Student
  • 4,438
0

The inverse of a congruence class is another congruence class, so that the inverse can be written $18\bmod 13$ as well as $31\bmod{13}$ since they're the same congruence class.

This being said the efficient way to find the inverse of a congruence class is to apply the extended Euclidean algorithm, to produce a Bézout's relation between a representative of the congruence class and the modulus. In the present case, it would go this way:

\begin{array}{r|rr|l} r_i&u_i & v_i &q_i \\ \hline 13 & 0 & 1 \\ 5 & 1 & 0 & 2 \\ \hline 3 & -2 & 1 & 1 \\ 2 & 3 & -1 & 1 \\ 1 & -5 & 2 \\ \hline \end{array} Therefore we have Bézout's identity $-5^2+2\cdot 13=1$, which shows the inverse of $5\bmod 13$ is $-5\bmod 13$, which is the same as $8\bmod 13$.

B.t.w. there's an error in your computation: $5^{-1}\bmod 13$ is not $18\bmod 13$, but $-18\bmod 13$.

Bernard
  • 175,478