Chapter 2 Sets and Functions.

Slides:



Advertisements
Similar presentations
Functions Reading: Epp Chp 7.1, 7.2, 7.4
Advertisements

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.
DEFINITION A function f : A  B is a one-to-one correspondence (called a bijection) iff f is one-to-one and onto B. We write f : A  B to indicate that.
Copyright © Cengage Learning. All rights reserved.
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
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,
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.
Math 3121 Abstract Algebra I Lecture 3 Sections 2-4: Binary Operations, Definition of Group.
Relations and Functions Another Foundational Concept Copyright © 2014 – Curt Hill.
Mathematics. Session Set, Relation & Function Session - 3.
Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.
Chapter 3 Functions Functions provide a means of expressing relationships between variables, which can be numbers or non-numerical objects.
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.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
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.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
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 
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.
Basic Structures: Functions Muhammad Arief download dari
CSE 2353 – October 1 st 2003 Functions. For Real Numbers F: R->R –f(x) = 7x + 5 –f(x) = sin(x)
Chapter 5 – Relations and Functions. 5.1Cartesian Products and Relations Definition 5.1: For sets A, B  U, the Cartesian product, or cross product, of.
Agenda Week 10 Lecture coverage: –Functions –Types of Function –Composite function –Inverse of a function.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
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.
A function is a rule f that associates with each element in a set A one and only one element in a set B. If f associates the element b with the element.
1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.
Section 2.3. Section Summary  Definition of a Function. o Domain, Cdomain o Image, Preimage  One-to-one (Injection), onto (Surjection), Bijection 
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.
Functions Goals Introduce the concept of function
1-1 Copyright © 2013, 2005, 2001 Pearson Education, Inc. Section 2.4, Slide 1 Chapter 2 Sets and Functions.
Functions Section 2.3.
Chapter 2 Sets and Functions.
Chapter 3 The Real Numbers.
Chapter 5 Limits and Continuity.
Relations, Functions, and Matrices
Chapter 3 The Real Numbers.
5 Systems of Linear Equations and Matrices
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.
Relation and function.
Chapter 3 The Real Numbers.
Linear Algebra Linear Transformations. 2 Real Valued Functions Formula Example Description Function from R to R Function from to R Function from to R.
Chapter 3 The Real Numbers.
Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive,
Functions Defined on General Sets
Functions Section 2.3.
CS201: Data Structures and Discrete Mathematics I
Chapter 2 Sets and Functions.
Lecture 7 Functions.
CSE15 Discrete Mathematics 02/27/17
CS100: Discrete structures
CS 220: Discrete Structures and their Applications
Introduction to Relations and Functions
Ch 5 Functions Chapter 5: Functions
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Chapter 4 Sequences.
Copyright © Cengage Learning. All rights reserved.
Functions Section 2.3.
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Copyright © Zeph Grunschlag,
Presentation transcript:

Chapter 2 Sets and Functions

Section 2.3 Functions

Definition 2.3.1 Let A and B be sets. A function from A to B is a nonempty relation f  A  B that satisfies the following two conditions: 1. Existence: For all a in A, there exists a b in B such that (a, b)  f. 2. Uniqueness: If (a, b)  f and (a, c)  f , then b = c. That is, given any element a in A, there is one and only one element b in B such that (a, b)  f. Set A is called the domain of f and is denoted by dom f. Set B is referred to as the codomain of f. We write f : A  B to indicate f has domain A and codomain B. The range of f, denoted rng  f, is the set of all second elements of members of f . That is, rng f = {b  B :  a  A (a, b)  f }. If (x, y)  f , we often say that f maps x onto y and use the notation y = f (x). Domain A Codomain B  x f (x)  rng  f f : A  B

Practice 2.3.2* *Similar to Practice 2.3.2 in the text. Let A = {1, 2, 3} and B = {2, 4, 6, 8}. Which of the following relations are functions from A to B? A 1 2 3 B 4 6 8 R = {(1, 6), (2, 4)} This is not a function. It violates the existence condition. The number 3 in set A is not related to anything in set B. A 1 2 3 B 4 6 8 R = {(1, 2), (2, 8), (3, 6), (1, 4)} This is not a function. It violates the uniqueness condition. The number 1 in set A is related to two numbers in set B.

