Functions Reading: Epp Chp 7.1, 7.2, 7.4

Slides:



Advertisements
Similar presentations
1.6 Functions. Chapter 1, section 6 Functions notation: f: A B x in A, y in B, f(x) = y. concepts: –domain of f, –codomain of f, –range of f, –f maps.
Advertisements

Equivalence Relations
Copyright © Cengage Learning. All rights reserved.
(CSC 102) Discrete Structures Lecture 14.
Week 7 - Wednesday.  What did we talk about last time?  Set proofs and disproofs  Russell’s paradox.
The Engineering Design of Systems: Models and Methods
Functions Section 2.3 of Rosen Fall 2008
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
Functions f( ) = A B Lecture 15: Nov 4.
Functions Goals Introduce the concept of function Introduce injective, surjective, & bijective functions.
Copyright © Cengage Learning. All rights reserved.
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,
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
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.
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
Functions A B f( ) =. This Lecture We will define a function formally, and then in the next lecture we will use this concept in counting. We will also.
1 Introduction (Pengenalan) n About the Lecturer: –Nama lengkap: Heru Suhartanto, Ph.D –Kantor: Ruang 1214, Gedung A, Fakultas Ilmu Komputer UI, Depok.
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sifth Edition, Mc Graw-Hill, 2007 Chapter 2: Basic Structures: Sets, Functions, Sequences.
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.
Mathematics. Session Set, Relation & Function Session - 3.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
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.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
Week 7 - Friday.  What did we talk about last time?  Set disproofs  Russell’s paradox  Function basics.
An ordered n-tuple is a set of n objects with an order associated with them. If n objects are represented by x 1, x 2,..., x n, then we write the ordered.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
1 Annoucement n Skills you need: (1) (In Thinking) You think and move by Logic Definitions Mathematical properties (Basic algebra etc.) (2) (In Exploration)
FUNCTIONS.
Functions Section 2.3 of Rosen Spring 2012 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions: Use Piazza.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Chapter 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs BY: MISS FARAH ADIBAH ADNAN IMK.
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 
Functions Reading: Chapter 6 (94 – 107) from the text book 1.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Basic Structures: Functions Muhammad Arief download dari
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.
April 14, 2015Applied Discrete Mathematics Week 10: Equivalence Relations 1 Properties of Relations Definition: A relation R on a set A is called transitive.
Mathematical Induction
2.1 Sets ‒Sets ‒Common Universal Sets ‒Subsets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations 1.
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.
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3.
Basic Structures: Sets, Functions, Sequences, and Sums.
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 COSC-1321 Discrete Structures 1. Function. Definition Let X and Y be sets. A function f from X to Y is a relation from X to Y with the property.
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.
Week 8 - Monday.  What did we talk about last time?  Properties of functions  One-to-one  Onto  Inverses  Cardinality.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Discrete Mathematics Lecture # 17 Function. Relations and Functions  A function F from a set X to a set Y is a relation from X to Y that satisfies the.
Functions Goals Introduce the concept of function
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Relations, Functions, and Matrices
Applied Discrete Mathematics Week 2: Functions and Sequences
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.
Chapter 2 Sets and Functions.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
CS201: Data Structures and Discrete Mathematics I
Lecture 7 Functions.
Copyright © Cengage Learning. All rights reserved.
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Lecture # 18 Types of Functions
Presentation transcript:

Functions Reading: Epp Chp 7.1, 7.2, 7.4 CHAPTER 7 Functions Functions Reading: Epp Chp 7.1, 7.2, 7.4

Overview Functions Definitions Operations on Functions Definition Visualization Tool Examples Notation Identity Function Definitions Domain, codomain, range Image, inverse image Let f:A ® B and let S Í A and T Í B. S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T Operations on Functions Set related (È,Ç,-): If fÈg is a function, then f = g If fÇg is a function, then f = g If f-g is a function, then fÇg=f Inverse One-to-one and Onto Functions

1. Definition: Function Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2.

1. Definition: Function Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. A function is a relation. It’s just a special kind of relation – a relation with 2 restrictions.

Extract the meaning from the logical expression. 1. Definition: Function Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. A B R Every element in A must be associated with AT LEAST one element in B. Extract the meaning from the logical expression.

Extract the meaning from the logical expression. 1. Definition: Function Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. A B R 2. An element in A can only be associated with AT MOST one element in B. Extract the meaning from the logical expression.

