Theorem: Multiplicative inverse of x mod m is y with x*y = 1(mod m).
Example: For 4 modulo 7 inverse is 2: 2*4 = 8 = 1(mod 7).
Why 1(mod 7) is 8? I thought mod(1,7) = 1
Theorem: Multiplicative inverse of x mod m is y with x*y = 1(mod m).
Example: For 4 modulo 7 inverse is 2: 2*4 = 8 = 1(mod 7).
Why 1(mod 7) is 8? I thought mod(1,7) = 1
There are two notions of mod, which are related but distinct.
One is a binary operation, which gives a result of two numbers, and is often used in computer science:
$\mod(a,b)$ is the remainder when $a$ is divided by $b$.
In that context, $\mod(1,7)=\color{blue}1$ because $1=0\times7+\color{blue}1.$
The other is a relation, often used in mathematics:
$a\equiv b\pmod n$ means $n$ divides $a-b$.
In that context, $1\equiv8\pmod7$, because $7\mid1-8$.