0
$\begingroup$

I was given following example in the book, however I am not sure how can the result of 27 be calculated. I realise that -13 + 40 gives 27, however how 27 ≡ −13 (mod 40) is the same as 3·(−13) ≡ 1 (mod 40) I dont really follow.

Moreover I don't really see how by Theorem ab≡cd(mod n) 3·27 ≡ 3·(−13) ≡ 1 (mod 40), I guess 3=a and c=3 by following example, ab≡cd. However it does not make much sense really.

find a linear combination of 3 and 40 that equals 1.

Step1: Divide 40 by 3 to obtain 40=3·13+1.This simples that 1=40−3·13. Step 2: Divide 3 by 1 to obtain 3 = 3·1 + 0. This implies that gcd(3, 40) = 1. Step 3: Use the result of step 1 to write

3·(−13) = 1 + (−1)40.

This result implies that −13 is an inverse for 3 modulo 40. In symbols, 3·(−13) ≡1 (mod 40). To find a positive inverse, compute 40 − 13. The result is 27, and 27 ≡ −13 (mod 40) because 27 − (−13) = 40. So, by Theorem ab≡cd(mod n) 3·27 ≡ 3·(−13) ≡ 1 (mod 40), and thus by the transitive property of congruence modulo n, 27 is a positive integer that is an inverse for 3 modulo 40. ■

Thank you for your help in advance

$\endgroup$
1
$\begingroup$

Since $40 = 3 \cdot 13 + 1$, \begin{align*} 40 - 3 \cdot 13 & = 1\\ 40 + -13 \cdot 3 & = 1\\ \end{align*}

Thus, $$-13 \cdot 3 \equiv 1 \pmod{40}$$ Hence, $-13$ is a multiplicative inverse of $3 \pmod{40}$. However, so is any integer that is equivalent to $-13 \pmod{40}$. Those integers have the form $-13 + 40k$, where $k \in \mathbb{Z}$. To see this, observe that
$$(-13 + 40k) \cdot 3 \equiv -13 \cdot 3 + 40 \cdot 3k \equiv -13 \cdot 3 \equiv 1 \pmod{40}$$ In particular, if $k = 1$, then $$(-13 + 40 \cdot k) \cdot 3 \equiv (-13 + 40) \cdot 3 \equiv 27 \cdot 3 \equiv 1 \pmod{40}$$ Hence, $27$ is an inverse of $3 \pmod{40}$. Since $0 \leq 27 < 40$, it is the positive inverse we seek.

Check: $27 \cdot 3 = 81 = 2 \cdot 40 + 1 \Rightarrow 27 \cdot 3 \equiv 1 \pmod{40}$, so $3^{-1} \equiv 27 \pmod{40}$.

$\endgroup$
  • $\begingroup$ thank you, i think I understand better now! $\endgroup$ – Nadia S Dec 31 '14 at 0:35
  • $\begingroup$ However I am not sure I agree with so 3^−1≡27(mod40) through. as 1/3 divided by 40 does not seem to give remainder of 27. Can you please elaborate on the last statement? $\endgroup$ – Nadia S Dec 31 '14 at 0:59
  • $\begingroup$ If we multiply each term in the equation $$3^{-1} = \frac{1}{3} \equiv 27 \pmod{40}$$ by $3$, we obtain $$1 \equiv 3 \cdot 27 \equiv 81 \equiv 2 \cdot 40 + 1 \equiv 1 \pmod{40}$$ Thus, $27$ is the multiplicative inverse, $3^{-1}$, of $3 \pmod{40}$. $\endgroup$ – N. F. Taussig Dec 31 '14 at 1:11
1
$\begingroup$

Hint $\ {\rm mod}\,\ kn\!+\!1\!:\,\ kn\!+\!1\equiv 0\,\Rightarrow\, -k\,n\equiv 1\,\Rightarrow\, n^{-1}\equiv -k.\ $ Yours is case $\, k,n = 13,3.$

Generally one can use the Extended Euclidean Algorithm to compute modular inverses (above is an optimization of the single-step case). Here is a convenient way to execute the algorithm.

$\endgroup$
  • $\begingroup$ Thank you for the precise answer! $\endgroup$ – Nadia S Dec 31 '14 at 0:35
1
$\begingroup$

The key idea you're missing, I think, is that in mod-40 arithmetic, -13 and 27 are the same number. So if -13 is the multiplicative inverse of some number, then so is 27.

Pretty much everything in that last paragraph is just an explanation for those who have not yet understood how in mod-40 arithmetic, -13 and 27 are the same number.

For example, this is what that abcd theorem is all about: if $a$ and $c$ are the same number in mod $n$ arithmetic, and $b$ and $d$ are the same number, then $ab$ and $cd$ are the same number too, since both products are doing the same thing.

$\endgroup$
0
$\begingroup$

Use the euclidean algorithm:

$40=3\cdot39+1\rightarrow 40-33(3)=1$

In this case you only needed one step, but it usually takes more than one step.

$\endgroup$
  • 1
    $\begingroup$ You meant $40 = 3 \cdot 13 + 1 \Rightarrow 40 - 13 \cdot 3 = 1$. $\endgroup$ – N. F. Taussig Dec 29 '14 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.