EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between sets Types of function.

Slides:



Advertisements
Similar presentations
Transitive Closure Theorem 1. Let R be a relation on a set A. Then R  is the transitive closure of R. the reachability relation R * of a relation R on.
Advertisements

EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 10 Cardinality Uncountability of the real numbers.
EE1J2 – Discrete Maths Lecture 9
Functions Section 2.3 of Rosen Fall 2008
Discrete Mathematics Lecture 7 Alexander Bukharovich New York University.
CSE115/ENGR160 Discrete Mathematics 02/22/11 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/16/12 Ming-Hsuan Yang UC Merced 1.
EE1J2 – Discrete Maths Lecture 7
CSE115/ENGR160 Discrete Mathematics 02/21/12
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
Discrete Math for CS Chapter 5: Functions. Discrete Math for CS New Relation Operations: Given R, a relation on A x B, we define the inverse relation,
1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,
1 Section 7.1 Relations and their properties. 2 Binary relation A binary relation is a set of ordered pairs that expresses a relationship between elements.
Functions.
1 CMSC 250 Chapter 7, Functions. 2 CMSC 250 Function terminology l A relationship between elements of two sets such that no element of the first set is.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
Logics for Data and Knowledge Representation Introduction to Algebra Chiara Ghidini, Luciano Serafini, Fausto Giunchiglia and Vincenzo Maltese.
Posets, equivalence relations, and functions Sections 2.6–2.8.
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
2.1 Sets 2.2 Set Operations 2.3 Functions ‒Functions ‒ Injections, Surjections and Bijections ‒ Inverse Functions ‒Composition 2.4 Sequences and Summations.
FUNCTION Discrete Mathematics Asst. Prof. Dr. Choopan Rattanapoka.
Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.
Functions. Copyright © Peter Cappello2 Definition Let D and C be nonempty sets. A function f from D to C, for each element d  D, assigns exactly 1 element.
ICS 253: Discrete Structures I
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Discrete Mathematics CS 2610 September 12, Agenda Last class Functions  Vertical line rule  Ordered pairs  Graphical representation  Predicates.
Functions Section 2.3 of Rosen Spring 2012 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions: Use Piazza.
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
Functions1 Elementary Discrete Mathematics Jim Skon.
1.4 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 2 The set of positive.
Example Prove that: “IF 3n + 2 is odd, then n is odd” Proof by Contradiction: -p = 3n + 2 is odd, q = n is odd. -Assume that ~(p  q) is true OR -(p 
Chapter 9 Functions Let A and B be nonempty sets. A function f from A to B, written f: A  B is a relation from A to B with the property that every element.
Functions Reading: Chapter 6 (94 – 107) from the text book 1.
CSE 2353 – October 1 st 2003 Functions. For Real Numbers F: R->R –f(x) = 7x + 5 –f(x) = sin(x)
Sets and Functions Contents  Set language  Basic knowledge on sets  Intervals  Functions (Mappings)
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Agenda Week 10 Lecture coverage: –Functions –Types of Function –Composite function –Inverse of a function.
Mathematical Induction
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
Language: Set of Strings
Discrete Mathematics Relation.
 R  A×B,R is a relation from A to B , DomR  A 。  (a,b)  R (a, c)  R  (a,b)  R (a, c)  R unless b=c  function  DomR=A , (everywhere)function.
MAT 2720 Discrete Mathematics Section 3.1 Functions
Sets. Definitions (I) Collection of elements such that: There are no duplicates There is no order Special sets Universe (U or E): all elements under consideration.
Basic Structures: Sets, Functions, Sequences, and Sums.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Functions (Mappings). Definitions A function (or mapping)  from a set A to a set B is a rule that assigns to each element a of A exactly one element.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
1 Discrete Mathematical Functions Examples.
MAT 2720 Discrete Mathematics Section 3.3 Relations
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
FUNCTIONS.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Mathematical Notions and Terminology
CS201: Data Structures and Discrete Mathematics I
CSE15 Discrete Mathematics 02/27/17
Introduction to Relations and Functions
Functions Rosen 6th ed., §2.3.
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Mathematical Background
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Presentation transcript:

EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between sets Types of function

EE1J2 - Slide 2 Relations Suppose A = {0,1,2,3}. An example of a relation on A is ‘<’ This relation is defined by the set R = {0<1, 0<2, 0<3, 1<2, 1<3, 2<3} or, equivalently R = {(0,1), (0,2), (0,3), (1,2), (1,3), (2,3)}  A  A So, a relation on A is a subset of R  A  A

EE1J2 - Slide 3 Equivalence relations A relation ~ is an equivalence relation on a set S if and only if: a ~ a for every a  S (~ reflexive) If a~b then b~a a,b  S (~ symmetric) If a~b and b~c then a~c (~ transitive) a,b,c  S If ~ is an equivalence relation and a~b, then we can say that a is equivalent to b

EE1J2 - Slide 4 Examples S is the set of all people in the UK R 1 : x,y  S, x~y if and only if x and y are the same age. This is an equivalence relation on S R 2 : x,y  S, x~y if and only if x and y own a copy of the same book. This is not an equivalence relation. Why? R 3: x,y  S, x~y if and only if x and y both own a copy of ‘War and Peace’. This is an equivalence relation on S

EE1J2 - Slide 5 Partitions Suppose A is a set. A partition P of A is a set of subsets of A, P = {P 1,…,P N } such that: P n  P m =  if n  m P 1  P 2  …  P N = A

EE1J2 - Slide 6 Partitions - example S P1P1 P2P2 P3P3 {P 1,P 2,P 3 } is a partition of S P1P1 P2P2 P3P3 {P 1,P 2,P 3 } is not a partition – P 1  P 2  P 3  S P1P1 P2P2 P3P3 {P 1,P 2,P 3 } not a partition – P 2  P 3  

EE1J2 - Slide 7 Partitions & Equivalence Relations (1) Let ~ be an equivalence relation on A For a  A, let P a be the set of elements of A which are equivalent to a I.e. P a = {b  A: b~a} P = {P a :a  A} is a partition of A

EE1J2 - Slide 8 Partitions & Equivalence Relations (2) Let P={P  } be a partition of A Define an equivalence relation ~ on A by a~b if and only if both a and b belong to P  for some  ~ is an equivalence relation on A

EE1J2 - Slide 9 Partitions & Equivalence Relations (3) So, for a set A there is a one-to-one correspondence between: Equivalence relations on A Partitions of A

EE1J2 - Slide 10 Relations - More Terminology Let A be a set, R a relation on A The domain of R, dom(A), is the set: dom ( A )={ a :  b((a,b)  R )} The range of R, range(A), is the set: range (A)={ b:  a((a,b)  R )} If R is a relation on A then the inverse relation R -1 is given by R -1 ={( b,a ): ( a,b )  R }

EE1J2 - Slide 11 Example Let S be the set of all people in the world Define a relation R on S by: If x,y  S, then (x,y)  R if and only if x and y are siblings The domain of R is the set of all people who have brothers or sisters The range of R is the same as its domain

EE1J2 - Slide 12 Example 2 Let S be the set of all people in the world Define a relation R on S by: If x,y  S, then (x,y)  R if and only if x is y’s younger sibling The domain of R is the set of all people who have an older brother or sister The range of R is the set of all people who have a younger brother or sister

EE1J2 - Slide 13 Example 3 S = {1,4,7,9} Define a relation R on S by: If x,y  S, then (x,y)  R if and only if x < y The domain of R is {1,4,7} The range of R is {4,7,9} Is R an equivalence relation?

EE1J2 - Slide 14 Functions You probably have pre-conceived ideas of what a function is – f(x)=x 2 +2x+2, f(x)=sin(x), f(x)=exp(x),… These are all functions which associate a member x of ℝ unambiguously with another member f(x) of ℝ They can all be written in set-theoretic notation as f = {(x,f(x)): x  ℝ }

EE1J2 - Slide 15 Function – more examples Some functions require more care. f(x)=log(x) only defined for x > 0 f = {(x, f(x)): x  ℝ, x>0 }

EE1J2 - Slide 16 Examples continued f(x)=1/x Not defined when x = 1 f = {(x, f(x)): x  ℝ, x  0}

EE1J2 - Slide 17 Functions Also, x and f(x) need not be members of the same set. For example consider the function (positive square root) If x>0, then f is a real-valued function Otherwise f is a complex-valued function

EE1J2 - Slide 18 Functions A function f from a set A to a set B is a subset of P(A  B) such that if (a 1,b 1 )  f and (a 2,b 2 )  f then a 1  a 2 This ensures that f is well-defined. As before dom(f)={a:  b((a,b)  f)} range(A)={b:  a((a,b)  R)} If a  dom(f), then there is a unique b  range(f) such that (a,b)  f In this case we normally write f(a)=b

EE1J2 - Slide 19 Functions If f is a function from A to B and A=dom(f) then we write: f : A  B

EE1J2 - Slide 20 Functions In formal mathematics it is important to take care with this notation –in particular to be sure about the domain and range in the definition of a function: f: ℝ  ℝ, is not well-defined f:[0,  )  ℝ, (positive root) is a well- defined function f: ℝ  ℂ, is a well-defined function, and is different from either of the previous functions

EE1J2 - Slide 21 Special Types of Function Let f:A  B be a function f is called a surjection (or f is onto) if  b(b  B)  a((a  A)  (f(a)=b)) f is called an injection (or f is 1-1 “one-to- one”) if (f(a 1 )=b)(f(a 2 )=b)  a 1 =a 2 f is a bijection if and only if f is 1-1 and onto (f is a surjection and an injection)

EE1J2 - Slide 22 Special Types of Function f not 1-1 or onto f onto but not 1-1 f 1-1 and onto - bijection f 1-1 but not onto A B

EE1J2 - Slide 23 Isomorphism If f:A  B is a bijection, then A and B are basically the same set Mathematicians say that A and B are isomorphic f 1-1 and onto - bijection

EE1J2 - Slide 24 Examples Let A = {0,1,2,3} and B = {a,b,c,d} The function f :A  B defined by {(0,a),(1,b),(2,c),(3,d)} is a bijection The sets A and B are isomorphic. B is just a ‘re-labelled’ version of A

EE1J2 - Slide 25 More examples Well defined? Injection? Surjection? Bijection? f : ℝ  ℝ, f(x) = cos(x) f : ℝ  [-1,1], f(x) = sin(x) f : [- ,  ]  [-1,1], f(x) = sin(x) f : ℝ  ℝ, f(x) = log(x) f : ℝ  ℝ, f(x) = 1/x if x  0, f(0) = 0. f : ℕ  ℤ, f(n) = n/2 if n is even, f(n)=-(n+1)/2 if n is odd

EE1J2 - Slide 26 The Image of a Subset A and B sets, f:A  B be a function. Suppose X  A (X is a subset of A) Then f(X) is the subset of B defined by f(X)={b:f(x)=b for some x  X}, called the image of X under f A B X f(X) f

EE1J2 - Slide 27 The Inverse-Image of a Subset A and B sets, f:A  B a function. Suppose Y  B (Y is a subset of B) Then f -1 (Y) is the subset of A defined by f -1 (Y)={a:f(a)=y for some y  Y} Called the inverse-image of Y under f A B X=f -1 (Y) f(X)=Y f -1

EE1J2 - Slide 28 Inverse Functions A, B sets, f:A  B a function f = {(a,b): b=f(a), a  A} Is f –1 ={(b,a): b=f(a), a  A}a function? In order for f –1 to be a function, if (b,a)  f –1 and (b,c)  f –1 then a=c i.e. if (a,b)  f and (c,b)  f then a=c i.e f must be 1-1

EE1J2 - Slide 29 Inverse Functions In other words, if f:A  B, then the inverse function f –1 :f(A)  A exists if and only if f is 1-1 If f(A)=B, and f is 1-1, then f –1 :B  A exists In other words, f –1 :B  A exists if and only if f is a bijection In this case, f –1 is also a bijection, and A and B are isomorphic

EE1J2 - Slide 30 Cardinality Revisited Recall that for a finite set A={a 1,…,a n }, the cardinality of A is simply the number of members which A has. In this case |A|=n For infinite sets the notion of cardinality is more complex. But, if two infinite sets A and B are isomorphic, then surely |A|=|B|

EE1J2 - Slide 31 Summary of Lecture 8 Relations on sets Equivalence relations and partitions Introduction to functions Injections (or 1-1 functions) Surjections (or ‘onto’ functions) Bijections Cardinality revisited