11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved. CHAPTER 1 SPEAKING MATHEMATICALLY SPEAKING MATHEMATICALLY.
Advertisements

Functions Section 2.3 of Rosen Fall 2008
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
Discrete Structures Chapter 5 Relations and Functions
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,
Functions.
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.
Functions, Sequences, and Sums
Discrete Structures Functions Dr. Muhammad Humayoun Assistant Professor COMSATS Institute of Computer Science, Lahore.
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.
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.
Mathematics. Session Set, Relation & Function Session - 3.
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.
1 Relations and Functions Chapter 5 1 to many 1 to 1 many to many.
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.
Fall 2002CMSC Discrete Structures1 … and the following mathematical appetizer is about… Functions.
10/26/20151 … and the following mathematical appetizer is about… Functions.
FUNCTIONS.
Chap. 5 Relations and Functions. Cartesian Product For sets A, B the Cartesian product, or cross product, of A and B is denoted by A ╳ B and equals {(a,
Functions Section 2.3 of Rosen Spring 2012 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions: Use Piazza.
MSU/CSE 260 Fall Functions Read Section 1.8.
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,
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.
Basic Structures: Functions Muhammad Arief download dari
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.
CompSci 102 Discrete Math for Computer Science January 31, 2012 Prof. Rodger Slides modified from Rosen AB a b c d x y z.
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
Functions. L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
MATH 224 – Discrete Mathematics
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.
CSC102 - Discrete Structures Functions
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.
College Algebra Fifth Edition James Stewart Lothar Redlin Saleem Watson.
1 Functions CS 202 Epp section ??? Aaron Bloomfield.
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.
Functions CSRU1400 Spring 2008Ellen Zhang 1 CISC1400, Fall 2010 Ellen Zhang.
Discrete Mathematics 3. MATRICES, RELATIONS, AND FUNCTIONS Lecture 6 Dr.-Ing. Erwin Sitompul
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.
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.
Discrete Mathematics Functions
Relations, Functions, and Matrices
Functions.
Chapter 2 Sets and Functions.
Relation and function.
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 Section 2.3.
CS201: Data Structures and Discrete Mathematics I
CSE15 Discrete Mathematics 02/27/17
CS100: Discrete structures
Functions.
Ch 5 Functions Chapter 5: Functions
Functions Section 2.3.
Presentation transcript:

11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1

22 Relations and Functions Objectives : On completion of this chapter, student should be able to: 1. Define a relation and function 2. Determine the type of function (one-to-one, onto, one-to-one correspondence) 3. Find a composite function 4. Find an inverse function

33 Contents 1. Cartesian product and relations 2. Functions: Plain and One-to-One 3. Onto Functions 4. Function Composition and inverse functions

4 Relationship Set Cartesian Product Relation Function

55 RELATIONS AND FUNCTIONS CARTESIAN PRODUCTS AND RELATIONS Definition 5.1 For sets A, B, the Cartesian product, or cross product, of A and B is denoted by A × B and equals {(a, b) | a ∈ A, b ∈ B}. Elements of A × B are ordered pairs. For (a, b), (c, d) ∈ A × B, (a, b) = (c, d) if and only if a = c and b = d. 5 RELATIONS AND FUNCTIONS

666 If A, B are finite, it follows from the rule of product that |A × B| = |A||B|. Although we generally will not have A × B = B × A, we will have |A×B|=|B×A| Although A, B ⊆ U, it is not necessary that A × B ⊆ U. If (a 1, a 2, …, a n ), (b 1, b 2,...,b n ) ∈ A 1 × A 2 × … × A n, then (a1, a2, …., an) = (b1, b2, …, bn) if and only if ai = bi, ∀ 1 ≤ i ≤ n.

77 Example 5.1 Let A = {2, 3, 4}, B = {4, 5}. Then a) A × B = {(2, 4), (2, 5), (3, 4), (3, 5), (4, 4), (4, 5)}. b) B × A = {(4, 2), (4, 3), (4, 4), (5, 2), (5, 3), (5, 4)}. c) B 2 = B × B = {(4, 4), (4, 5), (5, 4), (5, 5)}. d) B 3 = B × B × B = {(a, b, c) | a, b, c ∈ B}; for instance, (4, 5, 5) ∈ B3. 7