Extract the meaning from the logical expression. 1. Definition: Function Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. A B R 1 and 2 taken together: Every element in A can only be associated with EXACTLY ONE element in B. Extract the meaning from the logical expression.

2. Visualisation Tool: Arrow Diagram Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. A B f Not a function

2. Visualisation Tool: Arrow Diagram Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. A B f Yes, it’s a function.

2. Visualisation Tool: Arrow Diagram Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. A B f Not a function

3. Examples Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. Example 1: A {1,2,3} B {1,2,3} R = {(1,2)} R Í A x B Is R a function? No. (Cond 1) R = {(1,2),(2,3),(1,3)} {1,2,3} No. (Cond 2) R = {(1,1),(2,1),(3,1)} {1,2,3} Yes. {1,2,3,4} {1,2,3} R = {(1,1),(2,2),(3,3)} No. (Cond 1) {1,2,3} {1,2,3,4} R = {(1,1),(2,2),(3,3)} Yes.

3. Examples Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. Example 2: Let R Í Q x Z such that… Q Z ½ ? (i) x R y iff x = y. Q: Is R a function? A: No (1st Condition: ½ maps to nothing) (ii) (a/b) R c iff a.b = c. Q: Is R a function? A: Yes

3. Examples Given a relation R from a set A to a set B, R is a function iff 1. "xÎA, $yÎB, x R y 2. "xÎA, " y1,y2ÎB, x R y1 Ù x R y2 ® y1 = y2. Example 3: Let R Í Z x Z such that… (i) x R y iff y = x2. Q: Is R a function? A: Yes. Z 3 ? 1 -1 (ii) x R y iff x = y2. Q: Is R a function? A: No. (1st and 2nd Condition violated)

3. Examples Functions in real life: Hamming distance function. Encoding/decoding functions. Boolean functions. A program is a function.

4. Notation We usually use “f,g,h,F,G,H” to denote functions. If the relation f Í A x B is a function, we write it as: f : A ® B If there is a way to compute yÎB from any given xÎA, we usually write ‘f(x)’ in place of ‘y’. Eg. 1: F Í Z x Z , x F y iff y = x2. ‘F’ is a function. We will write it as: F : Z ® Z, F(x) = x2 Eg. 2: F Í Z x Z , x F y iff y = x2 + 2x + 1 We will write it as: F : Z ® Z, F(x) = x2 + 2x + 1 Eg. 3: F Í Z x {0,1}, a F b iff (a is even ® b=1) Ù (a is odd ® b=0) F : Z ® {0,1}, F(x) = 1, if x is even 0, otherwise

4. Notation We usually use “f,g,h,F,G,H” to denote functions. If the relation f Í A x B is a function, we write it as: f : A ® B If there is a way to compute yÎB from any given xÎA, we usually write ‘f(x)’ in place of ‘y’. Therefore, the definitions instead of… 1. "xÎA, $yÎB, x R y 2. "xÎA, "y1,y2ÎB, x R y1 Ù x R y2 ® y1=y2. 1. "xÎA, $yÎB, y = f(x) 2. "xÎA, "y1,y2ÎB, y1=f(x) Ù y2=f(x) ® y1=y2. … can be also expressed as…

5. The identity function. The identity function on any given set, is a function that maps every element to itself. idA : A ® A, "xÎA, idA(x) = x

Overview Operations on Functions Set related (È,Ç,-): Inverse Definition Visualization Tool Examples Notation Identity Function Definitions Domain, codomain, range Image, inverse image Let f:A ® B and let S Í A and T Í B. S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T Operations on Functions Set related (È,Ç,-): If fÈg is a function, then f = g If fÇg is a function, then f = g If f-g is a function, then fÇg=f Inverse One-to-one and Onto Functions

6. Definition: domain, codomain, range Given a function: f : A ® B, The set A is known as the domain of f. The set B is known as the codomain of f. The set { yÎB | $xÎA, y=f(x)} is known as the range of f. A B f

6. Definition: domain, codomain, range Given a function: f : A ® B, The set A is known as the domain of f. The set B is known as the codomain of f. The set { yÎB | $xÎA, y=f(x)} is known as the range of f. Domain(f) A f B

6. Definition: domain, codomain, range Given a function: f : A ® B, The set A is known as the domain of f. The set B is known as the codomain of f. The set { yÎB | $xÎA, y=f(x)} is known as the range of f. Codomain(f) A f B

