Functions Section 2.3: MTK3013 Discrete Structures
Functions Section 2.3: MTK3013 Discrete Structures
Functions Section 2.3: MTK3013 Discrete Structures
my
FUNCTIONS
Section 2.3
MTK3013
DISCRETE STRUCTURES
http://fskik.upsi.edu.my
Recap 2.1
Recap 2.2
Definitions
Definitions
Example
• Suppose that each student in a class is assigned a letter
grade from the set {A,B,C,D,F}. Let g be the function
that assigns a grade to a student.
Chavez • •A
Stokes • •B Domain
Dees • •C
Dozier • •D Codomain
Holland • •F
Range
http://fskik.upsi.edu.my
Example
One-to-One Functions
(injective)
• No value in the range is used by more than one value
in the domain.
• If f(x)=f(y), then x=y for all x and y in the domain of
•1
f. a • •2
b • •3
c • •4
One-to-One Functions
Onto Functions
(surjective)
• For every value in the codomain, there is a
value in the domain that is mapped to it.
• •1
a • •2
b • •3
c •
d
Onto Functions
• Is the function f(x) = x2 from the set of integers to
the set of integers onto?
– y x (x2=y)??
– There does not exists a x such that x2 = -1, for example.
-1 is one of the possible values of y.
– NO
One-to-One Correspondence
(bijection)
• If a function f is both one-to-one and onto,
then it is a one-to-one correspondence.
a • •1
•1 •1
a • a b • •2
•2 •2
b • b • c • •3
•3 •3
c • c • d • •4
•4
d •
•
One-to-One
Onto, but One-to-One Correspondence
But not onto
Not one-one
http://fskik.upsi.edu.my
Monotonic Functions
• A monotonic function is
– either monotonically (strictly) increasing
– or monotonically (strictly) decreasing
• Consider a function f : R R
• f is monotonically increasing
– if f(x) <= f(y) whenever x < y
• f is monotonically decreasing
– if f(x) >= f(y) whenever x < y
http://fskik.upsi.edu.my
Inverse Functions
a f 1(b) b f(a)
A f B
http://fskik.upsi.edu.my
F needs to be bijection
Inverse Functions
• Is f invertible? Is f a bijection?
Is f one-to-one? YES
Is f onto? YES
So f is a one-to-one correspondence
and is therefore invertible.
• Then, what is its inverse? f(y)=y-1
http://fskik.upsi.edu.my
Inverse Functions
• Is f invertible?
Is f one-to-one? NO
So f is not a one-to-one correspondence.
f is not invertible.
http://fskik.upsi.edu.my
Compositions of Functions
• Let g : A B and f : B C.
• The composition of the functions f and g,
denoted by f g, is defined by:
f g(a) = f (g(a))
• f g can’t be defined unless the range of g is
a subset of the domain of f.
http://fskik.upsi.edu.my
Example
• Let,
f(x) = 2x + 3
g(x) = 3x + 2
• Find f g(x).
• Find g f(x).
http://fskik.upsi.edu.my
Composition of Inverses
• f(a)=b
• f-1(b)=a
• f-1 f (a) =?
• f f-1 (b)=?
http://fskik.upsi.edu.my
floor
http://mathworld.wolfram.com/FloorFunction.html
http://fskik.upsi.edu.my
Ceiling
http://mathworld.wolfram.com/CeilingFunction.html