Functions
Functions
Mathematics
Functions
Outline
Injection,
Definition of
Surjection,
a Function
Bijection
Inverse Function
Function Composition
Functions
A special type of a relation
Sometimes called mappings or
transformations
A function represented as
f : A → B such that
✓ the domain of f is A for all a ∈ A
Dom(f),
✓ f(a) contains just one element of B
Functions
A good example that you can “relate” to is
students in our Math class this semester are set
A. The grade they earn out of the class is set B.
Each student must be assigned a grade and can
only be assigned ONE grade, but more than one
student can
Students Grades
1.00
Marian Rivera
1.50
Kim Chui 1.75
5.00
Sarah Geronimo
Functions
Example :
Given A = {1,2,3,4,5} B = { 2,4,6,8,10} and
f = {(1,4) (4,8), (2,2), (5,6),(3,10)}. Identify if f is a
function.
f(1) = 4 f(5) = 6
f(4) = 8 f(3) = 10
f(2) = 2
Dom(f) = {1,4,2,5,3} = A
f(n) contains just one element of B
therefore : f is function
A function f from set A to set B is a rule of
correspondence that assigns to each element x in the
set A exactly
exactly one
one element
element yy in
in the
the set
set B.
B.
1 2
2 4
3 6
4 8
5 10
Conditions
Whew!are met…
What
This
did isthat
a function
say? Must use all the x’s
The x value can only be assigned to one y
Let’s look at another relation and decide if it is a
function.
The second condition says each x can have only one y, but it
CAN be the same y as another x gets assigned to.
1
2
2
4
3
6
4 8
5 10
1
2
2
4
3
6
4 8
5 10
1
2
2
4
3
6
4 8
5 10
1
2
2
4
3
6
4 8
5 10
This is a function
Must use all the x’s
The image of d is ? z A B
a
The domain of f is ? A x
b
The codomain of f is ? B y
c
The preimage of y is ? b
d z
f(A) = ? B
If f: A → B and S is a subset of A,
then
f(S) = { f(s) | s S}
A B
a
f {a,b,c,} is ? {y,z} x
b
f {c,d} is ? {z} y
c
d z
Representing Functions
Answer:
F1 = {(a,0),(b,0),(c,0)} F5 = {(a,1),(b,0),(c,0)}
F2 = {(a,0),(b,0),(c,1)} F6 = {(a,1),(b,0),(c,1)}
F3 = {(a,0),(b,1),(c,0)} F7 = {(a,1),(b,1),(c,0)}
F4 = {(a,0),(b,1),(c,1)} F8 = {(a,1),(b,1),(c,1)}
Special Types of
Function
Special Type of Functions:
Injections
Definition: A function f is said to be one-to-one , or
injective, if and only if f(a) = f(b) implies that a = b
for all a and b in the domain of f. A function is said to
be an injection if it is one-to-one.
Injective means we won't have two or more "A"s
pointing to the same "B".
A B
a x
v
b
y
c
z
d
w
Surjections
Definition: A function f from A to B is called onto or
surjective, if and only if for every element a A
there is an element b B with f(a) = b . A function
f is called a surjection if it is onto.
There won't be a "B" left out.
A B
a x
b
y
c
z
d
Surjections
Definition: A function f from A to B is called onto or
surjective, if and only if for every element a A
there is an element b B with f(a) = b . A function
f is called a surjection if it is onto.
There won't be a "B" left out.
A B
a x
b
y
c
z
d
Bijections
Definition: A function f is a one-to-
one correspondence, or a bijection,
if it is both one-to-one and onto
(surjective and injective).
Think of it as a "perfect pairing"
between the sets: everyone has a
partner, and no one is left out.
A B
a x
b
y
c
d z
w
Summary
Surjective Bijective
(not injective ) (injective, surjective )
Every B has some A A to B, perfectly
Showing that f is one-to-one
or onto
Example 1: Let f be the function from {a,b,c,d} to {1,2,3}
defined by f(a) = 3, f(b) = 2, f(c) = 1, and f(d) = 3. Is f
an onto or surjective function?
A f B A B
a V
a V
b b
W W
c c
d X d X
Y Y
Questions
Example:
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?
Answer:
The function f is invertible because it is a one-to-one
correspondence. The inverse function f-1 reverses
the correspondence given by f, so
f-1 (1) = c
f-1 (2) = a
f-1 (3) = b.
Exercise
Let f be a function from A = {1, 2, 3, 4} to B = {a, b, c, d}.
Determine whether f-1 is a function.
g f
A B C
a V
h
b i
W
c
d X j A C
Y a
h
b
i
c
d j
Composition
Example 1:
If f(x) = x2 and g(x) = 2x + 1, then
f(g(x)) = (2x + 1)2 and g(f(x)) = 2x2 + 1
f ○ g (x) = f(g(x))
= f(2x + 1)
= (2x + 1)2
g ○ f (x) = g(f(x))
= g(x2)
= 2x2 + 1
Composition Questions
Example 2:
Let g be the function from the set {a,b,c} to itself such that
g(a) = b, g(b) = c, and g(c) = a. Let f be the function from the
set {a,b,c} to the set {1,2,3} such that f(a) = 3, f(b) = 2, and
f(c) = 1.
What is the composition of f and g, and what is the composition
of g and f.
Solution:
f∘ g (x)= f(g(x)) g∘ f (x)= g(f(x))
= f(3x + 2) = g(2x + 3)
= 2(3x + 2) + 3 = 3(2x + 3) + 2
= 6x + 4 + 3 = 6x + 9 + 2
= 6x + 7 = 6x + 11
Composition Questions
Example 2:
Let f and g be functions from the set of integers to the set
of integers defined by f(x) = 2x + 3 and g(x) = 3x + 2.
What is the composition of f and g, and the composition of
g and f ?
Solution:
f∘ g (x)= f(g(x)) g∘ f (x)= g(f(x))
= f(3x + 2) = g(2x + 3)
= 2(3x + 2) + 3 = 3(2x + 3) + 2
= 6x + 4 + 3 = 6x + 9 + 2
= 6x + 7 = 6x + 11
Composition Questions
Additional Exercise:
1. Functions f and g are sets of ordered pairs f = {(-2,1),
(0,3),(4,5)} and g = {(1,1), (3,3), (7,9)} Find the composite
function defined by g ○ f and describe its domain and range.
a) (f o g)(5)
b) ( f o g)(x)
c) (g ○ f) (2)
d) (f o f ) (x)
a) (g ∘ f)( x)
b) (g o g) (x)