Download presentation
Presentation is loading. Please wait.
Published byGerard Anthony Modified over 9 years ago
1
Discrete Maths Objectives to show the connection between relations and functions, and to introduce some functions with useful, special properties 242-213, Semester 2, 2014-2015 6. Functions 1
2
1. What is a Function? A function is a special kind or relation between two sets: f : A B 2 A f B domaincodomain All the elements in A have a single link to a value in B All the elements in A have a single link to a value in B Some elements in B may not be used. Some may be used more than once. Some elements in B may not be used. Some may be used more than once. read this as f maps A to B; it is NOT if-then read this as f maps A to B; it is NOT if-then
3
Example The function f: P C with P = {Linda, Max, Kathy, Peter} C = {Hat Yai, NY, Hong Kong, Bangkok} Usual function notation: f(Linda) = Hat Yai f(Max) = Hat Yai f(Kathy) = Hong Kong f(Peter) = Bangkok 3 Linda Max Kathy Peter Bangkok Hong Kong NY Hat Yai P C f
4
The range is the set of elements in B used by the function f. 4 the range Range A f B
5
2. Functions with Special Properties Function Image One-to-one Function (injective) Onto Function (surjective) One-to-one Correspondence (bijective) Identity Function Inverse Function 5
6
2.1. Function Image, f(S) 6 A f B For some subset of A (e.g. S), the set of f() values in B are its Function Image f(S). For some subset of A (e.g. S), the set of f() values in B are its Function Image f(S). S A f(S)
7
2.2. One-to-one Function 7 also called injective also called injective A f B Each value in A maps to one value in B. Don’t need to use all the B values.
8
Examples 8 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 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
9
2.3. Onto Function 9 also called surjective also called surjective A f B Every element in B is linked to from A. Some elements in B may be used more than once.
10
2.4. One-to-one Correspondence 10 also called bijective also called bijective A f B Each value in A maps to one value in B and every element in B is linked to from A. Each value in A maps to one value in B and every element in B is linked to from A. bijective == injective + surjective
11
Is f injective? No Is f surjective? No Is f bijective? No. 11 Example 1 Linda Max Kathy Peter Boston New York Hong Kong Moscow f injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B
12
Is f injective? No Is f surjective? Yes Is f bijective? No 12 Example 2 Linda Max Kathy Peter Boston New York Hong Kong Moscow f Paul injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B
13
Is f injective? Yes Is f surjective? No Is f bijective? No 13 Example 3 injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B Linda Max Kathy Peter Boston New York Hong Kong Moscow f Lubeck
14
Is f injective? No! f is not even a function 14 Example 4 injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B Linda Max Kathy Peter Boston New York Hong Kong Moscow f Lubeck
15
Is f injective? Yes Is f surjective? Yes Is f bijective? Yes 15 Example 5 injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B Linda Max Kathy Peter Boston New York Hong Kong Moscow f Lubeck bijective == injective + surjective Paul
16
2.5. Identity Function f : X X is called the identity function (I x ) if every element in X is mapped to the same element e.g. 16 1 2 3 4 : Z+ 1 2 3 4 : f(x) = x * 1 f
17
2.6. Inverse Function 17 Linda Max Kathy Peter Boston New York Hong Kong Moscow f Lubeck Paul Linda Max Kathy Peter Boston New York Hong Kong Moscow f -1 Lubeck Paul example 5 If f is bijective then we can create an inverse function, f -1 if f(x) = y then f -1 (y) = x
18
18 f(Linda) = Moscow f(Max) = Boston f(Kathy) = Hong Kong f(Peter) = Lübeck f(Paul) = New York f -1 (Moscow) = Linda f -1 (Boston) = Max f -1 (Hong Kong) = Kathy f -1 (Lübeck) = Peter f -1 (New York) = Paul Inversion is only possible for bijective functions.
19
3. Composition of Functions if g: X Y and f: Y Z then f g: X Z read as “first do g then do f” The composition of f and g is defined as: (f g)(x) = f( g(x) ) this is why f and g are ordered this way 19
20
Diagram f g is only possible if the range of g is a subset of the domain of f 20 X Y Z g f f g f’s domain g’s range
21
Example f(x) = 7 x – 4, g(x) = 3 x (f g)(5) = f( g(5) ) = f(15) = 105 – 4 = 101 In general: (f g)(x) = f( g(x) ) = f(3 x) = 21 x - 4 21
22
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 22
23
4. More Information Discrete Mathematics and its Applications Kenneth H. Rosen McGraw Hill, 2007, 7th edition chapter 2, section 2.3 23
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.