Introduction to Modular Arithmetic

Introduction to Modular Arithmetic

Introduction to Modular Arithmetic Subodh Sharma Subhashis Banerjee IIT Delhi, Computer Science Department Detour svs, suban: Introduction to Modular Arithmetic 2 I Given a; n 2 Z; n > 0 the notation r = a mod n represents the remainder of the division of a by n and q = ba=nc represents the quotient of the division. I Formally, [a]n = fa + kn : k 2 Zg I Example: [3]7 = {· · · ; −11; −4; 3; 10; 17; · · · g = [−4]7 = [10]7 I Thus, a 2 [b]n is the same as writing a ≡ b (mod n). I Division Theorem: For any integer a and any positive integer n, there exist unique integers q and r s.t.: a = qn + r where 0 ≤ r < n. I [a]n be the equivalence classes according to the remainders modulo n. I Set of all such equivalence classes: Zn = f[a]n : 0 ≤ a ≤ n − 1g will be read as f0; 1; ··· ; n − 1g Theory of Division I Let Z = {· · · ; −2; −1; 0; 1; 2; · · · g be the set of integers. svs, suban: Introduction to Modular Arithmetic 3 I Formally, [a]n = fa + kn : k 2 Zg I Example: [3]7 = {· · · ; −11; −4; 3; 10; 17; · · · g = [−4]7 = [10]7 I Thus, a 2 [b]n is the same as writing a ≡ b (mod n). I Given a; n 2 Z; n > 0 the notation r = a mod n represents the remainder of the division of a by n and q = ba=nc represents the quotient of the division. I [a]n be the equivalence classes according to the remainders modulo n. I Set of all such equivalence classes: Zn = f[a]n : 0 ≤ a ≤ n − 1g will be read as f0; 1; ··· ; n − 1g Theory of Division I Let Z = {· · · ; −2; −1; 0; 1; 2; · · · g be the set of integers. I Division Theorem: For any integer a and any positive integer n, there exist unique integers q and r s.t.: a = qn + r where 0 ≤ r < n. svs, suban: Introduction to Modular Arithmetic 3 I Formally, [a]n = fa + kn : k 2 Zg I Example: [3]7 = {· · · ; −11; −4; 3; 10; 17; · · · g = [−4]7 = [10]7 I Thus, a 2 [b]n is the same as writing a ≡ b (mod n). I [a]n be the equivalence classes according to the remainders modulo n. I Set of all such equivalence classes: Zn = f[a]n : 0 ≤ a ≤ n − 1g will be read as f0; 1; ··· ; n − 1g Theory of Division I Let Z = {· · · ; −2; −1; 0; 1; 2; · · · g be the set of integers. I Division Theorem: For any integer a and any positive integer n, there exist unique integers q and r s.t.: a = qn + r where 0 ≤ r < n. I Given a; n 2 Z; n > 0 the notation r = a mod n represents the remainder of the division of a by n and q = ba=nc represents the quotient of the division. svs, suban: Introduction to Modular Arithmetic 3 I Formally, [a]n = fa + kn : k 2 Zg I Example: [3]7 = {· · · ; −11; −4; 3; 10; 17; · · · g = [−4]7 = [10]7 I Thus, a 2 [b]n is the same as writing a ≡ b (mod n). I Set of all such equivalence classes: Zn = f[a]n : 0 ≤ a ≤ n − 1g will be read as f0; 1; ··· ; n − 1g Theory of Division I Let Z = {· · · ; −2; −1; 0; 1; 2; · · · g be the set of integers. I Division Theorem: For any integer a and any positive integer n, there exist unique integers q and r s.t.: a = qn + r where 0 ≤ r < n. I Given a; n 2 Z; n > 0 the notation r = a mod n represents the remainder of the division of a by n and q = ba=nc represents the quotient of the division. I [a]n be the equivalence classes according to the remainders modulo n. svs, suban: Introduction to Modular Arithmetic 3 I Example: [3]7 = {· · · ; −11; −4; 3; 10; 17; · · · g = [−4]7 = [10]7 I Thus, a 2 [b]n is the same as writing a ≡ b (mod n). I Set of all such equivalence classes: Zn = f[a]n : 0 ≤ a ≤ n − 1g will be read as f0; 1; ··· ; n − 1g Theory of Division I Let Z = {· · · ; −2; −1; 0; 1; 2; · · · g be the set of integers. I Division Theorem: For any integer a and any positive integer n, there exist unique integers q and r s.t.: a = qn + r where 0 ≤ r < n. I Given a; n 2 Z; n > 0 the notation r = a mod n represents the remainder of the division of a by n and q = ba=nc represents the quotient of the division. I [a]n be the equivalence classes according to the remainders modulo n. I Formally, [a]n = fa + kn : k 2 Zg svs, suban: Introduction to Modular Arithmetic 3 I Set of all such equivalence classes: Zn = f[a]n : 0 ≤ a ≤ n − 1g will be read as f0; 1; ··· ; n − 1g Theory of Division I Let Z = {· · · ; −2; −1; 0; 1; 2; · · · g be the set of integers. I Division Theorem: For any integer a and any positive integer n, there exist unique integers q and r s.t.: a = qn + r where 0 ≤ r < n. I Given a; n 2 Z; n > 0 the notation r = a mod n represents the remainder of the division of a by n and q = ba=nc represents the quotient of the division. I [a]n be the equivalence classes according to the remainders modulo n. I Formally, [a]n = fa + kn : k 2 Zg I Example: [3]7 = {· · · ; −11; −4; 3; 10; 17; · · · g = [−4]7 = [10]7 I Thus, a 2 [b]n is the same as writing a ≡ b (mod n). svs, suban: Introduction to Modular Arithmetic 3 Theory of Division I Let Z = {· · · ; −2; −1; 0; 1; 2; · · · g be the set of integers. I Division Theorem: For any integer a and any positive integer n, there exist unique integers q and r s.t.: a = qn + r where 0 ≤ r < n. I Given a; n 2 Z; n > 0 the notation r = a mod n represents the remainder of the division of a by n and q = ba=nc represents the quotient of the division. I [a]n be the equivalence classes according to the remainders modulo n. I Formally, [a]n = fa + kn : k 2 Zg I Example: [3]7 = {· · · ; −11; −4; 3; 10; 17; · · · g = [−4]7 = [10]7 I Thus, a 2 [b]n is the same as writing a ≡ b (mod n). I Set of all such equivalence classes: Zn = f[a]n : 0 ≤ a ≤ n − 1g will be read as f0; 1; ··· ; n − 1g svs, suban: Introduction to Modular Arithmetic 3 I Eg: gcd(24; 30) = 6. I 24 = 2:2:2:3 I 30 = 2:3:5 I A useful characterization of gcd: If a and b are nonzero, then gcd(a; b) is the smallest positive number of the set fax + by : x; y 2 Zg. I If gcd(a; b) = 1, then a and b are relatively prime. I Relatively prime integers: gcd(a; b) = 1 I From above ) dja + b; dja − b. In general, djax + by for any integers x and y. I Greatest Common Divisor (gcd): Among all the common divisors of a and b, the largest among them is the gcd(a; b) I Note: No efficient solution for integer factorization. Common Divisors I If dja and djb, we say d is a common divisor of a and b. svs, suban: Introduction to Modular Arithmetic 4 I Eg: gcd(24; 30) = 6. I 24 = 2:2:2:3 I 30 = 2:3:5 I A useful characterization of gcd: If a and b are nonzero, then gcd(a; b) is the smallest positive number of the set fax + by : x; y 2 Zg. I If gcd(a; b) = 1, then a and b are relatively prime. I Relatively prime integers: gcd(a; b) = 1 I Greatest Common Divisor (gcd): Among all the common divisors of a and b, the largest among them is the gcd(a; b) I Note: No efficient solution for integer factorization. Common Divisors I If dja and djb, we say d is a common divisor of a and b. I From above ) dja + b; dja − b. In general, djax + by for any integers x and y. svs, suban: Introduction to Modular Arithmetic 4 I Eg: gcd(24; 30) = 6. I 24 = 2:2:2:3 I 30 = 2:3:5 I A useful characterization of gcd: If a and b are nonzero, then gcd(a; b) is the smallest positive number of the set fax + by : x; y 2 Zg. I If gcd(a; b) = 1, then a and b are relatively prime. I Relatively prime integers: gcd(a; b) = 1 I Note: No efficient solution for integer factorization. Common Divisors I If dja and djb, we say d is a common divisor of a and b. I From above ) dja + b; dja − b. In general, djax + by for any integers x and y. I Greatest Common Divisor (gcd): Among all the common divisors of a and b, the largest among them is the gcd(a; b) svs, suban: Introduction to Modular Arithmetic 4 I A useful characterization of gcd: If a and b are nonzero, then gcd(a; b) is the smallest positive number of the set fax + by : x; y 2 Zg. I If gcd(a; b) = 1, then a and b are relatively prime.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    65 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us