1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition)...

Post on 04-Jan-2016

216 views 1 download

Transcript of 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition)...

1

Discrete Structures – CNS 2300

Text

Discrete Mathematics and Its Applications (5th 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 BAf :

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.

1 2345

a

b

c

d

f

=f(2)

Domain Codomain

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.

1 2345

a

b

c

d

f

=f(2)

Domain Codomain

2 is the pre-image of b

b is the image of 2

6

Domain and Range

Domain Codomain

1234

12345678

f(x) = 2x

7

Domain and Range

Domain Codomain

1234

12345678

f(x) = 2x

Range

8

Let f1 and f2 be functions from A to R. Then f1+ f2 and f1 f2 are also functions from A to R defined by

(f1 + f2)(x) = f1 (x) + f2(x)

(f1 f2)(x) = f1 (x) f2(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

}|)({)( SssfSf

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) = x2 - 1

f(x) = x3

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. Similarly, f is called strictly decreasing 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.

Bb Aa

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) = x2 - 1

f(x) = x3

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) = x2 - 1

f(x) = x3

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

1

2

3

4

3

5

7

9

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) = x2 + 1

f(x) = x3

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 bygf

))(())(( agfagf

28

Composition of functions

2

f(x)=2x+1

5

g(x)=x2

25

g(f(x)) = g(2x+1) = (2x+1)2

29

Some Important Functions

Ceiling Function Floor Function

2y x 2 3y x

30

Problems from the text

Page 108-111

3, 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