1 discrete structures – cns 2300 text discrete mathematics and its applications (5 th edition)...

31
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

Upload: jemimah-poole

Post on 04-Jan-2016

223 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

1

Discrete Structures – CNS 2300

Text

Discrete Mathematics and Its Applications (5th Edition)

Kenneth H. Rosen

Chapter 1

The Foundations: Logic, Sets, and Functions

Page 2: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

2

Section 1.8

Functions

Page 3: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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 :

Page 4: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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

Page 5: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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

Page 6: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

6

Domain and Range

Domain Codomain

1234

12345678

f(x) = 2x

Page 7: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

7

Domain and Range

Domain Codomain

1234

12345678

f(x) = 2x

Range

Page 8: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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)

Page 9: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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

Page 10: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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.

Page 11: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

11

One-to-One Functions

a

b

c

x

y

z

Page 12: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

12

NOT One-to-one functions

a

b

c

x

y

z

Page 13: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

13

One-to-one functions????

f(x) = 3x+5

f(x) = x2 - 1

f(x) = x3

f(x) = |x-1|

Page 14: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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.

Page 15: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

15

Strictly Increasing Function

Page 16: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

16

Strictly Decreasing Function

Page 17: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

17

Neither

Page 18: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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

Page 19: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

19

Onto Function

a

b

c

x

y

z

d

Every element in the co-domain has something mapped to it.

Page 20: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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.

Page 21: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

21

Onto functions????

f(x) = 3x+5

f(x) = x2 - 1

f(x) = x3

f(x) = |x-1|

Page 22: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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.

Page 23: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

23

Bijections????

f(x) = 3x+5

f(x) = x2 - 1

f(x) = x3

f(x) = |x-1|

Page 24: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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.

Page 25: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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)

Page 26: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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

Page 27: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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

Page 28: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

28

Composition of functions

2

f(x)=2x+1

5

g(x)=x2

25

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

Page 29: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

29

Some Important Functions

Ceiling Function Floor Function

2y x 2 3y x

Page 30: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

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.

Page 31: 1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,

31

finished