DM 5 Functions
DM 5 Functions
DM 5 Functions
Functions
Course Code: CSC 1204 Course Title: Discrete Mathematics
Lecture Outline
2.3 Functions
• Definition of Function
• Domain, Codomain, Range, Image, Preimage,
• One-to-one function
• Onto function
• One-to-one correspondence
• Inverse Functions
• Compositions of Functions
• Floor function
• Ceiling Function
3
Functions
Functions
Functions
Example 1
• What are the domain, codomain, and range of the function that assigns
grades to students of Discrete Math class as follows?
co
do
m a in
ain
m
do
range
13
Solution of Example 1
Solution:
• Let G be the function that assigns grade to a student of
Discrete Mathematics class.
• The domain of G is the set { Adams, Chou, Goodfriend,
Rodriguez, Stevens}
• The codomain of G is the set { A, B, C, D, F}
• The range of G is the set { A, B, C, F}
• Because each grade except D is assigned to some student
14
Example 2
• Let R be the relation consisting of ordered pairs (Alex, 22), (Brenda,24),
(Carla,21), (Desire,22), (Eddie,24), and (Felicia,22), where each pair consists of
a graduate student and the age of this student. What is the function that this
relation determines?
• Solution: This relation defines the function f, where with f(Abdul)= 22,
f(Brenda)=24, f(Carla)=21, f(Desire)=22, f(Eddie)= 24, and f(Felicia)=22.
• Here, domain is the set { Abdul, Brenda, Carla, Desire, Eddie, Felicia }
• To define the function f, we need to specify a codomain. Here, we can take the
codomain to be the set of positive integers
• Range is the set {21,22,24}
15
Functions
Example 6
(f1f2)(x) = x2(x x2 ) = x3 – x4
17
Functions
• Definition 4: Let f be a function from the set A to the set
B, and let S is a subset of A. The image of S under the
function f is the subset of B that consists of the images
of the elements of S.
• We denote the image of S by f(S).
f(S) = {t|sS(t=f(s))}
18
Example 7
• Let A = {a, b, c, d, e} and B = {1, 2, 3, 4} with f(a) = 2,
f(b) = 1, f(c) = 4, f(d) = 1, f(e) = 1.
What is the image of the subset S = {b, c, d}?
• Solution:
• The image of the subset S = {b, c, d} is the set
f(S) = {1, 4}
19
One-to-One Functions
Example 8
Example 9
Example 9: Determine whether the function f(x) = x2 from
the set of integers to the set of integers is one-to-one.
Class Work
Example 10
Onto Function
Example 11
Example 12
Class Work
One-to-one correspondence
(bijection )
• Definition 8: A function f is a one-to-one correspondence or a
bijection if it is both one-to-one and onto.