6. Definition: domain, codomain, range Given a function: f : A ® B, The set A is known as the domain of f. The set B is known as the codomain of f. The set { yÎB | $xÎA, y=f(x)} is known as the range of f. Range(f) NOTE: range(f) Í codomain(f) A f B

6. Definition: domain, codomain, range Given a function: f : A ® B, The set A is known as the domain of f. The set B is known as the codomain of f. The set { yÎB | $xÎA, y=f(x)} is known as the range of f. Example 1: f : Z ® Z+, f(x) = |2x| a. domain(f) = Z b. codomain(f) = Z+ c. range(f) = positive even numbers: {2x | x Î Z+}

6. Definition: domain, codomain, range Given a function: f : A ® B, The set A is known as the domain of f. The set B is known as the codomain of f. The set { yÎB | $xÎA, y=f(x)} is known as the range of f. Example 2: Let f : Z ® Z, f(x) = 2x + 1; g : Z ® Z, g(x) = 2x - 1 Then range(f) = range(g). Range(f) = 2x+1 = 2(x+1) – 1 = Range(g) "xÎZ, f(x) = g(x+1)

7. Definition: Image, Inverse Image. Given a function: f : A ® B, and S Í A The image of S is defined as: Imgf(S) = { yÎB | $xÎS, y=f(x)} A B f

7. Definition: Image, Inverse Image. Given a function: f : A ® B, and S Í A The image of S is defined as: Imgf(S) = { yÎB | $xÎS, y=f(x)} A B f S Image of S NOTE: Imgf(S) Í range(f) Í codomain(f)

7. Definition: Image, Inverse Image. Given a function: f : A ® B, and S Í A The image of S is defined as: Imgf(S) = { yÎB | $xÎS, y=f(x)} Given a function: f : A ® B, and T Í B The inverse image of T is defined as: InvImgf(T) = { xÎA | $yÎT, y=f(x)} A B f T Inverse image of T

7. Definition: Image, Inverse Image. Given a function: f : A ® B, and S Í A The image of S is defined as: Imgf(S) = { yÎB | $xÎS, y=f(x)} Given a function: f : A ® B, and T Í B The inverse image of T is defined as: InvImgf(T) = { xÎA | $yÎT, y=f(x)} Example: f : Z ® Z+, f(x) = |x| a. Imgf({10,-20}) = {10,20} b. InvImgf({10,20}) = {10, 20, -10, -20}

7. Definition: Image, Inverse Image. Given a function: f : A ® B, and S Í A The image of S is defined as: Imgf(S) = { yÎB | $xÎS, y=f(x)} or yÎImgf(S) iff $xÎS and y=f(x) Given a function: f : A ® B, and T Í B The inverse image of T is defined as: InvImgf(T) = { xÎA | $yÎT, y=f(x)} xÎInvImgf(T) iff $yÎT and y=f(x) Axiomatic definition

7.1 Theorem: Image, Inverse Image. Given any function: f : A ® B, S Í A, T Í B S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T Proof of (1): (Use diagrams to help visualise!) A B f

7.1 Theorem: Image, Inverse Image. Given any function: f : A ® B, S Í A, T Í B S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T Proof of (1): (Use diagrams to help visualize!) S A f B

7.1 Theorem: Image, Inverse Image. Given any function: f : A ® B, S Í A, T Í B S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T Assume xÎS Proof of (1): Then $yÎB such that y = f(x) (Since f is a function) Imgf(S) S Therefore yÎImgf(S) (Defn: yÎImgf(S) iff $xÎS and y=f(x)) y x Therefore yÎImgf(S) and y = f(x) Therefore xÎInvImgf(Imgf(S)) A f B

7.1 Theorem: Image, Inverse Image. Given any function: f : A ® B, S Í A, T Í B S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T Assume xÎS Proof of (1): Then $yÎB such that y = f(x) (Since f is a function) Imgf(S) Therefore yÎImgf(S) (Defn: yÎImgf(S) iff $xÎS and y=f(x)) y x Therefore yÎImgf(S) and y = f(x) Therefore xÎInvImgf(Imgf(S)) A f B (Defn:xÎInvImgf(T) iff $yÎT and y=f(x))

