Вы находитесь на странице: 1из 16

Discrete

Mathematics

Functions
Definition of Function
 Given any sets A, B, a relation from A to B is a
function if every element of set A has one and
only one image in set B
 Every element of set A will have an image
 Every element of set A will only have one
image in set B
Example:
Let A = {a, b, c, d}
B = {Aman, Ankit, Baljinder,
Chandu, Eklavya}

Check if the following are functions ? NO

YES NO
Graphical Representations
 Functions can be represented
graphically in several ways:
f A B
• •
f • •
a• •
b • •
y



A x
B Graph Plot
Like Venn diagrams
Function Terminologies
 If f:AB, and f(a)=b (where aA & bB), then:
 A is the domain of f.
 B is the codomain of f.
 b is the image of a under f.
 a is a pre-image of b under f.

The relation S from the set D ={1,2,3,4} to the set C={a,b,c,d}, where
S= {(1,a), (2,c), (3,d), (4,b)}. Is S function? If so, determine the domain,
codomain, image , preimages.
- The domain of S = {1,2,3,4} = D
- The codomain of S = {a,b,c,d} = C
- a is the image of 1, c is the image of 2, d is the image of 3, b is the
image of 4
- 1 is the preimage of a, 2 is the preimage of c, 3 is the preimage of d,
4 is the preimage of b
Example:

 f(a) = Z , f(b) = Y
 the image of d is Z
 The image of b is Y A B
 the domain of f is A = {a, b, c, d} a
 the codomain is B = {X, Y, Z} X
b
 f(A) = {Y, Z} Y
c
 the preimage of Y is b Z
 the preimages of Z are a, c and d d
 f({c,d}) = {Z}
One-to-One Functions
 A function is one-to-one (1-1), or
injective, iff every element of the
codomain has at most one preimage

(1-1) NOT (1-1)


Onto (Surjective) Functions
 A function f:AB is onto or surjective iff,
every element of the codomain has at
least one preimage

ONTO NOT ONTO


Bijective Function
 A function f is bijection,, iff it is both
one-to-one and onto.
 In other words, every element of the
codomain has exactly one preimage

Bijective
Illustration of function types

 Some functions that are or are not onto


their codomains:

• • • • • • • •
• • • • • •
• •
• • • •
• • • •
• • • •
• • • •
• •
Onto Not Onto Both 1-1 1-1 but
(but not 1-1) (or 1-1) and onto not onto
Illustration of function types
Inverse Functions
Definition: Let f be a bijection from A to B. Then the
inverse of f, denoted , is the function from B to
A defined as
No inverse exists unless f is a bijection. Why?
Inverse Functions

A f
B A B
a V V
a

b b
W W
c c

d X X
d

Y Y
Question
Example 1: Let f be the function from {a,b,c}
to {1,2,3} such that f(a) = 2, f(b) = 3, and f(c) =
1. Is f invertible and if so what is its inverse?

Solution:. The inverse function f--1 reverses


the correspondence given by f, so f--1 (1) = c, f-
-1 (2) = a, and f--1 (3) = b.
Floor & Ceiling Functions
 The floor function, denoted

is the largest integer less than or equal to x.

 The ceiling function, denoted

is the smallest integer greater than or equal to x

Example:
End of SET
theory
Quiz exam

Вам также может понравиться