Definition: div Let n, d 0. We define ndiv d as the least integer quotient obtained when n is divided by d. That is if

Similar documents
Chapter 3 Basic Number Theory

Mathematics of Cryptography Part I

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

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

Part V. Chapter 19. Congruence of integers

3 The fundamentals: Algorithms, the integers, and matrices

4 Number Theory and Cryptography

8. BOOLEAN ALGEBRAS x x

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

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?

SEVENTH EDITION and EXPANDED SEVENTH EDITION

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?

Chapter 1 : The language of mathematics.

Wilson s Theorem and Fermat s Little Theorem

Chapter R REVIEW OF BASIC CONCEPTS. Section R.1: Sets

Polynomial and Rational Functions

3.7 InveRSe FUnCTIOnS

WUCT121. Discrete Mathematics. Logic

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

NOTES ON SIMPLE NUMBER THEORY

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

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

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

ELEMENTS OF NUMBER THEORY

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

Notes on Systems of Linear Congruences

2.5. Infinite Limits and Vertical Asymptotes. Infinite Limits

LESSON 35: EIGENVALUES AND EIGENVECTORS APRIL 21, (1) We might also write v as v. Both notations refer to a vector.

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

Math Lesson 2-2 Properties of Exponents

Basic elements of number theory

Basic elements of number theory

3 Polynomial and Rational Functions

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

7.2 Applications of Euler s and Fermat s Theorem.

M381 Number Theory 2004 Page 1

Review Topics for MATH 1400 Elements of Calculus Table of Contents

Glossary. Also available at BigIdeasMath.com: multi-language glossary vocabulary flash cards. An equation that contains an absolute value expression

5.4 dividing POlynOmIAlS

4 Powers of an Element; Cyclic Groups

1.7 Inverse Functions

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

Lecture 7: Number Theory Steven Skiena. skiena

3.7 Non-linear Diophantine Equations

Name: There are 8 questions on 13 pages, including this cover.

Introduction to Sets and Logic (MATH 1190)

14.1 Systems of Linear Equations in Two Variables

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

Solutions Quiz 9 Nov. 8, Prove: If a, b, m are integers such that 2a + 3b 12m + 1, then a 3m + 1 or b 2m + 1.

Functions. Introduction

Math-2. Lesson:1-2 Properties of Exponents

1. multiplication is commutative and associative;

Tomáš Madaras Congruence classes

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Solutions I.N. Herstein- Second Edition

7. Prime Numbers Part VI of PJE

Sub chapter 1. Fundamentals. 1)If Z 2 = 0,1 then (Z 2, +) is group where. + is addition modulo 2. 2) Z 2 Z 2 = (0,0),(0,1)(1,0)(1,1)

Infinite Limits. Let f be the function given by. f x 3 x 2.

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

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

Lecture Notes. Advanced Discrete Structures COT S