88 Example 5.3 An experiment E is conducted as follows: A single dice is rolled and its outcome noted, and then a coin is flipped and its outcome noted. Determine a sample space S for E. 8

99 S1={1, 2, 3, 4, 5, 6} be a sample space dice. S2= {H, T} be a sample space coin. Then S = S1 × S2 is a sample space for E. This sample space can be represented pictorically with a tree diagram that exhibits all the possible outcomes of experiment E.

10

11 Example 5.4 At the Wimbledon Tennis Championships, women play at most three sets in a match. The winner is the first to win two sets. If we let N and E denote the two players, the tree diagram indicates the six ways in which this match can be won. For example, the starred line segment (edge) indicates that player E won the first set. The double starred edge indicates that player N has won the match by winning the first and third sets. 11

12

13 Definition 5.2 (relation) For sets A, B, any subset of A × B is called a (binary) relation from A to B. Any subset of A × A is called a (binary) relation on A. 13

14 Example 5.5 From Example 5.1 A = {2, 3, 4}, B = {4, 5}. Then A × B = {(2, 4), (2, 5), (3, 4), (3, 5), (4, 4), (4, 5)}. The following are some of the relations from A to B. a) ∅ b) {(2, 4)} c) {(2, 4), (2, 5)} d) {(2, 4), (3, 4), (4, 4)} e) {(2, 4), (3, 4), (4, 5)} f) A × B Since |A × B| = 6, it follows from Definition 5.2 that there are 2 6 possible relations from A to Β (for there are 2 6 possible subsets of A × B ). 14

15 Example 5.6 For B={1,2}, let A=P(B)= { ∅,{1},{2},{1,2}}. |A×A| = 4.4 = 16. A×A = {( ∅, ∅ ),( ∅,{1}),( ∅,{2}),( ∅,{1,2}), ({1}, ∅ ), ({1},{1}), ({1},{2}), ({1},{1,2}) ({2}, ∅ ),({2},{1}), ({2},{2}), ({2},{1,2}) ({1,2}, ∅ ),({1,2},{1}),({1,2},{2}, ({1,2},{1,2})} The following is an example of a relation on A: R = {( ∅, ∅ ), ( ∅, {1}), ( ∅, {2}), ( ∅, {1, 2}), ({1}, {1}), ({1}, {1, 2}), ({2}, {2}), ({2}, {1, 2}), ({1, 2}, {1, 2})}. 15

16 Example 5.7 With A = Z + (set of positive integers), we may define a relation R on set A as {(x, y) | x ≤ y}. This is the familiar “is less than or equal to” relation for the set of positive integers. It can be represented graphically as the set of points, with positive integer components, located on or above the line y = x in the Euclidean plane, as partially shown in the figure below. 16

17 (7, 7), (7, 11) ∈ R (8, 2) ∉ R (7, 11) ∈ R or 7 R 11 (infix notation)

18 Question ?????

19 FUNCTIONS: ONE-TO-ONE Definition 5.3 For nonempty sets A, B, a function, or mapping, f from A to B, denoted f: A → B, is a relation from A to B in which every element of A appears exactly once as the first component of an ordered pair in the relation. 19

20 Function

21 We often write f(a) = b when (a, b) is an ordered pair in the function f. For (a, b) ∈ f, b is called the image of a under f, whereas a is a preimage of b. The definition suggests that f is a method for associating with each a ∈ A the unique element f (a) = b ∈ B. Consequently, (a, b), (a, c) ∈ f implies b = c.

22 Example 5.9 For A = {1, 2, 3} and B = {w, x, y, z}, f = {(1, w), (2, x), (3, x)} is a function, and consequently a relation, from A to B. R 1 = {(1, w), (2, x)} and R 2 = {(1, w), (2, w), (2, x), (3, z)} are relations, but not functions, from A to B. (Why?) 22

23 Definition 5.4 For the function f: A → B, A is called the domain of f and B the codomain of f. The subset of B consisting of those elements that appear as second components in the ordered pairs of f is called the range of f and is also denoted by f (A) because it is the set of images (of the elements of A) under f. In Example 5.9, f = {(1, w), (2, x), (3, x)} the domain of f = {1,2,3}, the codomain of f = {w, x, y, z}, and the range of f = f (A) = {w, x}. 23

24 a may be regarded as an input that is transformed by f into the corresponding output, f(a).

25 Example 5.10 Many interesting functions arise in computer science. a) A common function encountered is the greatest integer function, or floor function. This function f: R → Z, is given by f (x) = x = the greatest integer less than or equal to x. Consequently, f (x) = x, if x ∈ Z; and, when x ∈ R – Z, f (x) is the integer to the immediate left of x on the real number line. For this function, we find that 25 

