The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation.

Similar documents
Distribution of Primes

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02

Discrete Math Class 4 ( )

Carmen s Core Concepts (Math 135)

Applications of Fermat s Little Theorem and Congruences

Solutions for the Practice Questions

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

Number Theory/Cryptography (part 1 of CSC 282)

Modular Arithmetic. claserken. July 2016

1.6 Congruence Modulo m

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013

Solutions for the 2nd Practice Midterm

6. Find an inverse of a modulo m for each of these pairs of relatively prime integers using the method

SOLUTIONS TO PROBLEM SET 5. Section 9.1

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively.

Math 255 Spring 2017 Solving x 2 a (mod n)

An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g.,

Assignment 2. Due: Monday Oct. 15, :59pm

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties.

NUMBER THEORY AMIN WITNO

Congruence. Solving linear congruences. A linear congruence is an expression in the form. ax b (modm)

Math 412: Number Theory Lecture 6: congruence system and

Primitive Roots. Chapter Orders and Primitive Roots

LECTURE 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI

CHAPTER 2. Modular Arithmetic

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm

Modular Arithmetic. Kieran Cooney - February 18, 2016

A Quick Introduction to Modular Arithmetic

Discrete Square Root. Çetin Kaya Koç Winter / 11

Numbers (8A) Young Won Lim 5/22/17

Fermat s little theorem. RSA.

Numbers (8A) Young Won Lim 6/21/17

Numbers (8A) Young Won Lim 5/24/17

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014

Introduction. and Z r1 Z rn. This lecture aims to provide techniques. CRT during the decription process in RSA is explained.

Introduction to Modular Arithmetic

Wilson s Theorem and Fermat s Theorem

LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS

ALGEBRA: Chapter I: QUESTION BANK

Modular arithmetic Math 2320

The Chinese Remainder Theorem

Grade 6/7/8 Math Circles April 1/2, Modular Arithmetic

PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number.

Number Theory. Konkreetne Matemaatika

6.2 Modular Arithmetic

SOLUTIONS FOR PROBLEM SET 4

Goldbach Conjecture (7 th june 1742)

Solutions for the Practice Final

To be able to determine the quadratic character of an arbitrary number mod p (p an odd prime), we. The first (and most delicate) case concerns 2

MATH 135 Algebra, Solutions to Assignment 7

by Michael Filaseta University of South Carolina

Math 127: Equivalence Relations

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION

Power = 36² mod 99 Power = 9 5 a 5 = 0 x = 81 Power = 9² mod 99 Power = 81 6 a 6 = 1 x = 81 x 81 mod 99 x = 27 7 a 7 = 1 x = 27 x 27 mod 99 x = 36

Constructions of Coverings of the Integers: Exploring an Erdős Problem

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence.

ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey

MAT Modular arithmetic and number theory. Modular arithmetic

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m.

Data security (Cryptography) exercise book

Cryptography, Number Theory, and RSA

Foundations of Cryptography

Algorithmic Number Theory and Cryptography (CS 303)

Number Theory for Cryptography

MATH 13150: Freshman Seminar Unit 15

Sheet 1: Introduction to prime numbers.

Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

The Chinese Remainder Theorem

An elementary study of Goldbach Conjecture

Arithmetic of Remainders (Congruences)

Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers.

Practice Midterm 2 Solutions

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

#A3 INTEGERS 17 (2017) A NEW CONSTRAINT ON PERFECT CUBOIDS. Thomas A. Plick

Implementation / Programming: Random Number Generation

Math 1111 Math Exam Study Guide

University of British Columbia. Math 312, Midterm, 6th of June 2017

SESAME Modular Arithmetic. MurphyKate Montee. March 2018 IN,Z, We think numbers should satisfy certain rules, which we call axioms:

Introduction To Modular Arithmetic

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

Chapter 4 Cyclotomic Cosets, the Mattson Solomon Polynomial, Idempotents and Cyclic Codes

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = =

Modular Arithmetic: refresher.

Exam 1 7 = = 49 2 ( ) = = 7 ( ) =

Number-Theoretic Algorithms

1111: Linear Algebra I

Goldbach conjecture (1742, june, the 7 th )

Overview. The Big Picture... CSC 580 Cryptography and Computer Security. January 25, Math Basics for Cryptography