Practice 2.3.2* *Similar to Practice 2.3.2 in the text. Let A = {1, 2, 3} and B = {2, 4, 6, 8}. Which of the following relations are functions from A to B? A 1 2 3 B 4 6 8 R = {(1, 6), (2, 8), (3, 2)} This is a function from A to B. It is OK that nothing in set A is related to number 4 in set B. A 1 2 3 B 4 6 8 R = {(1, 4), (2, 6), (3, 4)} This is a function from A to B. It is OK that both 1 and 3 in set A are related to 4 in set B. In both of these functions, there is at least one element in B that is not related to anything in A. When there are no extra elements in B, the function is given a special name.

Properties of Functions Definition 2.3.4 A function f : A  B is called surjective (or is said to map A onto B) if B = rng f. A surjective function is also referred to as a surjection. The question of whether or not a function is surjective depends on the choice of codomain. A function can always be made surjective by restricting the codomain to being equal to the range, but sometimes this is not convenient. If it happens that no member of the codomain appears more than once as a second element in one of the ordered pairs, then we have another important type of function. Definition 2.3.5 A function f : A  B is called injective (or one-to-one) if, for all a and a in A, f (a) = f (a) implies that a = a. An injective function is also referred to as an injection. If a function is both surjective and injective, then it is particularly well behaved. Definition 2.3.6 A function f : A  B is called bijective or a bijection if it is both surjective and injective.

Example 2.3.7 Consider the function given by the formula f (x) = x2. y = h (x) 4 If we take for both the domain and codomain so that f :      , then f is not surjective because there is no real number that maps onto –1. y = f (x) y = g (x) 2 If we limit the codomain to be the set [0, ), then the function g :  [0, ) such that g(x) = x2 is surjective. – 2 2 x y = – 1 Since g(1) = g(1), we see that g is not injective when defined on all of . But restricting g to be defined on only [0, ), it becomes injective. Thus h: [0, )  [0, ) such that h(x) = x2 is bijective.

Practice 2.3.12 Consider the four functions pictured below. For each function, the domain and codomain are sets consisting of two or three points as indicated. Classify each function as being surjective, injective, bijective, or none of these.      This function is injective. This function is neither.      This function is surjective. This function is bijective.

Functions Acting on Sets When thinking of a function as transforming its domain into its range, we may wish to consider what happens to certain subsets of the domain. Or we may wish to identify the set of all points in the domain that are mapped into a particular subset of the range. To do this we use the following notation: Notation 2.3.13 Suppose that f : A  B. If C  A, we let f (C ) represent the subset { f (x): x  C} of B. The set f (C ) is called the image of C in B. f A B f (A) f – 1 f – 1(D) D f (C) C f If D  B, we let f – 1(D) represent the subset {x  A: f (x)  D} of A. The set f – 1(D) is called the pre-image of D in A or “ f inverse of D. ” Note: At this time, f – 1 is only applied to sets, not points.

Example 2.3.13 Let f :     be given by f (x) = x2. Then the following hold. – 2 2 x 4 y y = x2 If C1 = [0, 2], then f (C1) = [0, 4]. f (C1) C1

Example 2.3.13 Let f :     be given by f (x) = x2. Then the following hold. – 2 2 x 4 y y = x2 If C1 = [0, 2], then f (C1) = [0, 4]. If C2 = [1, 2], then f (C2) = [0, 4]. f (C2) C2

Example 2.3.13 Let f :     be given by f (x) = x2. Then the following hold. – 2 2 x 4 y y = x2 If C1 = [0, 2], then f (C1) = [0, 4]. If C2 = [1, 2], then f (C2) = [0, 4]. If C3 = [2, 1]  [0, 1], then f (C3) = [0, 4]. f (C3) C3

Example 2.3.13 Let f :     be given by f (x) = x2. Then the following hold. – 2 2 x 4 y y = x2 If C1 = [0, 2], then f (C1) = [0, 4]. If C2 = [1, 2], then f (C2) = [0, 4]. If C3 = [2, 1]  [0, 1], then f (C3) = [0, 4]. If D1 = [0, 4], then f – 1(D1) = [2, 2]. D1 f – 1(D1)

