CSE 20 DISCRETE MATH. Winter

Similar documents
CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Winter

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.

CHAPTER 3. Congruences. Congruence: definitions and properties

Math 109 HW 9 Solutions

Part V. Chapter 19. Congruence of integers

3.7 Non-linear Diophantine Equations

14 Equivalence Relations

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

Integers and Division

4. Congruence Classes

CSE 20 DISCRETE MATH WINTER

CSE 20 DISCRETE MATH WINTER

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

Orders and Equivalences

3.2 Solving linear congruences. v3

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH SPRING

CSE 20: Discrete Mathematics

Wilson s Theorem and Fermat s Little Theorem

CSE 20 DISCRETE MATH. Fall

Modular Arithmetic Instructor: Marizza Bailey Name:

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 3

Chapter 3 Basic Number Theory

CSE 20 DISCRETE MATH. Winter

1 Partitions and Equivalence Relations

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

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

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

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5

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

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

CSE 20 DISCRETE MATH. Winter

CSE 311: Foundations of Computing. Lecture 10: Set Operations & Representation, Modular Arithmetic

Section 0. Sets and Relations

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

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6

The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.

RED. Name: Instructor: Pace Nielsen Math 290 Section 1: Winter 2014 Final Exam

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?

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

MATH 361: NUMBER THEORY FOURTH LECTURE

Chapter 1 : The language of mathematics.

Well-Ordering Principle. Axiom: Every nonempty subset of Z + has a least element. That is, if S Z + and S, then S has a smallest element.

CSE 20 DISCRETE MATH. Fall

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma.

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

7. Prime Numbers Part VI of PJE

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

MATH 310: Homework 7

Tomáš Madaras Congruence classes

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

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?

Johns Hopkins Math Tournament 2018 Proof Round: Sequences

3 The fundamentals: Algorithms, the integers, and matrices

9 RELATIONS. 9.1 Reflexive, symmetric and transitive relations. MATH Foundations of Pure Mathematics

Math 421, Homework #6 Solutions. (1) Let E R n Show that = (E c ) o, i.e. the complement of the closure is the interior of the complement.

CSE 20 DISCRETE MATH SPRING

Part IA Numbers and Sets

Reading 11 : Relations and Functions

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

Math 370 Homework 2, Fall 2009

Number Theory Homework.

Mathematics 220 Homework 4 - Solutions. Solution: We must prove the two statements: (1) if A = B, then A B = A B, and (2) if A B = A B, then A = B.

Math 109 September 1, 2016

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

CSE 311: Foundations of Computing. Lecture 10: Set Operations & Representation, Modular Arithmetic

MATH 2200 Final Review

Chapter 2 - Relations

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

1. Prove that the number cannot be represented as a 2 +3b 2 for any integers a and b. (Hint: Consider the remainder mod 3).

Discrete Mathematics with Applications MATH236

CSE 20 DISCRETE MATH. Fall

UNIVERSITY OF VICTORIA DECEMBER EXAMINATIONS MATH 122: Logic and Foundations

4 Number Theory and Cryptography

1.4 Equivalence Relations and Partitions

MATH 433 Applied Algebra Lecture 14: Functions. Relations.

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

Notes on Systems of Linear Congruences

There are seven questions, of varying point-value. Each question is worth the indicated number of points.

MATH 363: Discrete Mathematics

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

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Notes on Sets, Relations and Functions

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

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)

Solutions to Practice Final

Solutions to Assignment 1

Number Theory. Modular Arithmetic

Fermat's Little Theorem

2 Equivalence Relations

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

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

CS March 17, 2009

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1

Mathematics 228(Q1), Assignment 3 Solutions

Basic elements of number theory

Transcription:

CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/

Today's learning goals Determine whether a relation is an equivalence relation by determining whether it is Reflexive Symmetric Transitive Represent equivalence relations as partitions and vice versa Define and use the congruence modulo m equivalence relation

Size as a relation Cardinality lets us compare and group sets. U = P({1,2,3,4}) {1} {2} {1,2} {1,3} {3} {} {4} {2, 3, 4} A is related to B iff A = B {1, 2, 4} {1, 3, 4} {1, 2, 3} {2,3} {1,4} {2,4} {1,2, 3,4} {3,4}

Relations, more generally Rosen Sections 9.1, 9.3 (second half), 9.5, 9.6 Let A, B be sets. Binary relation from A to B is (any) subset of A x B. Examples A = B = Z R 1 ={(x,y) x < y} 1 R 1 2 but not(2 R 1 1) A = B= {0,1}* R 2 ={(w, u) l(w) = l(u)} 10 R 2 00 but not(0 R 2 10) A = B= {0,1,2} R 3 ={(0,0), (0,2), (2,0)} 0 R 3 2 but not (0 R 3 1)

Relation on a set A Rosen pp 576-578 A relation R is called reflexive iff symmetric iff transitive iff

Relation on a set A Rosen pp 576-578 A relation R is called reflexive iff R 1 = {(x,y) x < y} on A = Z R 2 = {(w, u) l(w) = l(u)} on A = {0,1}* R 3 = {(0,0), (0,2), (2,0)} on A = {0,1,2} Which of these relations is reflexive? A. All of them B. Just R 1 C. R 2 and R 3 D. Some other combination

Relation on a set A Rosen pp 576-578 A relation R is called symmetric iff R 1 = {(x,y) x < y} on A = Z R 2 = {(w, u) l(w) = l(u)} on A = {0,1}* R 3 = {(0,0), (0,2), (2,0)} on A = {0,1,2} Which of these relations is symmetric? A. All of them B. Just R 1 C. R 2 and R 3 D. Some other combination