26 1) 3.8 = 3, 3 = 3, –3.8 = –4, –3 = –3; 2) = 15.3 = 15 = = ; and 3) = 16.1 = 16 ≠ 15 = =

27 b) A second function –one related to the floor function in part (a) –is the ceiling function. The function g: R → Z is defined by g(x) = x = the least integer greater than or equal to x. So g (x) = x when x ∈ Z, but when x ∈ R – Z, then g (x) is the integer to the immediate right of x on the real number line. 27

28 In dealing with the ceiling function, we find that 1) 3 = 3, 3.01 = 3.7 = 4 = 4, –3 = –3,–3.01 = –3.7 = –3; 2) = 8.1 = 9 = = ; and 3) = 7.5 = 8 ≠ 9 = =

29 c) The function trunc (for truncation) is another integer – valued function defined on R. This function deletes the fractional part of a real number. For example, trunc (3.78) = 3, trunc (5) = 5, trunc (–7.22) = –7. Note that trunc (3.78) = 3.78 = 3 while trunc (–3.78) = –3.78 = –3. 29

30 No. of Functions In Example 5.9 ( For A = {1, 2, 3} and B = {w, x, y, z}, f = {(1, w), (2, x), (3, x)} ) there are 2 12 = 4096 relations from A to B. We have examined one function among these relations, and now we wish to count the total number of functions from A to B.

31 For general case, let A, B be nonempty sets with |A| = m, |B| = n. Consequently, If A = {a 1, a 2, …, a m } and B={b 1,b 2,…,b n }, then a typical function f: A → B can be described by {(a 1, x 1 ), (a 2, x 2 ), (a 3, x 3 ), …, (a m, x m )} – m ordered pairs. x 1 can selected from any of the n elements of B x 2 “ ………………….. x m “ In this way, using the rule of product, there are n m = |B| |A| functions from A to B. 31

32 Therefore, for A, B in Example 5.9, there are 4 3 = |B| |A| =64 functions from A to B, and 3 4 = |A| |B| = 81 functions from B to A. Unlike the situation for relations, we cannot always obtain a function from B to A by simply interchanging the components in the ordered pairs of a function from A to B (or vice versa). Try to interchange the components in the f! For A = {1, 2, 3} and B = {w, x, y, z}, f = {(1, w), (2, x), (3, x)} ) 32

33 Definition 5.5 A function f: A → B is called one-to-one, or injective, if each element of B appears at most once as the image of an element of A. 33

34

35

36 One-to-one Function If f: A → B is one-to-one, with A, B finite, we must have |A|≤|B|. For arbitrary sets A, B, f: A → B is one-to-one if and only if for all, a 1, a 2 ∈ A, f (a 1 ) = f (a 2 ) ⇒ a 1 = a 2.

37 Example 5.13 Consider the function f: R→ R where f (x) = 3x + 7 for all x ∈ R. Then for all x 1, x 2, ∈ R, we find that f (x1) = f (x2) ⇒ 3x = 3x ⇒ 3x 1 = 3x 2 ⇒ x 1 = x 2, so the given function f is one-to-one. 37

38 One-to-one function On the other hand, suppose that g: R → R is the function defined by g (x) = x 4 – x for each real number x. Then g(0) = (0) 4 – 0 = 0 and g(1) = (1)4 – (1) = 1 – 1 = 0. Consequently, g is not one-to-one, since g(0) = g (1) but 0 ≠ 1 – that is, g is not one to-one because there exist real numbers x 1, x 2 where g (x 1 ) = g (x 2 ) ⇒ x 1 = x 2.