Example 2.3.13 Let f :     be given by f (x) = x2. Then the following hold. – 2 2 x 4 y y = x2 If C1 = [0, 2], then f (C1) = [0, 4]. If C2 = [1, 2], then f (C2) = [0, 4]. If C3 = [2, 1]  [0, 1], then f (C3) = [0, 4]. If D1 = [0, 4], then f – 1(D1) = [2, 2]. If D2 = [1, 4], then f – 1(D2) = [2, 2]. D2 f – 1(D2)

Example 2.3.13 Let f :     be given by f (x) = x2. Then the following hold. – 2 2 x 4 y y = x2 If C1 = [0, 2], then f (C1) = [0, 4]. If C2 = [1, 2], then f (C2) = [0, 4]. If C3 = [2, 1]  [0, 1], then f (C3) = [0, 4]. If D1 = [0, 4], then f – 1(D1) = [2, 2]. If D2 = [1, 4], then f – 1(D2) = [2, 2]. If D3 = [1, 4], then f – 1(D3) = [2, 1]  [1, 2]. D3 f – 1(D3)

Given a function f : A  B, there are many relationships that hold between the images and pre-images of subsets of A and B. Several of these are included in the next theorem. The proofs are left to the practice problems and the exercises. Theorem 2.3.16 Suppose that f : A  B. Let C, C1, and C2 be subsets of A and let D, D1, and D2 be subsets of B. Then the following hold: (a) C  f  – 1[ f (C)] (b) f [ f  – 1(D)]  D (c) f (C1  C2)  f (C1)  f (C2) (d) f (C1  C2) = f (C1)  f (C2) (e)  f  – 1(D1  D2) =  f  – 1(D1)   f – 1(D2) (f )  f  – 1(D1  D2) =  f – 1(D1)   f – 1(D2) (g)  f  – 1(B \D) = A\ f  – 1(D)

Given f : A  B, suppose C1 and C2 are nonempty subsets of A such that To see that equality may not hold in Theorem 2.3.16 (a) and (c), consider the following situation: Given f : A  B, suppose C1 and C2 are nonempty subsets of A such that C1  C2 =  and f (C1) = f (C2). A B f C1 f (C1) C2 f (C2) We see that f – 1[ f (C1)] = C1  C2, and this is larger than C1. This shows that equality may not hold in part (a): C  f  – 1[ f (C)]. Also, since C1  C2 = , we have f (C1  C2 ) = . But f (C1)  f (C2) = f (C1)  , This shows that equality may not hold in part (c): f (C1  C2)  f (C1)  f (C2).

While Theorem 2.3.16 states the strongest results that hold in general, if we apply certain restrictions on the functions involved, then the containment symbols in parts (a), (b), and (c) may be replaced by equality. Theorem 2.3.18 Suppose that f : A  B. Let C, C1, and C2 be subsets of A and let D be a subset of B. Then the following hold: If f is injective, then f – 1[ f (C)] = C. If f is surjective, then f [ f – 1(D)] = D. If f is injective, then f (C1  C2) = f (C1)  f (C2). Proof of (c): We only have to show that f (C1)  f (C2)  f (C1  C2), since the converse inclusion is Theorem 2.3.16(c). To this end, let y  f (C1)  f (C2). Then y  f (C1) and y   f (C2). It follows that there exists a point x1 in C1 such that f (x1) = y. Similarly, there exists a point x2 in C2 such that f (x2) = y. Since f is injective and f (x1) = y = f (x2), we must have x1 = x2. That is, x1  C1  C2. But then y = f (x1)  f (C1  C2). 

Composition of Functions If f and g are functions with f : A  B and g : B  C, then for any a  A, f (a)  B. But B is the domain of g, so g can be applied to f (a). This yields g ( f (a)), an element of C. B C A f g g ( f (a)) f (a)   a  ( g ○ f )(a) g ○ f  This establishes a correspondence between a in A and g ( f (a)) in C. This correspondence is called the composition function of f and g and is denoted by g ○ f  (read “g of f ”). It defines a function g ○ f  : A  C given by ( g ○ f )(a) = g ( f (a)) for all a  A.

