MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

Similar documents
2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

MATH 361: NUMBER THEORY FOURTH LECTURE

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Objective Type Questions

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

Elementary Number Theory. Franz Luef

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Proof 1: Using only ch. 6 results. Since gcd(a, b) = 1, we have

3 The fundamentals: Algorithms, the integers, and matrices

Part V. Chapter 19. Congruence of integers

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

M381 Number Theory 2004 Page 1

Lecture Notes. Advanced Discrete Structures COT S

4 Number Theory and Cryptography

CHAPTER 3. Congruences. Congruence: definitions and properties

Math 109 HW 9 Solutions

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a "

Number Theory Solutions Packet

Integers and Division

Notes on Systems of Linear Congruences

Chapter 5. Modular arithmetic. 5.1 The modular ring

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)

Math From Scratch Lesson 20: The Chinese Remainder Theorem

3.7 Non-linear Diophantine Equations

Elementary Number Theory Review. Franz Luef

a the relation arb is defined if and only if = 2 k, k

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Number Theory and Group Theoryfor Public-Key Cryptography

MATH 2200 Final Review

Chapter 1 : The language of mathematics.

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

Congruence of Integers

cse 311: foundations of computing Fall 2015 Lecture 11: Modular arithmetic and applications

Ch 4.2 Divisibility Properties

MATH 215 Final. M4. For all a, b in Z, a b = b a.

MONOALPHABETIC CIPHERS AND THEIR MATHEMATICS. CIS 400/628 Spring 2005 Introduction to Cryptography

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

This exam contains 5 pages (including this cover page) and 4 questions. The total number of points is 100. Grade Table

1 Overview and revision

The Euclidean Algorithm and Multiplicative Inverses

MATH 420 FINAL EXAM J. Beachy, 5/7/97

4. Congruence Classes

12x + 18y = 50. 2x + v = 12. (x, v) = (6 + k, 2k), k Z.

Number Theory Math 420 Silverman Exam #1 February 27, 2018

The number of ways to choose r elements (without replacement) from an n-element set is. = r r!(n r)!.

3.2 Solving linear congruences. v3

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

Modular Arithmetic Instructor: Marizza Bailey Name:

A SURVEY OF PRIMALITY TESTS

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

CSE 20 DISCRETE MATH. Winter

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

Carmen s Core Concepts (Math 135)

Introduction to Cryptography CS 355 Lecture 3

Number Theory Marathon. Mario Ynocente Castro, National University of Engineering, Peru

Lecture 4: Number theory

4 Powers of an Element; Cyclic Groups

Number Theory Marathon. Mario Ynocente Castro, National University of Engineering, Peru

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

MTH 346: The Chinese Remainder Theorem

Part IA Numbers and Sets

Math Homework # 4

Chapter 5. Number Theory. 5.1 Base b representations

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

NOTES ON SIMPLE NUMBER THEORY

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers

Direct Proof Divisibility

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Groups, Rings, and Finite Fields. Andreas Klappenecker. September 12, 2002

(e) Commutativity: a b = b a. (f) Distributivity of times over plus: a (b + c) = a b + a c and (b + c) a = b a + c a.

PROBLEMS ON CONGRUENCES AND DIVISIBILITY

ax b mod m. has a solution if and only if d b. In this case, there is one solution, call it x 0, to the equation and there are d solutions x m d

The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers:

Basic elements of number theory

Basic elements of number theory

Elementary Number Theory MARUCO. Summer, 2018

Application of the Euler Phi Function in the Set of Gaussian Integers

Relations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B.

Homework #2 solutions Due: June 15, 2012

CSE 20 DISCRETE MATH. Winter

Applied Cryptography and Computer Security CSE 664 Spring 2018

Prime Divisors of Palindromes

Tomáš Madaras Congruence classes

Number Theory. Final Exam from Spring Solutions

MATH 3030, Abstract Algebra FALL 2012 Toby Kenney Midyear Examination Friday 7th December: 7:00-10:00 PM

Wilson s Theorem and Fermat s Little Theorem

Theory of Numbers Problems

Mathematics for Cryptography

Solutions to Problem Set 3 - Fall 2008 Due Tuesday, Sep. 30 at 1:00

The Chinese Remainder Theorem

MAT246H1S - Concepts In Abstract Mathematics. Solutions to Term Test 1 - February 1, 2018

Transcription:

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

Congruences Let n be a postive integer. The integers a and b are called congruent modulo n if they have the same remainder when divided by n. An equivalent condition is that n divides the difference a b. Notation. a b mod n or a b (mod n). Examples. 12 4 mod 8, 24 0 mod 6, 31 4 mod 35. Proposition 1 If a b mod n then for any integer c, (i) a + cn b mod n; (ii) a + c b + c mod n; (iii) ac bc mod n. Proposition 2 Let a, b, c, n Z, n > 0. (i) If ac bc mod n and gcd(c, n) = 1, then a b mod n. (ii) If c > 0 and ac bc mod nc, then a b mod n.

Congruence classes Given an integer a, the congruence class of a modulo n is the set of all integers congruent to a modulo n. Notation. [a] n or simply [a]. Also denoted a + nz as [a] n = {a + nk : k Z}. Examples. [0] 2 is the set of even integers, [1] 2 is the set of odd integers, [2] 4 is the set of even integers not divisible by 4. If n divides a positive integer m, then every congruence class modulo n is the union of m/n congruence classes modulo m. For example, [2] 4 = [2] 8 [6] 8. The congruence class [0] n is called the zero congruence class. It consists of the integers divisible by n. The set of all congruence classes modulo n is denoted Z n.

