
Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Discrete Mathematics Number Theory and Cryptography Prof. Steven Evans Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors 4.1: Divisibility and Modular Arithmetic Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Divisibility Definition If a and b are integers with a 6= 0, we say that a divides b if there b is an integer c such that b = ac (equivalently: if a is an integer), and we write a j b. In this case, we say that a is a factor or divisor of b and that b is a multiple of a. Prof. Steven Evans Discrete Mathematics Corollary If a, b, and c are integers with a 6= 0 such that a j b and a j c, then a j (mb + nc) whenever m and n are integers. Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Divisibility Theorem Let a, b, and c be integers with a 6= 0. 1 If a j b and a j c, then a j (b + c). 2 If a j b, then a j bc for all integers c. 3 If a j b and b j c, then a j c. Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Divisibility Theorem Let a, b, and c be integers with a 6= 0. 1 If a j b and a j c, then a j (b + c). 2 If a j b, then a j bc for all integers c. 3 If a j b and b j c, then a j c. Corollary If a, b, and c are integers with a 6= 0 such that a j b and a j c, then a j (mb + nc) whenever m and n are integers. Prof. Steven Evans Discrete Mathematics Notation d is called the divisor. a is called the dividend. q is called the quotient. r is called the remainder. Sometimes q = a div d and r = a mod d are used to denote these relationships. Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors The division algorithm Theorem: The division algorithm Let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 ≤ r < d, such that a = dq + r. Prof. Steven Evans Discrete Mathematics Sometimes q = a div d and r = a mod d are used to denote these relationships. Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors The division algorithm Theorem: The division algorithm Let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 ≤ r < d, such that a = dq + r. Notation d is called the divisor. a is called the dividend. q is called the quotient. r is called the remainder. Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors The division algorithm Theorem: The division algorithm Let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 ≤ r < d, such that a = dq + r. Notation d is called the divisor. a is called the dividend. q is called the quotient. r is called the remainder. Sometimes q = a div d and r = a mod d are used to denote these relationships. Prof. Steven Evans Discrete Mathematics Theorem Let a and b be integers, and let m be a positive integer. Then a ≡ b (mod m) if and only if a mod m = b mod m. Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Modular arithmetic Definition If a and b are integers and m is a positive integer, then a is congruent to b modulo m if m j a − b. We denote this by a ≡ b (mod m): This sentence is called a congruence and that m is its modulus (pl.: moduli). Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Modular arithmetic Definition If a and b are integers and m is a positive integer, then a is congruent to b modulo m if m j a − b. We denote this by a ≡ b (mod m): This sentence is called a congruence and that m is its modulus (pl.: moduli). Theorem Let a and b be integers, and let m be a positive integer. Then a ≡ b (mod m) if and only if a mod m = b mod m. Prof. Steven Evans Discrete Mathematics If a ≡ b (mod m), by the definition of congruence we know that m j (a − b). This means there's an integer k with a − b = km, or equivalently that a = b + km. Conversely, if there is an integer k with a = b + km, then km = a − b. Hence, m divides a − b, so that a ≡ b (mod m). Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Modular arithmetic Theorem Let m be a positive integer. The integers a and b are congruent modulo m if and only if there is an integer k such that a = b + km. Proof: Prof. Steven Evans Discrete Mathematics Conversely, if there is an integer k with a = b + km, then km = a − b. Hence, m divides a − b, so that a ≡ b (mod m). Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Modular arithmetic Theorem Let m be a positive integer. The integers a and b are congruent modulo m if and only if there is an integer k such that a = b + km. Proof: If a ≡ b (mod m), by the definition of congruence we know that m j (a − b). This means there's an integer k with a − b = km, or equivalently that a = b + km. Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Modular arithmetic Theorem Let m be a positive integer. The integers a and b are congruent modulo m if and only if there is an integer k such that a = b + km. Proof: If a ≡ b (mod m), by the definition of congruence we know that m j (a − b). This means there's an integer k with a − b = km, or equivalently that a = b + km. Conversely, if there is an integer k with a = b + km, then km = a − b. Hence, m divides a − b, so that a ≡ b (mod m). Prof. Steven Evans Discrete Mathematics Theorem Let m be a positive integer. If a ≡ b (mod m) and c ≡ d (mod m), then a + c ≡ b + d (mod m) and ac ≡ bd (mod m): Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Modular arithmetic Definition The set of all integers congruent to an integer a modulo m is called the congruence class of a modulo m. There are m pairwise disjoint equivalence classes modulo m, and the union of these equivalence classes is the entire set of integers. Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Modular arithmetic Definition The set of all integers congruent to an integer a modulo m is called the congruence class of a modulo m. There are m pairwise disjoint equivalence classes modulo m, and the union of these equivalence classes is the entire set of integers. Theorem Let m be a positive integer. If a ≡ b (mod m) and c ≡ d (mod m), then a + c ≡ b + d (mod m) and ac ≡ bd (mod m): Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Modular arithmetic Corollary Let m be a positive integer and let a and b be integers. Then: (a + b) mod m = ((a mod m) + (b mod m)) mod m; and ab mod m = ((a mod m)(b mod m)) mod m: Prof. Steven Evans Discrete Mathematics Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Arithmetic modulo m We can define modular arithmetic operations on Zm, the set of nonnegative integers less than m (i.e., the set f0; 1;:::; m − 1g). The operation of addition modulo m is given by a +m b = (a + b) mod m; where the addition on the right-hand side of this equation is the ordinary addition of integers. The operation of multiplication modulo m is given by a ·m b = (a · b) mod m; where again the multiplication on the right-hand side is ordinary multiplication of integers. The operations +m and ·m are called addition and multiplication modulo m, respectively. Prof. Steven Evans Discrete Mathematics Associativity: If a, b, and c belong to Zm, then (a +m b) +m c = a +m (b +m c). Commutativity: If a and b belong to Zm, then a +m b = b +m a and a ·m b = b ·m a. Identity elements: For a 2 Zm, we have a +m 0 = a and a ·m 1 = a. Additive inverses: If a 6= 0 belongs to Zm, then m − a is an additive inverse of a modulo m and 0 is its own additive inverse. That is: a +m (m − a) = 0 and 0 +m 0 = 0. Distributivity: If a, b, and c belong to Zm, then a ·m (b +m c) = (a ·m b) +m (a ·m c): Divisibility and Modular Arithmetic Integer Representations and Algorithms Primes and Greatest Common Divisors Arithmetic modulo m Closure: Let a; b 2 Zm, then a +m b and a ·m b are also in Zm.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages69 Page
-
File Size-