w06 Cits2211lectures Functions
w06 Cits2211lectures Functions
w06 Cits2211lectures Functions
September 1, 2017
Functions
Highlights
Reading
Section 4.3
of
Mathematics for Computer Scientists
Functions
Why
What is a function?
Weve all heard the word function, but what does it actually
mean?
Functions
What is a function?
Weve all heard the word function, but what does it actually
mean?
Is a function just something given by a formula like f (x) = x 2
or f (x) = sin x?
Is a function like a machine that transforms an input to an
output?
Function
Reconciliation
5 5
4 4
3 3
2 2
1 1
Functions
Let A, B be two sets. A function f : A B with domain A and
codomain B can be viewed in two different ways
A special kind of relation with the property that every element
of A appears in exactly one pair, or
A rule or mapping that associates exactly one element of
B with every element of A.
A B
Functions
Functions
Let A, B be two sets. A function f : A B with domain A and
codomain B can be viewed in two different ways
A special kind of relation with the property that every element
of A appears in exactly one pair, or
A rule or mapping that associates exactly one element of
B with every element of A.
f (a)
a
A B
Functions
Functions
Let A, B be two sets. A function f : A B with domain A and
codomain B can be viewed in two different ways
A special kind of relation with the property that every element
of A appears in exactly one pair, or
A rule or mapping that associates exactly one element of
B with every element of A.
f (a)
a
A B
Functions
Injection
Definition
A function is called injective (or an injection) or simply one-to-one
if no two elements of A map to the same element of B.
A B A B Is
Not injective injective
Functions
Injection
Definition
A function is called injective (or an injection) or simply one-to-one
if no two elements of A map to the same element of B.
A B A B Is
Not injective injective
Formal proposition that expresses f : A B being an injection:
x, y A. f (x) = f (y ) x = y
Functions
Surjection
Definition
A function is called surjective (or a surjection) or simply onto if
every element of B is the image of some element of A.
A B A B Is
Not surjective surjective
Functions
Surjection
Definition
A function is called surjective (or a surjection) or simply onto if
every element of B is the image of some element of A.
A B A B Is
Not surjective surjective
Formal proposition that expresses f : A B being a surjection:
b B. a A. f (a) = b
Functions
Bijections
Definition
A function is called bijective (or a bijection) or simply one-to-one
and onto if it is both injective and surjective.
A B