39 Example 5.14 Let A = {1, 2, 3} and B = {1, 2, 3, 4, 5}. The function f = {(1, 1), (2, 3), (3, 4)} is a one-to-one function from A to B; g = {(1, 1), (2, 3), (3, 3)} is a function from A to B, but fails to be one-to-one because g(2) = g(3) = 3 but 2 ≠ 3. For A, B in the above example there are 2 15 relations from A to B and 5 3 of these are functions from A to B. The next question we want to answer is how many functions f: A → B are one-to-one. 39

40 With A = {a 1, a 2, a 3, …, a m }, B = {b 1, b 2, b 3, …, b n }, and m ≤ n, a one-to-one function f: A → B has the form {(a 1, x 1 ), (a 2, x 2 ), (a 3, x 3 ), …, (a m, x m )}, where there are n choices for x 1 n – 1 choices for x 2 n - 2 choices for x 3 ……….. n–m+1 choices for x m., the number of one-to-one functions from A to B is n(n-1)(n-2)…(n-m+1)=n!/(n-m)! = P(n,m)= P(|B|,|A|) 40

41 No. of One-to-One Functions Consequently, for A, B in Example 5.14 (A = {1, 2, 3} and B = {1, 2, 3, 4, 5}), there are P(5,3) = = 60 one-to-one functions f: A → B.

42 Question ?????

43 Onto Functions: Definition 5.9 A function f: A→ B is called onto, or surjective, if f (A)=B – that is, if for all b ∈ B there is at least one a ∈ A with f (a) = b. a b How to determine whether a function is onto? 43

44 Onto function

45

46 Example 5.19 The function f: R → R defined by f(x) = x 3 is an onto function. if r is any real number in the codomain of f, then the real number 3 √r is in the domain of f and f ( 3 √r) = ( 3 √r) 3 = r. e.g. f(3) = 27, f(-3) = -27 Hence the codomain of f = R = range of f, and the function f is onto.

47 The function g: R → R, where g(x) = x 2 for each real number x, is not an onto function. In this case, no negative real number appears in the range of g. For example, for –9 to be in the range of g, we would have to be able to find a real number r with g(r) = r 2 = –9. Note, however, that the function h: R → [ 0, +∞ ) defined by h(x) = x 2 is an onto function. 47

48 Example 5.20 Consider the function f: Z → Z, where f(x) = 3x + 1 for each x ∈ Z. Here the range of f = {…, –8, –5, –2, 1, 4, 7, …} ⊂ Z, so f is not an onto function. E.g. f(x) = 3x + 1 = 8 then x = 7/3. Rational number 7/3 is not an integer –so there is no x in the domain Z with f(x) = 8. 48

49 On the other hand, each of the functions 1) g: Q → Q, where g(x) = 3x + 1 for x ∈ Q; and 2) h: R → R, where h(x) = 3x + 1 for x ∈ R is an onto function. (Q is a set of rational numbers: a/b) Furthermore, 3x = 3x ⇒ 3x 1 = 3x 2 ⇒ x 1 = x 2, regardless of whether x 1 and x 2 are integers, rational numbers, or real numbers. Consequently, all three of the functions f, g and h are one- to-one. 49

50 Example 5.21 If A = {1, 2, 3, 4} and B = {x, y, z}, then f 1 = {(1, z), (2, y), (3, x), (4, y)} and f 2 = {(1, x), (2, x), (3, y), (4, z)} are both functions from A onto B. However, the function g = {(1, x), (2, x), (3, y), (4,y)} is not onto, because g (A) = {x, y} ⊂ B. If A, B are finite sets, then for an onto function f: A → B to possibly exist we must have |A|≥ |B|where |A|=m≥ n= |B|. ******* 50

51 Function Composition and Inverse Functions Objective (Continue) 1. Define a relation and function 2. Determine the type of function (one-to-one, onto) 3. Find a composite function 4. Find an inverse function 51

52 Contents 1. One-to-one correspondence function 2. Composite function 3. Inverse function

53 Function Composition Definition 5.15 If f: A → B, then f is said to be bijective, or to be a one-to- one correspondence, if f is both one-to-one and onto. Example 5.50 If A = {1, 2, 3, 4} and B = {w, x, y, z}, then f = {(1,w),(2,x),(3,y),(4, z)} is a one-to-one correspondence from A (on) to B, Why? f is one-to-one (every element of B appear at most once), and f is onto (f(A) = B) 53

