Docsity

Functions and Their Properties, Slides of Discrete Mathematics

Partial preview of the text

Download Functions and Their Properties and more Slides Discrete Mathematics in PDF only on Docsity!

1

Functions

2

Definition of a function

• A function takes an element from a set and

maps it to a UNIQUE element in another set

4

More functions

“a” “bb“ “cccc” “dd” “e”

A string length function

A

B

C

D

F

Alice Bob Chris Dave Emma

A class grade function

Domain Co-domain

A pre-image of 1

The image of A

5

Even more functions

“a” “bb“ “cccc” “dd” “e”

Not a valid function! Also not a valid function!

a e i o u

Some function…

Range

7

One-to-one functions

a e i o

A one-to-one function

a e i o

A function that is not one-to-one

• A function is one-to-one if each element in the

co-domain has a unique pre-image

  • Meaning no 2 values map to the same result

8

More on one-to-one

• Injective is synonymous with one-to-one

  • “A function is injective”

• A function is an injection if it is one-to-one

• Note that there can

be un-used elements

in the co-domain

a e i o

A one-to-one function

10

a e i o u

An onto function

More on onto

• Surjective is synonymous with onto

  • “A function is surjective”

• A function is an surjection if it is onto

• Note that there can

be multiply used

elements in the

co-domain

11

Onto vs. one-to-one

• Are the following functions onto, one-to-one,

both, or neither?

a b c 1 2 3

a b c d

a b c d 1 2 3 4

a b c d

a b c

1-to-1, not onto

Onto, not 1-to-

Both 1-to-1 and onto Not a valid function

Neither 1-to-1 nor onto

13

Identity functions

• A function such that the image and the pre-

image are ALWAYS equal

• f(x) = 1*x

• f(x) = x + 0

• The domain and the co-domain must be the

same set

14

Inverse functions

R f R

Let f(x) = 2*x

f -

f(4.3)

f -1^ (8.6)

Then f -1^ (x) = x/

16

Compositions of functions

• Let (f ○ g)(x) = f(g(x))

• Let f(x) = 2x+3 Let g(x) = 3x+

• g(1) = 5, f(5) = 13

• Thus, (f ○ g)(1) = f(g(1)) = 13

17

Compositions of functions

g f

f ○ g

g(a) (^) f(a)

(f ○ g)(a)

g(a)

a f(g(a))

A B C

19

Compositions of functions

Does f(g(x)) = g(f(x))?

Let f(x) = 2x+3 Let g(x) = 3x+

f(g(x)) = 2(3x+2)+3 = 6x+

g(f(x)) = 3(2x+3)+2 = 6x+

Function composition is not commutative!

Not equal!

20

Graphs of functions

Let f(x)=2x+

Plot (x, f(x))

This is a plot

of f(x)

x=

f(x)=

x=

f(x)=