Modular arithmetic Modular arithmetic is an arithmetic on the set Z n for some n 1. The arithmetic operations on Z n are defined as follows. For any integers a and b, we let [a] n + [b] n = [a + b] n, [a] n [b] n = [a b] n, [a] n [b] n = [ab] n. We need to check that these operations are well defined, namely, they do not depend on the choice of representatives a, b for the congruence classes. Proposition If a a mod n and b b mod n, then (i) a + b a + b mod n; (ii) a b a b mod n; (iii) ab a b mod n. Proof: Since n divides a a and b b, it also divides (a + b) (a + b ) = (a a )+(b b ), (a b) (a b ) = = (a a ) (b b ), and ab a b = a(b b )+(a a )b.

Invertible congruence classes We say that a congruence class [a] n is invertible (or the integer a is invertible modulo n) if there exists a congruence class [b] n such that [a] n [b] n = [1] n. If this is the case, then [b] n is called the inverse of [a] n and denoted [a] 1 n. The set of all invertible congruence classes in Z n is denoted G n or Z n. A nonzero congruence class [a] n is called a zero-divisor if [a] n [b] n = [0] n for some [b] n [0] n. Examples. In Z 6, the congruence classes [1] 6 and [5] 6 are invertible since [1] 2 n = [5]2 6 = [1] 6. The classes [2] 6, [3] 6, and [4] 6 are zero-divisors since [2] 6 [3] 6 = [4] 6 [3] 6 = [0] 6. In Z 7, all nonzero congruence classes are invertible since [1] 2 7 = [2] 7 [4] 7 = [3] 7 [5] 7 = [6] 2 7 = [1] 7.

Proposition (i) The inverse [a] 1 n is always unique. (ii) If [a] n and [b] n are invertible, then the product [a] n [b] n is also invertible and ([a] n [b] n ) 1 = [a] 1 n [b] 1 n. (iii) The set G n is closed under multiplication. (iv) Zero-divisors are not invertible. Proof: (i) Suppose that [b] n and [b ] n are inverses of [a] n. Then [b] n = [b] n [1] n = [b] n [a] n [b ] n = [1] n [b ] n = [b ] n. (ii) ([a] n [b] n )([a] 1 n [b] 1 n ) = [a] n [a] 1 n [b] n [b] 1 n = [1] n [1] n = [1] n. (iii) is a reformulation of the first part of (ii). (iv) If [a] n is invertible and [a] n [b] n = [0] n, then [b] n = [1] n [b] n = [a] 1 n [a] n[b] n = [a] 1 n [0] n = [0] n.

Theorem A nonzero congruence class [a] n is invertible if and only if gcd(a, n) = 1. Otherwise [a] n is a zero-divisor. Proof: Let d = gcd(a, n). If d > 1 then n/d and a/d are integers, [n/d] n [0] n, and [a] n [n/d] n = = [an/d] n = [a/d] n [n] n = [a/d] n [0] n = [0] n. Hence [a] n is a zero-divisor. Now consider the case gcd(a, n) = 1. In this case 1 is an integral linear combination of a and n: ma + kn = 1 for some m, k Z. Then [1] n = [ma + kn] n = [ma] n = [m] n [a] n. Thus [a] n is invertible and [a] 1 n = [m] n.

Problem. Find the inverse of 23 modulo 107. Numbers 23 and 107 are coprime (they are actually prime). We use the matrix method to represent 1 as an integral linear combination of these numbers. ( ) ( ) ( ) 1 0 107 1 4 15 1 4 15 0 1 23 ( 2 9 7 1 5 8 ) 0 1 23 ( ) 2 9 7 3 14 1 1 5 8 ( ) 23 107 0 3 14 1 Hence ( 3) 107 + 14 23 = 1. It follows that [1] 107 = [( 3) 107 + 14 23] 107 = [14 23] 107 = [14] 107 [23] 107. Thus [23] 1 107 = [14] 107.

Linear congruences Linear congruence is a congruence of the form ax b mod n, where x is an integer variable. We can regard it as a linear equation in Z n : [a] n X = [b] n. Theorem The linear congruence ax b mod n has a solution if and only if d = gcd(a, n) divides b. If this is the case then the solution set consists of d congruence classes modulo n that form a single congruence class modulo n/d. Proof: If x is a solution then ax = b + kn for some k Z. Hence b = ax kn, which is divisible by gcd(a, n). Conversely, assume that d divides b. Then the linear congruence is equivalent to a x b mod m, where a = a/d, b = b/d and m = n/d. In other words, [a ] m X = [b ] m. Now gcd(a, m) = gcd(a/d, n/d) = gcd(a, n)/d = 1. Hence [a ] m is invertible. Then the solution set is X = [a ] 1 m [b ] m, a congruence class modulo n/d.

Problem 1. Solve the congruence 12x 6 mod 21. 4x 2 mod 7 2x 1 mod 7 [x] 7 = [2] 1 7 = [4] 7 [x] 21 = [4] 21 or [11] 21 or [18] 21. Problem 2. Solve the congruence 23x 6 mod 107. The numbers 23 and 107 are coprime. We already know that [23] 1 107 = [14] 107. Hence [x] 107 = [23] 1 107 [6] 107 = [14] 107 [6] 107 = [84] 107.