54 example A = {1, 2, 3, 4} and B = {w, x, y, z}, and g = {(w, 1), (x, 2), (y, 3), (z, 4)} is a one-to-one correspondence from B (on) to A. because g is one-to-one and g is onto.

55 Identity Function Definition 5.16 The function 1 A : A → A, defined by 1 A (a) = a for all a ∈ A, is called the identity function for A. It is a function that always returns the same value that was used as its argument. In terms of equations, the function is given by f(x) = x.functionequations 55

56 Function equality When are f and g equal? Definition 5.17 If f, g: A → B, we say that f and g are equal and write f= g, if f (a) = g (a) for all a ∈ A. Example: Define f: R → R and g: R → R by the following formulas: f(x) =|x| for all x ∈ R g(x) = √x 2 for all x ∈ R Does f = g? Yes, |x| = √x 2 for all x ∈ R

57 Objectives 1. Define a relation and function 2. Determine the type of function (one-to-one, onto) 3. Find a composite function 4. Find an inverse function

58 Composite Function Function composition is an operation for combining two functions. Definition 5.18 If f: A → B and g: B → C, we define the composite function, which is denoted g o f: A → C, by (g o f ) (a) = g (f (a)), for each a ∈ A. (i.e. element a of g is replaced by f(a)) 58

59 Example 5.53 Let A = {1, 2, 3, 4}, B = {a, b, c}, and C = {w, x, y, z} with f: A → B and g: B → C given by f = {(1, a), (2, a), (3, b), (4, c)} and g = {(a, x), (b, y), (c, z)}. For each element of A we find: (g o f) (1) = g (f (1))= g (a) = x (g o f) (2) = g (f (2))= g (a) = x (g o f) (3) = g (f (3))= g (b) = y (g o f) (4) = g (f (4))= g (c) = z So g o f = {(1, x), (2, x), (3, y), (4, z)}. Note: The composition f o g is not defined (domain of f is A and codomain of g is C). 59 Function f a a b c

60 Example 5.54 Are f o g and g o f equal? Let f: R → R, g: R → R be defined by f (x) = x 2, g(x) = x + 5. Then (g o f) (x) = g (f (x)) = g (x 2 ) = x 2 + 5, whereas (f o g) (x) = f (g (x)) = f (x+ 5) = (x+ 5) 2 = x x Here g o f: R → R and f o g: R → R, but (g o f) (1) = 6 ≠ 36 = (f o g) (1), so even though both composites f o g and g o f can be formed, we do not have f o g = g o f. 60

61 Consequently, the composition of functions is not, in general, a commutative operation. The definition and examples for composite functions (g o f) required that the codomain of f = domain of g. Also, for any f: A → B, we observed that f o 1 A = f = 1 B o f. 61

62 Theorem 5.5 Let f: A → B and g: B → C. a) If f, g are one-to-one, then g o f is one-to-one. b) If f, g are onto, then g o f is onto. 62

63 Proof: How to prove a function f is one-to-one? f(x 1 ) = f(x 2 ) → x 1 = x 2 a)To prove that g o f: A → C is one-to-one, let a 1, a 2 ∈ A with (g o f )(a1) = (g o f) (a 2 ). Then (g o f)(a 1 )=(g o f)(a 2 ) ⇒ g(f(a 1 )) = g(f(a 2 )) ⇒ f(a1) = f(a 2 ), because g is one-to-one. Also, f(a 1 ) = f(a 2 ) ⇒ a 1 = a 2, because f is one-to- one. Consequently, g o f is one-to-one.

64 b) For g o f: A → C, let z ∈ C. Since g is onto, there exists y ∈ B with g (y) = z. With f onto and y ∈ B, there exists x ∈ A with f (x) = y. Hence z = g (y) = g ( f (x)) = (g o f ) (x), so the range of g o f = C = the codomain of g o f, and g o f is onto. 64 x f(x)=yg(y)=z A BC f g

65

66

67 Question ?????

68 Theorem 5.6 (associative property) If f: A → B, g: B → C, and h: C → D, then (h o g) o f = h o (g o f ). Proof: Since the two functions have the same domain, A, and codomain, D, the result will follow by showing that for every x ∈ A, ((h o g) o f)(x) = (h o (g o f ))(x). (See the diagram shown in Fig 5.9). 68