( 3x. Chapter Review. Review Key Vocabulary. Review Examples and Exercises 6.1 Properties of Square Roots (pp )

. In particular if a b then N(

Solutions to Section 2.1 Homework Problems S. F. Ellermeyer

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

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

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography

Solutions to the Math 1051 Sample Final Exam (from Spring 2003) Page 1

The Chinese Remainder Theorem

Systems of Linear Equations: Solving by Graphing

With Question/Answer Animations. Chapter 4

or just I if the set A is clear. Hence we have for all x in A the identity function I ( )

Math 109 HW 9 Solutions

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

Chapter 0: Algebraic Concepts

Citrus Valley High School

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

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

Number Theory Solutions Packet

The RSA Encryption/Decryption method is based on the Euler's and Fermat's Theorem

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

For your quiz in recitation this week, refer to these exercise generators:

Chapter 5. Number Theory. 5.1 Base b representations

CISC-102 Fall 2017 Week 6

Relations. Relations. Definition. Let A and B be sets.

Limits 4: Continuity

5.6 RATIOnAl FUnCTIOnS. Using Arrow notation. learning ObjeCTIveS

Integers and Division

Ch 4.2 Divisibility Properties

MATH Fundamental Concepts of Algebra

Section 1.2: A Catalog of Functions

Senior Math Circles Cryptography and Number Theory Week 2

Lesson 15: Piecewise Functions

Number Theory Homework.

3.2 Solving linear congruences. v3

Properties of Limits

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 3

4Cubic. polynomials UNCORRECTED PAGE PROOFS

Math Theory of Number Homework 1

Transcription:

Section 5. Congruence Arithmetic A number of computer languages have built-in functions that compute the quotient and remainder of division. Definition: div Let n, d 0. We define ndiv d as the least integer quotient obtained when n is divided b d. That is if n dq r, then n div d q. Alternativel: ndiv d n d Eamples. Find ndiv d for the following: n 54, d 4 54 4 13 2 54 div 4 13 n 32, d 9 32 9 ( 4) 4 32 div 9 4 Eercises: Find ndiv d for the following: n 54, d 4 n 54, d 70 WUCT121 Numbers 138

Definition: mod Let n, d 0. We define n mod d as the integer remainder obtained when n is divided b d. That is if n dq r, then n mod d r Eamples. Find n mod d for the following: n 54, d 4 54 4 13 2 54 mod 4 2 n 32, d 9 32 9 ( 4) 4 32 mod 9 4 Eercises: Find n mod d for the following: n 54, d 4 n 54, d 70 For n, for n mod 5 Congruence Arithmetic centres around a relation based on the idea of mod. WUCT121 Numbers 139

5.1. Definition: Congruence modulo n. Let n. We will define a relation on Ÿ called congruence modulo n (denoted ) b: a, b,( a b(mod n) n ( a b). Notes: a b(mod n) reads a is congruent to b modulo n. The definition sas that a b(mod n) if and onl if n divides the difference between a and b Another wa to think about congruence modulo n is in terms of remainders: a b(mod n) if and onl if a(mod n) b(mod n), that is, if a and b have the same remainder after being divided b n WUCT121 Numbers 140

Eamples: 38 2(mod 6) because 38 2 36 and 6 36. also 38 (mod 6) 2 and 2 (mod 6) 2 Find such that 12 (mod 5) Require such that 5 (12 ). That is need 12 5k, k. Set k 0, gives 12 0 12 Set k 1, gives 12 5 7 Set k 2, gives 12 10 2 Hence, Eercises: K, 3,2,7,12, K Find possible values for m in each case. 14 m(mod 8) 13 m(mod 7) WUCT121 Numbers 141

( n 1) m(mod n), n > 1 Determine whether each of the following is true or false. 7 9(mod 8) 2 8(mod11) 11 1(mod 5) Find values for in each case. 1(mod7) WUCT121 Numbers 142

3(mod5) 4(mod9) If m 0(mod 2), what can ou sa about m? If n 1(mod 2), what can ou sa about n? Fill in the spaces with the smallest possible nonnegative number. 21 (mod 4) 18 (mod 4) WUCT121 Numbers 143

5.2. Congruence Arithmetic 5.2.1. Theorem: Congruence Addition Let n, and a, b, c, d If a b(mod n) and c d(mod n), then ( a c) ( b d )(mod n). Proof: We know; a b(mod n) p, a b c d(modn) q, c d np K(1) nqk(2) We must show : ( a c) ( b d )(mod n), that is r, ( a c) ( b d ) nr Adding (1) and (2) gives ( a b) ( c d ) np nq ( a c) ( b d ) n( p q) nr r n ( a c) ( b d ) ( a c) ( b d )(mod n) p q WUCT121 Numbers 144

Eamples: 21 1(mod 4), 18 2(mod 4) 21 18 39 3(mod 4) 12 2(mod 5), 101 1(mod 5) 12 101 113 3(mod 5) Eercises: B considering 18 (mod12) and 73 (mod12), determine what time of da it will be 73 hours after 6pm on Sunda. B considering 15 (mod 60) and 135 (mod 60), determine where the minute hand on an analog clock will be located 135 minutes after 11:15. WUCT121 Numbers 145

5.2.2. Theorem: Congruence Multiplication Let n, and a, b, c, d If a b(mod n) and c d(mod n), then ac bd(mod n). Eercises: Complete the proof for congruence multiplication WUCT121 Numbers 146

Eamples: 21 1(mod 4), 18 2(mod 4) 21 18 378 2(mod 4) Find such that 3 9 (mod5), 0 < 5. 3 3 12(mod 5) 2(mod 5) 3 3 3 3(mod 5) 2 3 6 9 9 4(mod 5) 3 9 3 4(mod 5) 12(mod 5) 3 3 3 8(mod 5) 3(mod 5) 3 3 3 3 9 3 3 3 2(mod 5) 3 6 2 2(mod 5) 4(mod 5) 2 4(mod 5) 8(mod 5) 3(mod 5) WUCT121 Numbers 147

Eercises: Find the remainder when 7 7 is divided b 16. Need to find such that 7 7 ( mod16) 0 < 16 and Find such that 9 7 (mod15), 0 < 15. WUCT121 Numbers 148

5.2.3. Theorem: Cancellation Law Let n, and a, b, c If gcd( a, n) 1 and ab ac(mod n), then b c(mod n) Proof: We know; gcd( a, n) 1 and ab ac(mod n) Now, b the definition of congruence modulo n, we have ( ab ac) n a( b c) n ( b c) n see note b c(mod n) Note: Recall if gcd( a, b) 1 and a bc, then a c Eamples: gcd( 5,4) 1 and 5 6 5 2(mod 4), that is 30 10(mod 4) 6 2(mod 4) WUCT121 Numbers 149

gcd( 6,3) 3 and 6 1 6 2(mod 3) that is, 6 12(mod 3). However, 1 / 2(mod 3) Eercises: Given 10904 32(mod 9) Find such that 1363 (mod 9), 0 < 9. Simplif 6 36(mod10) WUCT121 Numbers 150

5.3. Congruence Classes Modulo n Lemma: Let n. If, then is congruent (modulo n) to eactl one element in { 0, 1, 2,, n 1} K. This lemma is important as it allows us to group integers according to their remainder after dividing b a given number n. 5.3.1. Definition: Equivalence Class Let n. The equivalence class determined b s, denoted s, is defined as s { : s(mod n)}. Eamples: The following are equivalence classes when n 3 o 0 { K, 12, 9, 6, 3, 0, 3, 6, 9,12,K} o 1 { K, 8, 5, 2, 1, 4, 7,K} o 2 { K, 7, 4, 1, 2, 5, 8,K} o 3 { K, 12, 9, 6, 3, 0, 3, 6, 9,12,K} WUCT121 Numbers 151

Eercises: Write down 10 elements in the following equivalence classes if n 4. o 0 o 1 o 2 o 3 o 4 o 5 How man distinct (i.e., different) equivalence classes (mod 4) do ou epect there to be? WUCT121 Numbers 152

Lemma: If n, then there are eactl n distinct equivalence classes determined b n, namel 0, 1, 2,, n 1. Proof: B previous Lemma, ever one of the numbers 0, 1, 2,, n 1. is congruent to eactl Therefore, is congruent to one of 0, 1, 2,, n 1. Hence, we have n classes. To prove the equivalence classes are distinct (disjoint), we must show that for Let 0 i < j n 1. Suppose that that i and j. Then, we have i j, i j. i j ; that is, there eists such i i(mod n) and j j(mod n) However, this contradicts the lemma that is congruent modulo n to eactl one of 0, 1, 2,, n 1., so our assumption that the result follows. i j is false, so i j and WUCT121 Numbers 153

5.4. Definition: Set of Residues Ÿ n For all and sa that Eercises: n, let { 0, 1, 2, K, n 1 } n n is the complete set of residues modulo n. What are 3, 218 and 1? In 3, what are the sets 4, 2,7,40 usuall epressed as? How man names" are there for 3 in 10? List three. In n, 0 1 2 K n 1 and 0 1 2 K n 1. WUCT121 Numbers 154

As seen above, an infinite number of names. Aside: n is a set of elements, each of which has Consider, the set of all rational numbers. For all, has an infinite number of names. Eample: 1 2 2 4 3 6 100 200 L How have we defined addition of rational numbers? Eample: 1 3 7 6 13. 2 7 14 14 Wh couldn't we define addition as follows? 1 2 3 7 1 3 2 7 4 9 When we define and on n, we must make sure our definitions do NOT depend on the name of the equivalence class. We can then sa that and on or consistent. n are well-defined WUCT121 Numbers 155

5.4.1. Definition: Addition on Ÿ n Addition on n is defined as follows: a, b n, a b a b. To prove that addition is consistent relies on the following propert a b a b(mod n) Proof: Let a c and b d in n. We must prove that a b c d. a c a c(mod n) K(1) and b d b d(mod n) K(2) Adding (1) and (2) using congruence addition gives ( a b) a b ( c d )(mod n) c d Therefore, addition on Eample: n is consistent. In 3, we know 1 4 and 2 5. We want 1 2 4 5 Now, 1 2 1 2 3 and 4 5 4 5 9 3 Therefore, 1 2 4 5. WUCT121 Numbers 156

5.4.2. Definition: Multiplication on Ÿ n Multiplication on n is defined as follows: a, b n, a b a b. Proof: Let a c and b d in n. We must prove that a b c d. a c a c(mod n) K(1) and b d b d(mod n) K(2) Adding (1) and (2) using congruence multiplication gives ( a b) ( c d )(mod n) a b c d Therefore, multiplication on Eample: n is consistent. In 3, we know 1 4 and 2 5. We want 1 2 4 5 Now, 1 2 1 2 2 and 4 5 4 5 20 2 Therefore, 1 2 4 5. WUCT121 Numbers 157

Eercises: Write out the addition and multiplication tables for 3. 0 1 2 0 1 2 0 1 2 0 1 2 Are addition and multiplication closed operations on 3? Solve these equations for in 3. o 2 0 o 2 1 o 0 1 o 0 2 Is 3 commutative under addition or multiplication? WUCT121 Numbers 158

WUCT121 Numbers 159 Is 3 associative under addition or multiplication? Does it have the distributive propert? How would ou prove or disprove our answers? Commutativit: and, 3 Associativit: ) ( ) ( ) ( ) ( and ) ( ) ( ) ( ) (,, 3

WUCT121 Numbers 160 Distributivit: ) ( ) ( ) ( ) ( and ) ) ( ) (,, 3 Does 3 have an identit under addition or multiplication? Does each element of 3 have an inverse under addition? What are the?

Does each element of 3 have an inverse under multiplication? What are the? Eercises: Write out the multiplication table for 4 0 1 2 3 0 1 2 3 Is multiplication a closed operation on 4? Solve these equations for in 4. o 2 2 o 2 0 o 2 1 o 3 1 WUCT121 Numbers 161

Is 4 commutative or associative under multiplication? Does 4 have an identit under multiplication? Does each element of 4 (ecept 0) have an inverse under multiplication? WUCT121 Numbers 162

Properties of Ÿ: Properties of n: Addition and multiplication are closed operations Commutative under addition and multiplication Associative under addition and multiplication Distributive Identities: 0 under addition; 1 under multiplication Inverses: Addition: of a a is the inverse Multiplication: onl ±1 have inverses Addition and multiplication are closed operations Commutative under addition and multiplication Associative under addition and multiplication Distributive Identities: 0 under addition; 1 under multiplication Inverses: Addition: In n, each element has an additive inverse: a (or n a) Multiplication: For certain values of n, each element, other than 0, has an inverse. WUCT121 Numbers 163

Notes: All non-ero elements in onl for certain values of n. n have multiplicative inverses In 3, ever non-ero element has a multiplicative inverse. In 4, 2 has no multiplicative inverse. What do ou think might be the condition on n for all nonero elements in n must be prime. n to have multiplicative inverses? WUCT121 Numbers 164