Discrete Mathematics: Functions
Discrete Mathematics: Functions
Discrete Mathematics: Functions
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}
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:AB, and f(a)=b (where aA & bB), 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
Bijective
Illustration of function types
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?
Example:
End of SET
theory
Quiz exam