7.1 Theorem: Image, Inverse Image. Given any function: f : A ® B, S Í A, T Í B S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T …Proof of (2) left as an exercise… (Again, the skill that you must pick up is that you must use diagrams wherever possible, to help visualize the problem and use it to help you reason about proofs)

Overview Operations on Functions Set related (È,Ç,-): Functions If fÈg is a function, then f = g If fÇg is a function, then f = g If f-g is a function, then fÇg=f Inverse One-to-one and Onto Functions Functions Definition Visualization Tool Examples Notation Identity Function Definitions Domain, codomain, range Image, inverse image Let f:A ® B and let S Í A and T Í B. S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T

8. Operations on Functions. A function is a (special) relation. A relation is a set (of ordered pairs). Therefore, all definitions and operations on sets and relations are extended over to functions.

"xÎA, y1=f(x) Ù y2=g(x) ® y1=y2 8.1 Equality of Functions Given 2 functions, f : A ® B, g : A ® B, f = g iff f Í g and g Í f Or, in cases where y can be computed directly from x: f = g iff "xÎA, y1=f(x) Ù y2=g(x) ® y1=y2 Which is equivalent to: f = g iff "xÎA, f(x) = g(x)

8.2 Union, Intersection, Difference Given 2 functions, f : A ® B, g : A ® B, f Èg, f Çg, f-g are defined as accordingly in set theory (since functions are sets). …Or, in cases where y can be computed directly from x: (fÈg)(x) = y iff y = f(x) or y = g(x) (fÇg)(x) = y iff y = f(x) and y = g(x) (f-g)(x) = y iff y = f(x) and y ¹ g(x) NOTE: f Èg, f Çg, f-g need not necessarily be functions. At most, one can only conclude that f Èg, f Çg, f-g are relations. In order to assert that they are functions, one must prove that the 2 conditions necessary for functions are true.

