0

I am fairly new to number systems and notations. I have a problem where I need to find $c$ in:

$13c ≡ 27a − b^{3} \mod (43)$ given that $0 \leq c < 43$.

Also, $a ≡ 27 \mod(43)$ and $b ≡ 19 (\mod 43)$ where $a$ and $b$ are integers.

I know that the procedure is to solve the right-hand side, so, in this case, it should be:

$c = 27 *27 - 19^{3} \mod(43) = - 6130 \mod(43) = 19$

Now the $13$ one that is attached to $c$, should it also go into the equation thus c = 19 / 13?

But, is weird since $c$ is supposed to be an integer, just like $a$ and $b$. Any clue?

Bill Dubuque
  • 272,048
  • Why did you write "$c = 27 27 - 19^{3} \mod(43) = - 6130 \mod(43) = 19$" instead of "$13c = 27 27 - 19^{3} \mod(43) = - 6130 \mod(43) = 19$"? – fleablood Sep 29 '20 at 15:55
  • See the linked dupes for many ways to compute modulr inverses and fractions sch as your $,19/13\bmod 43\ \ $ – Bill Dubuque Sep 29 '20 at 21:30

2 Answers2

1

Since $a\equiv 27 \pmod{43}$ and $b\equiv 19\pmod{43}$ we have that $$13c\equiv 27\cdot27-(19)^{3}\equiv-6130\equiv 19 \pmod{43}.$$

Now you can use the Euclidean algorithm to find the multiplicative inverse of $13$ modulo $43$.

Since $$13\cdot10-3\cdot43=1$$

then $$13\cdot10\equiv 1\pmod{43}$$ and thus $13^{-1}\equiv 10 \pmod {43}$ (that is $10$ is the multiplicative inverse of $13$ mod $43$). Hence multiplying the above congruence by $10$ we obtain $$13\cdot10c\equiv c\equiv19\cdot 10\equiv190\equiv 18\pmod{43}$$

Thus $$c\equiv 18 \pmod {43}.$$

Alessio K
  • 10,599
1

In general you can't do division over modulo arithmetic.

You can do addition:

Because if $a \equiv \alpha \pmod n$ and $b\equiv \beta \pmod n$ then $a = \alpha + kn$ for some integer $k$ and $b \equiv beta + jn$ for some integer $j$, so $a+ b = \alpha + \beta + (k+j)n$ and $k+j$ is an integer so $a+b\equiv \alpha + \beta \pmod n$.

And you can do multiplication:

Same $a,b,\alpha, \beta$ as above so $ab = \alpha\beta + k\beta n + j\alpha n + jk n^2 = \alpha\beta + n(k\beta + j\alpha +jkn)$ and $(k\beta + j\alpha +jkn)$ is an integer.

But you can't do division (in general):

If $a \equiv \alpha \pmod n$ then $a = \alpha + k n$ for some integer $k$. Then if we divide both sides by $m$ we get $\frac am =\frac \alpha m + \frac km n$ which has three problems 1) $\frac km$ need not be an integer and 2) $\frac am$ and $\frac \alpha m$ may not be integers. 3) if $m$ does not divide $k$ but does divide $kn$ you get a false result.

And example of 3) what but $2 \equiv 12 \pmod {10}$ but if we divide both sides by $2$ we get $1\not \equiv 6 \pmod {10}$. What is actually going on is $2 = 12 + (-1)\cdot 10$ so if we divide both sides by $2$ we get $1 = 6 + \frac {-1}2 10 = 6 + (-1)\cdot 5$.

......

So we can't divide by $13$.

But we can multiply by something else.

You have $13c \equiv 19\pmod {43}$ so for any $m$ we can do

$(13m)c \equiv 19m \pmod {43}$. We have to find an $m$ where $13 \equiv 1 \pmod {43}$.

.... And here's the thing. If $a$ and $n$ are relatively prime you can always find an $m$ so that $am \equiv 1 \pmod n$. And if $a$ and $n$ are not relatively prime you can not.

This is a result of Euclids algorithn and division.

$43 = 3*13 + 4$. So $4 = 43 - 3*13$ and $3*13 \equiv -4 \pmod {43}$

$13 = 3*4 + 1$ so $1=13 - 3*4=13-3(43-3*13)=10*13-3*43$ and $10*13 \equiv 1\pmod {43}$

.....

So if $13c \equiv 19 \pmod {43}$

$130c \equiv 190 \pmod {43}$ and $130 = 1 + 4*43 \equiv 1\pmod{43}$ and $190 =18+4*43\equiv 18\pmod{43} $

So $c \equiv 18\pmod {43}$.

...... and if we need confirmation because this is new and strange to us....

We know $13c \equiv 19\pmod {43}$ so there is a $k$ so that

$13c = 19 + 43k$

$13c*10= 130c =190 + (10k)43$

$c + 4*43c = 18 + 4*43 + (10k)43$

$c = 18 + 4*43 + (10k)43 -4*43c$

$c = 18 + 43(4+10k -4c)$

So, indeed, we DO have $c \equiv 18 \pmod 43$.

And because $0\le 18 < 43$ we must have $c=18$.

=====

$am \equiv 1 \pmod n$ then we say $m$ is the multiplicative inverse of $a$. Such a value exists if and only if $a$ and $n$ are relatively prime.

For notation we can write $m$ as $a^{-1}$ or even as $\frac 1a$ because it is the multiplicative inverse , after all. But it is important to realize that although it LOOKS like a fraction, it most certainly is NOT a fraction.

So you might see some one writhe "$\frac 1{13}\equiv 10 \pmod {43}$ or $13^{-1} \equiv 10 \pmod {43}$.

This does NOT mean $\frac 1{13} = 10 + 43k$ for some integer $k$ (that would be ridiculous). But it means $13\cdot 10 \equiv 1 \pmod {43}$ or that $1 = 10\cdot 13 + 43j$ for some integer $j$ (which is not at all ridiculous).

fleablood
  • 124,253