Theorem 2.3.20 Inverse Functions Our next theorem tells us that composition of functions preserves the properties of being surjective or injective. The proof is in the book and the exercises. Theorem 2.3.20 Let f : A  B and g : B  C. Then (a) If f and g are surjective, then g ○ f  is surjective. (b) If f and g are injective, then g ○ f  is injective. (c) If f and g are bijective, then g ○ f  is bijective. Inverse Functions Given a function f : A  B, we have seen how f determines a relationship between subsets of B and subsets of A. That is, given D  B, we have the pre-image f – 1(D) in A. We would like to be able to extend this idea so that f – 1 can be applied to a point in B to obtain a point in A. That is, suppose D = { y}, where y  B. There are two things that can prevent f – 1(D) from being a point in A: It may be that f – 1(D) is empty, and it may be that f – 1(D) contains several points instead of just one.

Practice 2.3.21 Practice 2.3.22  Definition 2.3.23 Given f : A  B and y  B, under what conditions on f can we assert that there exists an x in A such that f (x) = y? Practice 2.3.21 Ans: f must be surjective. Given f : A  B and y  B, under what conditions on f can we assert that there exists a unique x in A such that f (x) = y? Practice 2.3.22 Ans: f must be bijective. Given a bijection f : A  B, we see that each y in B corresponds to exactly one x in A, the unique x such that f (x) = y. This correspondence defines a function from B into A called the inverse of f and denoted f  – 1 . Thus x = f  – 1( y). A B x = f  – 1.( y) y = f  ( x)  f  f  – 1 Definition 2.3.23 Let f : A  B be bijective. The inverse function of f is the function given by f  – 1  = {( y, x)  B  A : (x, y)  f }.

If f : A  B is bijective, then it follows that f – 1 : B  A is also bijective. Indeed, since dom f = A and rng f = B, we have dom f – 1 = B and rng f – 1  = A. Thus f – 1 is a mapping from B onto A. Since f is a function, a given x in A can correspond to only one y in B. This means that f – 1 is injective, and hence bijective. When f is followed by f – 1, the effect is to map x in A onto f (x) in B and then back to x in A. That is, ( f – 1 ○ f )(x) = x, for every x  A. A function defined on a set A that maps each element in A onto itself is called the identity function on A, and is denoted by iA. So, f – 1 ○ f  = iA. Furthermore, if f (x) = y, then x = f – 1( y), so that ( f ○ f – 1 )( y) = f ( f – 1 ( y)) = f (x) = y. Thus f ○ f – 1 = iB. We summarize these results in the following theorem. Theorem 2.3.24 Let f : A  B be bijective. Then (a) f – 1 : B  A is bijective (b) f – 1 ○ f = iA and f ○ f – 1 = iB.

Our final theorem relates inverse functions and composition. Let f : A  B and g : B  C be bijective. Then the composition g ○ f : A  C is bijective and ( g ○ f )  1 = f – 1 ○ g  1. Proof: We know from Theorem 2.3.20 that g ○ f is bijective, so g ○ f has an inverse denoted by ( g ○ f )  1, and this inverse maps C onto A. f g f  –1 g –1 A B C g ○ f ( g ○ f ) –1 = f –1 ○ g –1 We are asked to verify the equality of the two functions ( g ○ f )  1 and f – 1 ○ g  1, as sets of ordered pairs.

To show ( g ○ f )  1  f – 1 ○ g  1, we suppose (c, a)  ( g ○ f )  1. By the definition of an inverse function, this means (a, c)  g ○ f . The definition of composition implies that  b  B such that (a, b)  f and (b, c)  g. Since f and g are bijective, this means that (b, a)  f  – 1 and (c, b)  g – 1. That is, f – 1(b) = a and g – 1(c) = b. But then, ( f – 1 ○ g  1)(c) = f – 1( g  1(c)) = f – 1(b) = a, so that (c, a)  ( f – 1 ○ g  1) and ( g  ○  f )  1  ( f – 1 ○ g  1). The reverse set inclusion is Exercise 31. 