Discrete12 Functions
Discrete12 Functions
Functions
FUNCTION
• extremely important in mathematics and
computer science
c
A B
Domain Co-Domain
A function, f: A → B
Functions - image & preimage
Kathy
Michael
Toby Carol
John
Mary
Chris
Brad
B
A
FUNCTIONS
What are the domain, co-domain, and range of
the function that assigns grades to students?
• Non-technical examples:
• a social security number uniquely identifies
the person
• the income tax rate varies depending on
the income
• letter grade for a course is often
determined by exam scores
Functions
• Injective Function - One-to-One Functions
• Surjective Function - Onto Functions
• Bijective Function - Both One-to-One and Onto
Injective Function
Functions - Injection
Every b B has
An injection simply means
at most 1
that each element in the
preimage.
range has at most one
preimage (antecedent).
Not one-to-one
Michael Kathy
Toby Carol
John
Chris Mary
Brad
Surjective Function
Functions - Surjection
Every b B has • A surjection means that every
at least 1 element in the codomain is
preimage. mapped (i.e., it is an image, has
an antecedent).
Not onto
Michael Kathy
Toby Carol
John
Chris Mary
Brad
Bijective Function
Functions: Example1
A B
a1 b1
a2 b2
a3 b3
a4 b4
• Is this function
▫ One-to-one (injective)? Why?
▫ Onto (surjective)? Why?
Functions: Example2
A B
a1 b1
a2 b2
a3 b3
b4
• Is this function
▫ One-to-one (injective)? Why?
▫ Onto (surjective)? Why?
Functions: Example3
A B
a1 b1
a2 b2
a3 b3
a4
• Is this function
▫ One-to-one (injective)? Why?
▫ Onto (surjective)? Why?
Functions: Example4
• Let A = {1, 2, 3} and B = {a, b, c}
• Is f a bijection? Why?
f:A→B
A B
1 a
2 b
3 c
END