Introduction to Modulo Arithmetic:
Hi everyone. In this post, we will learn about modulo arithmetic and discuss
some rules.
Modular arithmetic is a system of arithmetic for integers, which consists of remainders.
Consider the following expression:
a=qn+r∣0≤r<a
∴,a≡r(modn)
For example,
13≡21(mod2)
as
13=1(mod2)
and
21=1(mod2)
Note: ≡ is not the same as =
Addition properties
- If a+b=c, then a(mod N) + b(mod N) ≡ c(mod N).
- If a≡b(mod N), then a+k≡b+k(mod N) for any integer k.
- If a≡b(mod N) and c≡d(mod N), then a+c≡b+d(mod N).
- If a≡b(mod N), then −a≡−b(mod N).
Multiplication properties
- If a⋅b=c, then a(mod N) ⋅ b(mod N) ≡ c(mod N).
- If a≡b(mod N), then ka≡kb(mod N) for any integer, k.
- If a≡b(mod N) and c≡d(mod N), then ac≡bd(mod N).
Exponentiation property
If a≡b(mod N), then ak≡bk(mod N), for any positive integer, k.
Division property
If gcd(k,N)=1, and ka≡kb(mod N), then a≡b(mod N).
You can’t just divide both sides, unless the above property is true.
Modular inverse
If a and N are integers such that gcd(a,N)=1, then there exists an integer,
x, such that ax≡1(mod N).
Comments
Post a Comment