69 Using the definition of the composite function, we find that ((h o g) o f) (x) = (h o g) (f (x)) = h ( g (f (x))), whereas (h o (g o f )) (x) = h ((g o f ) (x)) = h (g (f (x))). Since ((h o g) o f ) (x) = h (g ( f (x))) = (h o ( g o f )) (x), for each x in A, it now follows that (h o g) o f = h o (g o f). Consequently, the composition of functions is an associative operation. 69

70

71 Converse of relation Definition 5.20 For sets A, B, if R is a relation from A to B, then the converse of R, denoted R c, is the relation from B to A defined by R = {(b, a)|(a, b) ∈ R}. A = {1, 2, 3, 4}, B = {w, x, y}, and R = {(1, w), (2, w), (3, x)}, then R c = {(w, 1), (w, 2), (x, 3)}, a relation from B to A. 71

72 Since a function is a relation we can also form the converse of a function. For the same preceding sets A, B, let f: A → B where f = {(1, w), (2, x), (3, y), (4, x)}. Then f c = {(w, 1), (x, 2), (y, 3), (x, 4)}, a relation, but not a function, from B to A. What is a condition for converse of a function yields a function? (f must be invertible) 72

73 Example 5.57 For A = {1, 2, 3} and B = {w, x, y}, let f: A → B be given by f = {(1, w), (2, x), (3, y)}. Then f c = {(w, 1), (x, 2), (y, 3)} is a function from B to A, and we observe that f c o f = 1 A and f o f c = 1 B. f c o f(1) = f c (w) = 1 f c o f(2) = f c (x) = 2 f c o f(3) = f c (y) = 3 f c o f = {(1,1), (2,2), (3,3)} = 1 A 73

74 Invertibility Definition 5.21 If f: A → B, then f is said to be invertible if there is a function g: B → A such that g o f = 1 A and f o g = 1 B.

75 Example 5.58 Let f, g: R → R be defined by f (x) = 2x + 5, g (x) = (1/2)(x – 5). Then (g o f) (x) = g( f (x)) = g (2x + 5) = (1/2)[(2x + 5) – 5] = x, and (f o g )(x) = f(g (x)) = f((1/2)(x –5)) =2[(1/2)(x– 5)] + 5 = x, so f o g = 1 R and g o f = 1 R. Consequently, f and g are both invertible functions. 75

76 Question ?????

77 Inverse Function Theorem 5.7 If a function f: A → B is invertible and a function g: B→A satisfies g o f = 1 A and f o g = 1 B, then this function g is unique. We shall call the function g the inverse of f and denoted g = f –1. Theorem 5.7 also implies that f –1 = f c. 77

78 Theorem 5.8 A function f: A → B is invertible if and only if it is one-to- one and onto. Example 5.59 From Theorem 5.8 it follows that the function f 1 : R → R defined by f 1 (x) = x 2 is not invertible (it is neither one-to-one nor onto), but f 2 : [0, +∞) → [0, +∞) defined by f 2 (x) = x 2 is invertible with f 2 –1 (x) = √ x. 78

79 Theorem 5.9 If f: A → B, g: B → C are invertible functions, then g o f: A → C is invertible and (g o f ) –1 = f –1 o g –1. Example Let f:R→ R defined by f(x)=3x+5 f(x) = y, hence f -1 (y) = x 79 x y=f(x) f f -1

80 Inverse Function f(x) = y = 3x + 5 x = (y- 5)/3 f -1 (y) = x, hence f -1 (y) = (y-5)/3 Rename y by x, f -1 (x) = (x-5)/3

81 Activity 1. Let f : Z→Z be the successor function and let g : Z→Z be the squaring function. Then f(n) = n + 1 for all n ε Z and g(n) = n 2 for all n ε Z a. Find the compositions g o f and f o g. b. Is g o f = f o g? Explain 2. Let X = {a,b,c,d} and Y= {u,v,w}, and suppose f:X → Y is given by {(a,u),(b,v),(c,v),(d,u)}. Find f o 1 X and 1 Y o f 3. f: R → R is defined by f(x) = 4x – 1. Find its inverse function.

82

83 END THANK YOU Last updated 15/09/2009