12. Let Rm = {0,1,2,..., m 1} be a complete residue system modulo ra. Let a be an integer. When is a Rm = {0,1 a, 2 a,...

DUBLIN CITY UNIVERSITY

Two congruences involving 4-cores

Diffie-Hellman key-exchange protocol

Algorithmic Number Theory and Cryptography (CS 303)

1 Introduction to Cryptology

Math 1111 Math Exam Study Guide

Rational Points On Elliptic Curves - Solutions. (i) Throughout, we ve been looking at elliptic curves in the general form. y 2 = x 3 + Ax + B

Transcription:

Congruences A congruence is a statement about divisibility. It is a notation that simplifies reasoning about divisibility. It suggests proofs by its analogy to equations. Congruences are familiar to us as clock arithmetic. Four hours after 10 AM it will be 2 PM. How do we get the 2 from the 10 and the 4? We add four to ten and then subtract 12. We have used a congruence modulo 12. 1

Definition: Suppose a and b are integers and m is a positive integer. If m divides a b, then we say a is congruent to b modulo m and write a b (mod m). If m does not divide a b, we say a is not congruent to b modulo m and write a b (mod m). The formula a b (mod m) is called a congruence. The integer m is called the modulus (plural moduli) of the congruence. Do not confuse the binary operator mod in a mod b, which means the remainder when a is divided by b, with the mod enclosed in parentheses together with the modulus of a congruence. These concepts are related as follows. If m is a positive integer and a and b are integers, then a b (mod m) if and only if (a mod m) = (b mod m). We will often use the fact that a b (mod m) if and only if there is an integer k so that a = b+km. This fact follows immediately from the definitions of congruence and divide. 2

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation. THEOREM: Let m be a positive integer. Let a, b and c be integers. Then: 1. a a (mod m). 2. If a b (mod m), then b a (mod m). 3. If a b (mod m)and b c (mod m), then a c (mod m). 3

Let m > 0 be fixed. For each integer a, the set of all integers b a (mod m) is called the congruence class or residue class of a modulo m. The congruence class of a modulo m consists of all integers in the arithmetic progression a + dm, where d runs through all integers. Each integer in a congruence class is a representative of it. If the modulus m is understood and a and b are in the same congruence class, then each is called a residue of the other. The smallest nonnegative representative of a congruence class is often used as the standard representative of it. For example, the standard representative of the congruence class of 27 (mod 5) is 2. 4

THEOREM: Let a, b, c and d be integers. Let m be a positive integer. Suppose a b (mod m) and c d (mod m). Then 1. a + c b + d (mod m). 2. a c b d (mod m). 3. ac bd (mod m). Let a and b be integers. Let m be a positive integer. Let f be a polynomial with integer coefficients. If a b (mod m), then f(a) f(b) (mod m). Let a and b be integers. Let m and d be positive integers with d m. If a b (mod m), then a b (mod d). 5

Although the arithmetic operations of addition, subtraction and multiplication for congruences obey the usual rules for the same operations with integers, division does not always work as for integers. For example, 2 3 = 6 18 = 2 9 (mod 12), but 3 9 (mod 12). In general ac bc (mod m) does not always imply a b (mod m). We now investigate when this implication will be true. 6

THEOREM: If gcd(a, m) = 1, then there is a unique x in 0 < x < m such that ax 1 (mod m). Proof: The function f(i) = (ai mod m) for 1 i m 1 is one-to-one, and so the set {ai mod m; i = 1,..., m 1} is a permutation of {1,..., m 1}. Therefore 1 appears exactly once in the first set, that is, there is exactly one x in 0 < x < m such that ax 1 (mod m). Note that the x in this theorem is like a 1, the reciprocal of a modulo m. Sometimes we even use the notation a 1 (mod m) to mean the x of this theorem. 7

A good way to compute a 1 (mod m) is with the Extended Euclidean algorithm. We have gcd(a, m) = 1 in order for a 1 (mod m) to be defined. The Extended Euclidean algorithm gives us integers x and y with ax + my = gcd(a, m) = 1. This equation implies the congruence ax 1 (mod m) so that x (or m + x if x < 0) is a 1 (mod m). 8

THEOREM: If m > 1, a, b, c are integers, (c 0), gcd(c, m) = 1, then ac bc (mod m) implies a b (mod m). Proof: By the previous theorem, there is an x such that cx 1 (mod m). Then ac bc (mod m) implies acx bcx (mod m), which implies a1 b1 (mod m), which implies a b (mod m). Definition: A set of m integers r 1,..., r m is a complete set of residues (CSR) modulo m if every integer is congruent modulo m to exactly one of the r i s. The set {1,..., m} is called the standard CSR modulo m. 9

Linear Congruences We now tell how to solve congruences like ax b (mod m), where a, b and m > 1 are given integers and x is an unknown integer. The solution to an equation ax = b, where a 0, is the single number x = a/b. In contrast, if the congruence ax b (mod m) has any solution, then infinitely many integers x satisfy it. For example, the solution to the congruence 2x 1 (mod 5) is all integers of the form x = 5k + 3, where k may be any integer, that is, x lies in the arithmetic progression..., 12, 7, 2, 3, 8, 13, 18,.... This set of integers may be described compactly as x 3 (mod 5). We could have written this solution as x 28 (mod 5), but we generally use the least nonnegative residue as the standard representative of its congruence class. 10

THEOREM: Let m > 1, a and b be integers. Then ax b (mod m) has a solution if and only if gcd(a, m) divides b. THEOREM: Let m > 1, a and b be integers. Suppose gcd(a, m) = 1. Then ax b (mod m) has 1 solution modulo m. It is x bx 0 (mod m), where x 0 is any solution of ax 0 1 (mod m). This means that x = bx 0 + tm, t = 0, 1,..., are all integer solutions x. Example: Solve 7x 3 (mod 12). We find g = gcd(7, 12) = 1, so there is a solution. Since 7 7 1 (mod 12), we have x 0 = 7, and the solution to 7x 3 (mod 12) is x = 3 7 + t 12 = 21 + 12t 9 (mod 12). 11

Example: Solve 59x 23 (mod 103). We have gcd(59, 103) = 1 since both are prime. The Extended Euclidean Algorithm gives ( 4)(103) + (7)(59) = 1, so (7)(59) 1 (mod 103). This means 59 1 mod 103 = 7. The solution to 59x 23 (mod 103) is x (23)(59 1 ) (23)(7) = 161 58 (mod 103). This may also be written x = 58 + 103t, where t is any integer. 12