8.2 Union, Intersection, Difference Theorem: Given 2 functions f and g from A to B, If f È g is a function, then f = g If f Ç g is a function, then f = g If f-g is a function, then f Ç g = f Proof of (1): (Direct proof: f = g iff "xÎA, f(x) = g(x) A B f A B g y1 x x y2 A B f È g But fÈg is a function! Defn:y1= (fÈg)(x) and y2= (fÈg)(x) then y1=y2. y2 y1 x

8.2 Union, Intersection, Difference Theorem: Given 2 functions f and g from A to B, If f È g is a function, then f = g If f Ç g is a function, then f = g If f-g is a function, then f Ç g = f Proof of (1): (Direct proof: f = g iff "xÎA, f(x) = g(x) Let xÎA. Since f is a function, then $y1ÎB, y1= f(x), (x,y1)Îf Since g is a function, then $y2ÎB, y2= g(x), (x,y2)Îg Therefore (x,y1) Î f Èg and (x,y2) Î f Èg. i.e. y1= (f Èg)(x) and y2 = (f Èg)(x) But since fÈg is a function, then y1=y2 . Therefore f(x) = g(x) (By definition of function equality)

8.2 Union, Intersection, Difference Theorem: Given 2 functions f and g from A to B, If f È g is a function, then f = g If f Ç g is a function, then f = g If f-g is a function, then f Ç g = f Proof of (3): (By contradiction) A B f-g x A B f x y A B g x y A B f Ç g x y

8.2 Union, Intersection, Difference Theorem: Given 2 functions f and g from A to B, If f È g is a function, then f = g If f Ç g is a function, then f = g If f-g is a function, then f Ç g = f Proof of (3): (By contradiction) Assume that f Ç g ¹ f Then by definition, $(x,y) Î f Ç g That means that (x,y) Î f and (x,y) Î g That means that (x,y) Ï (f – g). But f – g is a function! "xÎA, $yÎB, y = (f – g)(x). So there must be a (x,y) Î (f – g) => Contradiction! Therefore f Ç g = f.

8.2 Union, Intersection, Difference Theorem: Given 2 functions f and g from A to B, If f È g is a function, then f = g If f Ç g is a function, then f = g If f-g is a function, then f Ç g = f Proof of (2) left as an exercise Similar to Proof of (1).

8.3 Definition: Inverse of a function Given a function, f : A ® B, the inverse of a function is defined in the same way as that of a relation: f-1 = { (y,x) | (x,y) Îf } NOTE: f-1 need not necessarily be a function. It is first and foremost, a relation. In order to assert that they are functions, one must prove that the 2 conditions necessary for functions are true. So f-1 Í B x A If f-1 is a function, then we write: f-1 : B ® A … and then say that: f(x) = y iff f-1(y) = x

8.3 Definition: Inverse of a function Find the inverse of the function f(x) = (1+x)/(1-x). Ans: Let y = (1+x)/(1-x). Express x in terms of y. Therefore: y – yx = 1 + x Therefore: y – 1 = yx + x Therefore: x(y+1) = y–1 Therefore: x = (y–1)/(y+1) Therefore: f-1(y) = (y–1)/(y+1) i.e. f-1(x) = (x–1)/(x+1)

Overview Operations on Functions Set related (È,Ç,-): Functions If fÈg is a function, then f = g If fÇg is a function, then f = g If f-g is a function, then fÇg=f Inverse One-to-one and Onto Functions Functions Definition Visualization Tool Examples Notation Identity Function Definitions Domain, codomain, range Image, inverse image Let f:A ® B and let S Í A and T Í B. S Í InvImgf(Imgf(S)) Imgf(InvImgf(T)) Í T

One-to-One and Onto Functions Definition A function f: X → Y is one-to-one (also called injective) if and only if, for any x1, x2  X, if f(x1) = f (x2), then x1 = x2. (Alternatively, by contraposition, if x1  x2, then f(x1)  f(x2), i.e. the images of distinct elements in X are always distinct elements in Y.) Definition A function f: X → Y is onto (also called surjective) if and only if for all y  Y, there exists x  X such that y = f(x). (Alternatively, every element in Y is the image of at least one element in X.) Now let’s consider some earlier examples in light of these definitions.

One-to-One and Onto Functions (cont’d) Consider the following previously-discussed functions: 1. Let X = Y = {1, 2, 3} and f: X → Y be given by f(x) = x. Then f is both one-to-one and onto, i.e. distinct elements in X are always “mapped” to distinct elements in Y, and every element in Y is the image of an element (itself) in X. Let X = {-2, -1, 0, 1, 2}, Y = {0, 1, 2, 3, 4} and f: X → Y be given by f(x) = x2. Then f is not one-to-one, since (for example) f(-2) = f(2) = 4. Also, f is not onto, since (for example) y = 3 is not the image of any x  X. In the arrow diagram at right, h is not one-to-one, since h(x1) = h(x3) = y3. Likewise, h is not onto, since y2 is not the image of any element in X. h X → Y x1   y1 x2   y2 x3   y3

One-to-One and Onto Functions (cont’d) s(n) = (-1)n+1/n s: Z+ → Q 1 – 1 but not onto r(x) = |x| r: R → R neither 1 – 1 nor onto t(n) = n(mod 2) t: Z → {0, 1} onto but not 1 - 1 u(x) = x1/2 u: R+ → R+ both 1 – 1 and onto

One-to-One Correspondences and Inverse Functions Definition A function f: X → Y is a one-to-one correspondence (also called a bijection) if and only if f is both one-to-one and onto. Of the previous examples, only 1 function is a one-to-one correspondence: u: R+ → R+ where u(x) = x1/2. Two primary applications for one-to-one correspondences: 1. They are used to prove that two sets have the same number of elements, i.e. if a 1 – 1 correspondence exists between two sets, they have the same cardinality. 2. One-to-one correspondences are the only functions for which inverse functions exist.

One-to-One Correspondences and Inverse Functions (cont’d) Example Show that the odd integers have the same cardinality as the integers Z. Let O = {2k + 1 | k  Z} be the set of odd integers. Define a function f: Z → O by f(k) = 2k + 1. Every member of O is therefore the image of an element in Z, i.e. f is onto. Assume f(k1) = f(k2), i.e. 2k1 + 1 = 2k2 + 1. But then k1 = k2, i.e. f is one-to-one. It follows that f is a one-to-one correspondence, and hence n(O) = n(Z) = א0.

One-to-One Correspondences and Inverse Functions (cont’d) Example Find the inverse function for f: Z → O where f(k) = 2k + 1. The given function has just been shown to be a one-to-one correspondence. It follows that, for any n  O such that n = f(k) = 2k + 1, then k = (n – 1)/2, i.e. the required inverse function is f -1: O → Z, where f -1(n) = (n – 1)/2 = k. f 2k+1=n f -1 (n–1)/2=k f -1 (n–1)/2=k f 2k+1=n