Functions and Relations II. CS2100 Ross Whitaker University of Utah

Similar documents
Discrete Mathematics: Lectures 6 and 7 Sets, Relations, Functions and Counting Instructor: Arijit Bishnu Date: August 4 and 6, 2009

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

Math 105A HW 1 Solutions

Functions. Definition 1 Let A and B be sets. A relation between A and B is any subset of A B.

1 Partitions and Equivalence Relations

Section Summary. Relations and Functions Properties of Relations. Combining Relations

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

Outline Inverse of a Relation Properties of Relations. Relations. Alice E. Fischer. April, 2018

The Different Sizes of Infinity

Week Some Warm-up Questions


Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Announcements. CS243: Discrete Structures. Sequences, Summations, and Cardinality of Infinite Sets. More on Midterm. Midterm.

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

One-to-one functions and onto functions

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality

Great Theoretical Ideas in Computer Science. Lecture 5: Cantor s Legacy

In N we can do addition, but in order to do subtraction we need to extend N to the integers

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

Properties of the Integers

7.11 A proof involving composition Variation in terminology... 88

In N we can do addition, but in order to do subtraction we need to extend N to the integers

CSE 20 DISCRETE MATH. Fall

Notes on ordinals and cardinals

Automata and Languages

Section 7.5: Cardinality

CITS2211 Discrete Structures (2017) Cardinality and Countability

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

SETS AND FUNCTIONS JOSHUA BALLEW

Chapter 9: Relations Relations

Chapter 1 : The language of mathematics.

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Relations, Functions, Binary Relations (Chapter 1, Sections 1.2, 1.3)

Finite and Infinite Sets

0 Sets and Induction. Sets

Discrete Structures for Computer Science

ABOUT THE CLASS AND NOTES ON SET THEORY

Economics 204 Summer/Fall 2011 Lecture 2 Tuesday July 26, 2011 N Now, on the main diagonal, change all the 0s to 1s and vice versa:

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

Weak Choice Principles and Forcing Axioms

Foundations Revision Notes

Math.3336: Discrete Mathematics. Cardinality of Sets

Part IA Numbers and Sets

LOGIC AND SET THEORY - HOMEWORK Question 1. n + 1 Unknown - either n or n 1, depending on whether { } A

Week 4-5: Binary Relations

Number Theory and Graph Theory

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

UNIVERSITY OF VICTORIA DECEMBER EXAMINATIONS MATH 122: Logic and Foundations

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Diskrete Mathematik Solution 6

Mathematics 220 Workshop Cardinality. Some harder problems on cardinality.

1.A Sets, Relations, Graphs, and Functions 1.A.1 Set a collection of objects(element) Let A be a set and a be an elements in A, then we write a A.

Chapter 20. Countability The rationals and the reals. This chapter covers infinite sets and countability.

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

On Transfinite Cardinal Numbers

Countable and uncountable sets. Matrices.

Countable and uncountable sets. Matrices.

Prof. Ila Varma HW 8 Solutions MATH 109. A B, h(i) := g(i n) if i > n. h : Z + f((i + 1)/2) if i is odd, g(i/2) if i is even.

Algorithms: Lecture 2

A Readable Introduction to Real Mathematics

IVA S STUDY GUIDE FOR THE DISCRETE FINAL EXAM - SELECTED SOLUTIONS. 1. Combinatorics

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017

6 CARDINALITY OF SETS

Relations Graphical View

Meta-logic derivation rules

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

Solutions to Homework Assignment 2

The Pigeonhole Principle

MATH 201 Solutions: TEST 3-A (in class)

Today s topics. Binary Relations. Inverse Relations. Complementary Relations. Let R:A,B be any binary relation.

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination I (Spring 2008)

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

Cardinality and ordinal numbers

Assignments. Math 215. Fall 2009.

CSE 20 DISCRETE MATH. Winter

0 Logical Background. 0.1 Sets

Econ Lecture 2. Outline

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Sets. A set is a collection of objects without repeats. The size or cardinality of a set S is denoted S and is the number of elements in the set.

Introduction to Proofs

Cardinality of Sets. P. Danziger

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

Section 0. Sets and Relations

Week 4-5: Binary Relations

