6 Chapter 2 - lecture 3 Functions
6 Chapter 2 - lecture 3 Functions
Functions
( Quick revision )
Set:
• A set is an unordered collection of objects.
• The objects in a set are called the elements, or
members, of the set.
Example:
• A = { a, b, c, d}
• B = {1, 3, 5, 9}
2
( Quick revision )
Subset
• The set 𝐴 is said to be a subset of 𝐵 if and only if every
element of 𝐴 is also an element of 𝐵.
• We use the notation 𝐴⊆𝐵 to indicate that 𝐴 is a subset
of the se𝑡 𝐵.
Proper Subset:
• The set 𝐴 is a subset of the set 𝐵 but that 𝐴≠ 𝐵,
• We write 𝐴⊂𝐵
• and say that 𝐴 is a 𝐩𝐫𝐨𝐩𝐞𝐫 𝐬𝐮𝐛𝐬𝐞𝐭 of 𝐵.
3
( Quick revision )
Power Set:
• The set of all subsets.
• If the set is 𝑆. The power set of 𝑆 is denoted by 𝑃( 𝑆).
• The number of elements in the power set is
Example:
• 𝑆 = {1, 2, 3}
• 𝑃(𝑆) = {∅, {1}, {2} ,{3},{1, 2},{1, 3},{2, 3}, {1, 2, 3}}
4
( Quick revision )
Cartesian Products:
• Let 𝐴 and 𝐵 be sets.
• The Cartesian product of 𝐴 and 𝐵, denoted by 𝐴×𝐵, is
the set of all ordered pairs (𝑎, 𝑏),where 𝑎 ∈ 𝐴 and 𝑏
∈ 𝐵. Hence, 𝐴×𝐵= {(𝑎, 𝑏) | 𝑎 ∈ 𝐴 ∧ 𝑏 ∈ 𝐵}.
Example
• Let 𝐴 ={1, 2} ,and 𝐵 = {𝑎, 𝑏, 𝑐}
• 𝐴×𝐵= {(1, 𝑎),(1, 𝑏), (1, 𝑐), (2, 𝑎), (2, 𝑏), (2, 𝑐)}.
• =2∗3=6.
• B×A= {(a, 1),(a, 2), (b, 1), (b, 2), (c, 1), (c, 2)}. 5
Function
Let X and Y be nonempty sets. A function 𝑓 from X to Y is an
assignment of exactly one element of Y to each element of X.
• 𝑓() = y: if y is the unique element of Y assigned by the function 𝑓
to the element x of X.
• If 𝑓 is a function from X to Y, we write 𝑓: X→Y
Example:
6
Arrow Diagrams
Domain Co-domain
Pre-image image
7
Example:
( 3 is image of b)
8
One-to-One function (injective):
Example:
12
Example:
All values
13
One-to-one correspondence (bijection)
• The function f is a one-to-one correspondence, or a
bijection, if it is both one-to-one and onto.
injective surjective
Example All elements of the
co-domain are taken.
14
Example:
15
Example:
Example:
16
Examples:
√
All elements of B
are taken.
√
√
17
18
Example:
19
• Determine whether the function 𝑓(𝑥) = 𝑥 + 1 from
Example:
𝑎+1=𝑏+1
then).
𝑎=𝑏
f(x) is one to one:
∴𝑓(𝑥) is one−to−one
if
f(a) = value
f(b) = the same value
then
a=b
20
Example:
• Determine whether the function 𝑓(𝑥) = from the set of
integers to the set of integers is one-to-one.
Solution:
𝑓(𝑎) = and 𝑓(𝑏) =
𝑓(𝑥) is one−to−one (if 𝑓(𝑎) =𝑓(𝑏) and a equal b then).
=
±𝑎 = ±𝑏
𝑎 may be not equal 𝑏
𝑓(𝑥) is NOT one−to−one
21
Inverse Functions:
• Let f be a one-to-one correspondence ( bijection ) from
the set A to the set B. The inverse function of f is the
function that assigns to an element b belonging to B the
unique element a in A such that 𝑓(𝑎) = 𝑏. The inverse
function of f is denoted by . Hence, (𝑏) = 𝑎 when
𝑓(𝑎)=𝑏.
22
Invertible:
• A one-to-one correspondence is called invertible
because we can define an inverse of this function.
• A function is not invertible if it is not a one-to-one
correspondence, because the inverse of such a function
does not exist.
23
Example:
• Let f be the function from {𝑎, 𝑏, 𝑐} to {1, 2, 3}such that
𝑓(𝑎) = 2, 𝑓(𝑏) = 3, and 𝑓(𝑐) = 1.
1 - Is 𝑓 invertible ?
2 - and if it is, what is its inverse ?
Solution
The function 𝑓is invertible because it is a one-to-one
correspondence.
The inverse function reverses the correspondence given by 𝑓,
so
24
Composition of the Functions f and g
• Let g be a function from the set 𝐴 to the set 𝐵
and
• let f be a function from the set 𝐵 to the set 𝐶.
• The composition of the functions f and g, denoted by
𝑓∘g, is defined by (𝑓∘g)(𝑎)=𝑓(g(𝑎)).
Note : that the composition f ∘ g cannot be defined unless the
range of g is a subset of the domain of f .
Range of g
Co-domain of function g
and example
Domain of function f B ={ a , b , c } (domain)
F(d) undefined
26
Example:
• Let g be the function from the set {𝑎, 𝑏, 𝑐} to itself such
that g(a) = b, g(b) = c, and g(c) = a. Let f be the
function from the set {𝑎, 𝑏, 𝑐}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:
g f
a a 1
(f ∘ g)(a) = 2
b b 2
g(a) = b
f(g(a)) = f(b) = 2
c c 3
Solution:
28
Example:
• Let g be the function from the set {𝑎, 𝑏, 𝑐} to itself such
that g(a) = b, g(b) = c, and g(c) = a. Let f be the
function from the set {𝑎, 𝑏, 𝑐}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
a 1 a a
b 2 b b
c 3 c c
Solution:
30
Example:
Let f and g be the 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? What
is the composition of g and f ?
Solution:
1) The composition of f and g ( f ∘ g)
( f∘g )(x) = = 2(3𝑥 + 2) + 3= 6𝑥 + 7
2) The composition of g and f ( g ∘ f)
( g∘f )(x) = = 3(2𝑥+3) + 2 = 6𝑥 + 11
31