Relation on a set A Rosen pp 576-578 A relation R is called transitive iff R 1 = {(x,y) x < y} on A = Z R 2 = {(w, u) l(w) = l(u)} on A = {0,1}* R 3 = {(0,0), (0,2), (2,0)} on A = {0,1,2} Which of these relations is transitive? A. All of them B. Just R 1 C. R 2 and R 3 D. Some other combination

Equivalence relations Rosen p. 608 Group together "similar" objects

Equivalence relations Rosen p. 608 Two formulations A relation R on set S is an equivalence relation if it is reflexive, symmetric, and transitive. x R y iff x and y are "similar" Partition S into equivalence classes, each of which consists of "similar" elements: collection of disjoint, nonempty subsets that have S as their union x,y both in A i iff x and y are "similar"

Equivalence classes Rosen p. 612 Given an equivalence relation R on set S, for a in S, the equivalence of clas [a] R = {s (a,s) is in R} Theorem 1: Let R be an equivalence relation on a set A. For elements a,b of A i. a R b iff ii. [a] = [b] iff iii. [a] [b] is nonempty.

Relation to classes Rosen p. 608 Given a relation R on set S, its equivalence classes are the sets [a] R = {s (a,s) is in R} Example R={(w, u) l(w) = l(u)} on S = {0,1}* [0] R = {0,1} = [1] R [00] R = {00,01,10,11} = [01] R= = [10] R= = [11] R etc.

Partition to relation Rosen p. 608 The set of integers can be partitioned into four sets {0, 4, 8, 12,, -4, -8, -12, } {1, 5, 9, 13,, -3, -7, -11, } {2, 6, 10, 14,, -2, -6, -10, } {3, 7, 11, 15,, -1, -5, -9, } What equivalence relation on Z has these sets as its equivalence classes? A. xry iff x mod y = 4 B. xry iff x mod 4 = y mod 4 C. xry iff x div 4 = y D. xry iff x div 4 = y div 4 E. None of the above

*The* example Rosen p. 240 For a,b in Z and m in Z + we say a is congruent to b mod m iff m (a-b) i.e. and in this case, we write Which of the following is true? A. B. C. D. E. None of the above.

*The* example Rosen p. 240 Claim: Congruence mod m is an equivalence relation Proof: Reflexive? Symmetric? Transitive?

*The* example Rosen p. 240 Claim: Congruence mod m is an equivalence relation Congruence classes: [a] m = {s (a,s) is in R} = {s a mod m = s mod m} What partition of the integers is associated with this equivalence relation? E.g. m=6 [0] 6 = { s : } {0, 6, 12, 18, 24, } {3, 9, 15, 21, 27, } {1, 7, 13, 19, 25, } {4, 10, 16, 22, 28, } {2, 8, 14, 20, 26, } {5, 11, 17, 23, 29, }

Arithmetic modulo m Rosen p. 242-243 (a+b) mod m = ( (a mod m) + (b mod m) ) mod m ab mod m = ((a mod m) (b mod m)) mod m Modular addition and multiplication are well-defined on equivalence classes! + 0 1 2 0 0 1 2 1 1 2 0 2 2 0 1. 0 1 2 0 0 0 0 1 0 1 2 2 0 2 1

Application 1: Last digit What's the last digit of 2017 2017? A. 1 B. 3 C. 9 D. 7 E. Can't tell without a calculator. Last digit of decimal representation of n is n mod 10

Modular operations We saw that, for all integers a,b and all positive integers m, (a+b) mod m = ( (a mod m) + (b mod m) ) mod m ab mod m = ((a mod m) (b mod m)) mod m Which of the following is also true? A. (a-b) mod m = ( (a mod m) - (b mod m) ) mod m B. (a/b) mod m = ( (a mod m) / (b mod m) ) mod m C. a b mod m = ( (a mod m) (b mod m) ) mod m D. More than one of the above. E. None of the above.

Modular operations (a-b) mod m = ( (a mod m) - (b mod m) ) mod m (-b) mod m = (m-b) mod m (a/b) mod m = ( (a mod m) / (b mod m) ) mod m Counterexample: a = 16, b = 8, m = 10 a b mod m = ( (a mod m) (b mod m) ) mod m Counterexample: a = 2, b= 10, m = 10

Application 2: Proof by cases Claim: The square of each integer is either divisible by 4 or has remainder 1 upon division by 4. Proof: Induction? Contradiction? Exhaustive?

Application 2: Proof by cases Claim: The square of each integer is either divisible by 4 or has remainder 1 upon division by 4. Proof: Let n be an integer and consider its remainder upon division by r. Four cases: remainder is 0, 1, 2, or 3.

Application 3: Pseudorandom generators Rosen p. 288 x n+1 = (ax n +c) mod m Parameters: - modulus m - multiplier a (2 <= a < m) - increment c (0 <= c < m) - seed x 0 (0 <=x 0 < m) What's the maximum number of terms before the sequence starts to repeat? A. m B. a C. c D. x 0 E. Depends on the parameters; maybe never!

Application 3: Pseudorandom generators x n+1 = (ax n +c) mod m Parameters: - modulus m - multiplier a (2 <= a < m) - increment c (0 <= c < m) - seed x 0 (0 <=x 0 < m) m=8, a=5, c=1, x 0 =1 1, 6, 7, 4, 5, 2, 3, 0, 1, 6, 7, 4, 5, 2, 3, m=8, a=5, c=4, x 0 =1 1, 1, 1, 1, 1,