Axioms of separation

Sequences are ordered lists of elements

Math 4603: Advanced Calculus I, Summer 2016 University of Minnesota Notes on Cardinality of Sets

MATH 3300 Test 1. Name: Student Id:

ECARES Université Libre de Bruxelles MATH CAMP Basic Topology

Selected problems from past exams

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.

CS100: DISCRETE STRUCTURES

COMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University

Lecture Notes on Discrete Mathematics. October 15, 2018 DRAFT

MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM

1.4 Equivalence Relations and Partitions

Problem Set 2: Solutions Math 201A: Fall 2016

Transcription:

Functions and Relations II CS2100 Ross Whitaker University of Utah

Infinitely Big Sets Counting and size: thought experiment How many elements does the following set have? How do we know? What do we mean by the number of things?

Size of Sets: Cardinality Sets A and B have the same cardinality if there exists an invertible function f:a->b Intuition: An invertible function establishes a kind of unique correspondence between sets. Thus, invertible functions help to establish things as being the same size.

Example Show that N and Z have the same cardinality. Define a function that maps one to the other f:z->n with f(a) = { 2a a 0 2a 1 a<0

Example Is f invertible? Two options Show one-to-one and onto or produce g and show g is the inverse g(b) = { b 2 b even (b + 1) 2 b odd a=g(b) -> b=f(a) Let b be even. a=g(b)=b/2. f(a)=2a=b. Let b be odd. a=g(b)=-(b+1)/2. f(a)=-2a-1=-2 -(b+1)/2-1=b+1-1=b. b=f(a) -> a=g(b) Let a be positive. b=f(a)=2a. b is even. g(b)=b/2=a. Let a be negative. f(a)=-2a-1. b is odd. g(b)=-(b+1)/2 = - (-2a-1+1)/2 = a.

Sizes of Sets: Infinity The set A is infinite if there exists a function f:a->a that is one-to-one but not onto Intuition: If set is finite in size, then a mapping onto itself must have either: a full unique correspondence (invertible) or have multiple inputs to the same output (not one-toone) infinite sets can be neither and they maintain this discrepancy by never running out of elements

Example N is infinite Proof. Construct a function f:n->n that is one-to-one but not onto. f(a)=2a Prove f(a) is one-to-one. Division theorem says that for every number there is a unique quotient (divisor=2). I.e. b=2a and a is unique Prove f(a) is not onto Find bn such that a s.t. b=f(a). Take b to be odd. By the definition of odd and division theorem b=2k+1, and this is unique. Thus, there is no a such that 2a=2k+1=b

Proving Cardinality Sometimes finding an invertible function can be hard. So Cantor-Bernstein theorem: Given sets A and B, if there is a one-to-one function f:a->b and a one-to-one function g:b->a, then the sets A and B have the same cardinality.

Example Prove that Q 0 has the same cardinality as N. Since NQ, identity on N (denoted I:N->N) is one-to-one. For g:q->n, consider the prime factorization x=a/b (which is unique). Now construct z=g(x)=2 a 3 b. Prime factorizations are unique, so there is no other xq that can lead to z

Georg Ferdinand Ludwig Philipp Cantor 1845 1918 St Petersburg, Russia Fundamental results on sizes of infinite sets Equivalence and nesting of infinite spaces Cantor s theorem implies the existence of an infinity of infinities.

Cantor s Theorem For every set A, P(A) has a greater cardinality than A Book has a weaker form What this means for any infinitely large set, you can always produce a bigger set

Countable An infinite set is countable if it has the same cardinality as N not countable is uncountable E.g. Z and Q 0 are countable

Arrow Diagrams Relations

Relations: Definitions R is a binary relation on A (RAA) Reflexive: (a,a)r aa Antisymmetric: a,ba, a b, (a,b)r- >(b,a) R Transitive: a,b,ca, ((a,b)r)((b,c)r) ->(a,c)r Relation R on A is partial ordering if it is antisymmetric, transitive, and reflexive

Hasse Diagram No loops (reflexive is implied) Segment instead of arrow height on page is direction Draw only shortest links Draw (a,b) and (b,c), but not (a,c)

Example A={1,2,3,4} (x,y)r iff x y Enumerate R Draw the Hasse diagram

Example Let A=P({x,y,z}). Define (a,b)r iff ab

Proofs about Relations Claim: R is SOMEPROPERTY Let SOMEASSUMPTION Show that the property holds

Example A={1,2,3,6,9,18}, R={(x,y)A, y is a multiple of x} Prove that R is reflexive Let aa. Because a 1=a, a is a multiple of itself (true for all ints) Therefore (a,a)r

Example R={(a,b)ZZ: a-b even} Prove that R is reflexive Prove that R is transitive Prove that R is not a partial ordering

Example Let A={1,2,3,4,6,9,12,18,36} Let R={(a,b)A 2 : b is a multiple of a} Draw the Hasse Diagram Prove that R is a partial ordering

Other Types of Ordering Relax the reflexive requirement: strict partial ordering E.g. A={1,2,3,4,5}, R={(a,b)A 2 : a<b} Total ordering: Requirements of partial ordering Additional requirement a,ba, if a b, either (a,b)r or (b,a)r Can also be strict

Practice A=P({1,2,4,8}) Identify the type of ordering: R 1 ={(S,T)A 2 : (as)(bt) -> a b} R 2 ={(S,T)A 2 : S < T } R 2 ={(S,T)A 2 : sum of elements in S sum of elements in T}

Relations and Equivalence Two things can be the same or equivalent Equivalent ratios: (5,2) and (20,8) because 5/2 = 20/8 Similar triangles: Equivalence relation

Partitions of a Set A partition of a set A, is a set of sets S={S 1,, S n } such that: 1. i, S i (each part is nonempty) 2. i,j if S i S j then S i S j = (disjoint) 3. S 1 S n =A (complete) The S i s are called parts of S

Equivalence Relation Given set A and relation R on A, R is an equivalence relation on A if there exists a partition S of A such that (x,y)r iff are in the same part of S.

Examples A={1,2,3,4,5,6} R 1 ={(a,b)a 2 : b=a+1} R 2 ={(a,b)a 2 : a-b is even} 2 2 1 3 1 3 5 4 5 4 5 5

Example Cards numbered A={1,2,3,4,5} Each player gets two cards H=AA Two hands are the same if sum of values on cards is the same What is the partition?

Practice Is equivalence relation? If so, partition? A={1,2,3,4,5,6,7,8,9}, R={(a,b)A 2 : k,l,mz s.t. a=km, b=lm, and m>1} R={(x,y)Z 2 : mz s.t. x-y=4m} A={0,1,2,3,4,5,6}{1,2,3}, R={((a,b), (c,d))a 2 : ad=bc}

Euivalence Every object is similar to itself (a,a)r reflexive If a is similar to b, then b is similar to a (a,b)r -> (b,a)r symmetric

Practice Let A={0,1,2,3,4,5} and let R={(a,b)A 2 : a 2 -b 2 =3m, mz} Prove that R is reflexive. Let aa, then a 2 -a 2 =0=3 0 (multiple of 3) Therefore (a,a)r aa Prove that R is symmetric. Let a,ba, such that (a,b)r Thus, a 2 -b 2 =3m, mz. Therefore b 2 -a 2 =-3m=3 (-m). mz -> -mz. Therefore (b,a)r because (b,a) satisfies the setbuilder predicate

Equivalence Relations If the relation R is reflexive, symmetric, and transitive, then R is an equivalence relation Proof: For each element aa, define P a ={xa: (x,a)r} Claim 1: each P a is nonempty R is reflexive, therefore (a,a)r Therefore ap a and P a is nonempty

Equivalence Relations (cont.) Claim 2: For all a,ba, if P a P b then P a P b =. Proof by contradiction. Let P a P b then c s.t. cp a and cp b. If P a P b then d s.t. dp a and d P b -> (c,a)r, (d,a)r -> (a,d)r (sym) -> (c,d)r (trans.) cp b -> (b,c)r -> (b,d)r (trans) -> (d,b)r (sym) -> dp b (contradiction)

Equivalence Relations (cont.) Claim 3: Union of P s equals A R reflexive -> (a,a)r aa Therefore aa ap a Therefore every element of A is in the union of the P s