420 likes | 670 Views
Discrete Maths. 242-213 , Semester 2, 2013 - 2014. Objective to introduce functions. 6. Functions. Overview. What is a Function ? Common Mappings Composition of Functions More Information. 1. What is a Function?.
E N D
Discrete Maths 242-213, Semester 2,2013-2014 • Objective • to introduce functions 6. Functions
Overview • What is a Function? • Common Mappings • Composition of Functions • More Information
1. What is a Function? • Let A and B be sets. A functionffrom Ato B is a relation from A to B with the property that, for each element , there is exactly one element such that afb: • Since any relation from A to B is a subset of AxB, a function is a subset S of AxB such that for each there is a unique with
Functions are also called mappings or transformations. We say that fmapsA to B f B A
Example • The function f: PC with P = {Linda, Max, Kathy, Peter} C = {Boston, New York, Hong Kong, Moscow} f(Linda) = Moscow f(Max) = Boston f(Kathy) = Hong Kong f(Peter) = New York
Linda Boston Max New York Kathy Hong Kong Peter Moscow Other Ways to Represent f
1.1. Domain and Codomain • If f is a function from A to B then the sets A and B are called the domain and codomain of the function.
1.2. Range • If f is a function from X to Y and is a subset of the codomain such that contains all the elements from Y that are paired with elements of the domain X is the range of the function.
f : A→B, A is the domain, B is the codomain, C is the range f C is the range B A
1.3. Not a Function • This relation is not a function because there is an element in A which is not mapped to some element in B B A
2. Common Mappings • Function Image • One-to-one Function (injective) • Onto Function (surjective) • One-to-one Correspondence (bijective) • Examples • Identity Function • Inverse Function
2.1. Function Image • Let f be a function from the set A to the set Band • The image of S under the function f is the subset of B that consists of the mappings of the S elements
Function Image F(S) is the image of S f B A
2.2. One-to-one Function • If f is a function from A to B and no two distinct elements of the domain are assigned the same element in the codomain, then the function is called one-to-one (or injective). • To show that a function f is one-to-one, it is necessary to show that a1a2f(a1) = f(a2) a1= a2
One-to-one Function f B A
Examples g(Linda) = Moscow g(Max) = Boston g(Kathy) = Hong Kong g(Peter) = New York Is g one-to-one? Yes, each element is assigned a unique element of the image f(Linda) = Moscow f(Max) = Boston f(Kathy) = Hong Kong f(Peter) = Boston • Is f one-to-one? • No, Max and Peter are mapped onto the same element of the image
Proving one-to-one • How can we prove that a function f is one-to-one? • Take a look at its definition: x, yA (f(x) = f(y) x = y) • Example: f:RR f(x) = x2 • Disproof by counter-example: f(3) = f(-3), but 3 -3, so f is not one-to-one.
Another Example f:RR f(x) = 3x • One-to-one: x, yA (f(x) = f(y) x = y) • To show: f(x) f(y) whenever x y x y • 3x 3y • f(x) f(y), so if x y, then f(x) f(y), that is, f is one-to-one.
Strictly Increasing/Decreasing • A function f:AB with A,B R is called strictlyincreasing, if x,yA (x < y f(x) < f(y)) and strictly decreasing, if x,yA (x < y f(x) > f(y)) • A function that is either strictly increasing or strictly decreasing is one-to-one.
2.3. Onto Function • If the range and codomain of a function are equal, the function is called onto (or surjective) • To show that a function f is onto, it is necessary to show that
Onto Function f X Y
2.4. One-to-one Correspondence • A function, which is both one-to-one and onto is called a one-to-one correspondence (or bijective). • To show that a function f is a one-to-one correspondence, it is necessary to show that thus, for each there is exactly one such that means “there exists exactly one”
2.5. Examples • In the following examples, we use the arrow representation to illustrate functions f: AB • In each example, the complete sets A and B are shown.
Linda Boston Max New York Kathy Hong Kong Peter Moscow f • Is f injective? No • Is f surjective? No • Is f bijective? No.
Linda Boston Max New York Kathy Hong Kong Peter Moscow f • Is f injective? No • Is f surjective? Yes • Is f bijective? No Paul
Linda Boston Max New York Kathy Hong Kong Peter Moscow Lübeck f • Is f injective? Yes • Is f surjective? No • Is f bijective? No
Boston Linda Max New York Kathy Hong Kong Peter Moscow Lübeck f • Is f injective? No! f is not evena function!
Linda Boston f • Is f injective? Yes • Is f surjective? Yes • Is f bijective? Yes Max New York Kathy Hong Kong Peter Moscow Helena Lübeck
2.6. Identity Function • For any set X, the function is a one-to-one correspondence. It is called the identity function on X.
2.7. Inverse Function • If be a one-to-one correspondence, then for each there is exactly one such that • Hence we may define a function with domain Y and codomainX by associating to each the unique such that . • This function is denoted by and is called the inverse of function f.
Inverse Function f -1 f X Y
f f-1 Example Linda Boston Max New York Kathy Hong Kong Peter Moscow Helena Lübeck
Example The inverse function f-1 is given by: f-1(Moscow) = Linda f-1(Boston) = Max f-1(Hong Kong) = Kathy f-1(Lübeck) = Peter f-1(New York) = Helena Inversion is only possible for bijections (= invertible funcs) f(Linda) = Moscow f(Max) = Boston f(Kathy) = Hong Kong f(Peter) = Lübeck f(Helena) = New York Clearly, f is bijective.
f f-1 Example 2 Linda Boston Max New York • f-1: CP is not a function, because it is not defined for all elements of C and assigns two images to New York. Kathy Hong Kong Peter Moscow Helena Lübeck
Inverse Function Theorem • Theorem. Let be a one-to-one correspondence. Then: is one-to-one correspondence • The inverse function of is f. that is
3. Composition of Functions • Let g be a function from X to Y and f be a function from Y to Z. Then it is possible to combine these two functions in a function f○g from X to Z. • The function f○g is called the composition of f and g and is defined by taking the image of x under f○g to be f(g(x)):
Composition of Functions • Composition f○gcannot be defined unlessthe range of g is a subset of the domain of f Z X Y
Example f(x) = 7x – 4, g(x) = 3x f:RR, g:RR • (f ○ g)(5) = f(g(5)) = f(15) = 105 – 4 = 101 • (f ○ g)(x) = f(g(x)) = f(3x) = 21x - 4
Composition and Inverse (f-1○ f)(x) = f-1(f(x)) = x • The composition of a function and its inverse is the identity function i(x) = x.
4. More Information • Discrete Mathematics and its ApplicationsKenneth H. RosenMcGraw Hill, 2007, 7th edition • chapter 2, section 2.3