1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets, and Functions
2 Section 1.8 Functions
3 What is a Function? Let A and B be sets. A function from A to B is an assignment of exactly one element of B to each element of A. We write f(a) = b if b is the unique element of B assigned by the function f to the element a of A. If f is a function from A to B, we write
4 Domain and Codomain If f is a function from A to B, we say that A is the domain of f and B is the codomain of f abcdabcd f =f(2) DomainCodomain
5 Domain and Codomain If f is a function from A to B, we say that A is the domain of f and B is the codomain of f abcdabcd f =f(2) Domain Codomain 2 is the pre- image of b b is the image of 2
6 Domain and Range DomainCodomain f(x) = 2x
7 Domain and Range DomainCodomain f(x) = 2x Range
8 Let f 1 and f 2 be functions from A to R. Then f 1 + f 2 and f 1 f 2 are also functions from A to R defined by (f 1 + f 2 )(x) = f 1 (x) + f 2 (x) (f 1 f 2 )(x) = f 1 (x) f 2 (x)
9 Let f be a function from the set A to the set B and let S be a subset of A. The image of S is the subset of B that consists of the images of the elements of S. We denote the image of S by f(s), so that
10 One-to-one Functions A function f is said to be one-to-one, or injective, if and only if f(x) = f(y) implies that x = y for all x and y in the domain of f. A function is said to be an injection if it is one- to-one.
11 One-to-One Functions a b c x y z
12 NOT One-to-one functions a b c x y z
13 One-to-one functions???? f(x) = 3x+5 f(x) = x f(x) = x 3 f(x) = |x-1|
14 Strictly Increasing Functions A function f whose domain and codomain are subsets of the set of real numbers is called strictly increasing if f (a) f (b) whenever a<b and a and b are in the domain of f.
15 Strictly Increasing Function
16 Strictly Decreasing Function
17 Neither
18 Onto Functions A function f from A to B is called onto, or surjective, if and only if for every element there is an element with f(a)=b. A function f is called a surjection if it is onto.
19 Onto Function a b c x y z d Every element in the co- domain has something mapped to it.
20 NOT an Onto Function a b c x y z d There exists an element in the co- domain that does not have anything mapped to it.
21 Onto functions???? f(x) = 3x+5 f(x) = x f(x) = x 3 f(x) = |x-1|
22 One-to-One Correspondence The function f is a one-to-one correspondence, or a bijection, if it is both one-to-one and onto.
23 Bijections???? f(x) = 3x+5 f(x) = x f(x) = x 3 f(x) = |x-1|
24 Inverse Functions Let f be a one-to-one correspondence (bijection) from the set A to the set B. The inverse function of f is the function that assigns to an element b belonging to B the unique element a in A such that f(a) = b. The inverse function of f is denoted by f -1. Hence f -1 (b) = a when f(a) = b.
25 Inverse Functions f(x) = 2x+1 f(1) f(2) f(3) f(4) f -1 (3) f -1 (5) f -1 (7) f -1 (9)
26 Invertible Functions A one-to-one correspondence is called invertible since an inverse function can be defined for the function. f(x) = 2x + 1 f(x) = x f(x) = x 3
27 Composition of Functions Let g be a function from the set A to the set B and let f be a function from the set B to the set C. The composition of the functions f and g, denoted by is defined by
28 Composition of functions 2 f(x)=2x+1 5 g(x)=x 2 25 g(f(x)) = g(2x+1) = (2x+1) 2
29 Some Important Functions Ceiling Function Floor Function
30 Problems from the text Page , 5, 9, 15, 17, 23, 29, 35, 50, 53, 59 Homework will not be collected. However, you should do enough problems to feel comfortable with the concepts. For these sections the following problems are suggested.
31 finished