Wk6 Chapter 4 Mathematical Data Types (Part 2_Function) (1)
Wk6 Chapter 4 Mathematical Data Types (Part 2_Function) (1)
▪ Surjective (onto)
➢𝑓: 𝐴 → 𝐵 maps 𝐴 to 𝐵
Example
➢Let 𝑅 be the relation with ordered pairs (Abdul, 22), (Brenda, 24), (Carla, 21), (Eddie,
24), and (Felicia, 22). Here each pair consists of a graduate student and this student’s
age. Specify a function determined by this relation.
Solution:
➢If 𝑓 is a function specified by 𝑅, then 𝑓 (Abdul ) = 22, 𝑓 (Brenda) = 24, 𝑓 (Carla) = 21,
𝑓 (Eddie) = 24, and 𝑓 (Felicia) = 22. [Here, 𝑓 (𝑥) is the age of 𝑥, where 𝑥 is a student.]
➢Domain : {Abdul, Brenda, Carla, Eddie, Felicia}.
➢Codomain contain all possible ages of students.
➢The range of the function we have specified is the set of different ages of these
students, which is the set {21, 22, 24}.
Other Ways to Represent 𝒇
x f(x)
Abdul
Abdul 22
21
Brenda
Brenda 24
Carla 22
Carla 21
Eddie 24
Eddie 24
Felicia
Felicia 22
Formula
➢The formula is used for the situations where the domain of a function is
large
➢E.g. : Let 𝑓 ∶ ℝ → ℝ, 𝑓 𝑥 = 2𝑥. Then,
▪𝑓 1 =2
▪𝑓 3 =6
▪ 𝑓 −3 = −6
▪…
➢ Domain?
➢ Codomain?
➢ Range?
Operations on Functions
➢Let 𝑓1 and 𝑓2 be functions from A to ℝ. Then, 𝑓1 +𝑓2 and 𝑓1 𝑓2 are also
functions from A to ℝ defined for all 𝑥 ∈ 𝐴
➢ Sum of 𝑓1 and 𝑓2 :
✓ 𝑓1 +𝑓2 𝑥 = 𝑓1 𝑥 +𝑓2 (𝑥)
➢Product of 𝑓1 and 𝑓2 :
✓(𝑓1 𝑓2 ) = 𝑓1 𝑥 𝑓2 (𝑥)
➢Onto (surjective)
▪Inversion
One-to-One (injective)
➢A function 𝑓: 𝐴 → 𝐵 is said to be one-to-one (or injective), if
and only if
∀𝑏 ∈ 𝐵, ∃𝑎 ∈ 𝐴, 𝑓(𝑎) = 𝑏
𝑎
1
𝑏
𝑐 2
𝑑 3
Onto (Surjective)
- Example
➢Let 𝑓 be the function from {𝑎, 𝑏, 𝑐, 𝑑} to {1, 2, 3} defined by
➢Note that if the codomain were {1, 2, 3, 4}, then 𝑓 would not be onto.
One-to-one correspondence
(bijective)
➢A function 𝑓: 𝐴 → 𝐵 is a one-to-one correspondence, or a bijection, if and only if
it is both one-to-one and onto
➢If 𝑓 is a bijection and 𝐴 and 𝐵 are finite sets, then |𝐴| = |𝐵|
➢Example : Let 𝑓 be the function from {𝑎, 𝑏, 𝑐, 𝑑} to {1, 2, 3, 4} with 𝑓(𝑎) = 4, 𝑓(𝑏) =
2, 𝑓(𝑐) = 1, and 𝑓 (𝑑) = 3. Is 𝑓 a bijection?
➢The function f is one-to-one and onto. It is one-to-one because no two values in the
domain are assigned the same function value. It is onto because all four elements of
the codomain are images of elements in the domain. Hence, f is a bijection.
Example 1
Linda Boston ➢Is 𝑓 injective?
➢ Is 𝑓 bijective?
✓No
Example 2
Linda Boston ➢Is 𝑓 injective?
Max New York ✓No
Kathy Hong Kong
➢Is 𝑓 surjective?
Peter Moscow
✓Yes
Paul
➢ Is 𝑓 bijective?
✓No
Example 3
Linda Boston ➢Is 𝑓 injective?
Max New York ✓Yes
Kathy Hong Kong
➢Is 𝑓 surjective?
Peter Moscow
✓No
Kuala
Lumpur
➢ Is 𝑓 bijective?
✓No
Example 4
Linda Boston ➢Is 𝑓 injective?
Max New York ✓No. 𝑓 not a function
Kathy Hong Kong
Peter Moscow
Kuala
Lumpur
Example 5
Linda Boston ➢Is 𝑓 injective?
Max New York ✓Yes
Kathy Hong Kong
➢Is 𝑓 surjective?
Peter Moscow
✓Yes
Kuala
Helen
Lumpur
➢ Is 𝑓 bijective?
✓Yes
Inversion
➢A function 𝑓: 𝐴 → 𝐵 is a bijection then 𝑓 has an inverse function
𝑓 −1 : 𝐵 → 𝐴 such that𝑓 −1 𝑏 = 𝑎 if 𝑓(𝑎) = 𝑏
Peter Moscow
➢𝑓 −1 : 𝐶 → 𝑃 is not function, because
Kuala it is not defined for all elements of C
Helen
Lumpur and assigns two images to the pre-
image New York.
Summary of functions
and its properties
𝑋 𝑌 Codomain
Domain
𝑓
Range
𝑥 𝑓(𝑋)
𝑓 −1
➢Injective: 𝑓 is one-to-one
➢Surjective (onto) : Range = Co-domain
➢Bijective: 𝑓 is one-to-one and Onto
Composition
➢The composition of two functions 𝑔: 𝐴 → 𝐵 and
𝑓: 𝐵 → 𝐶, denoted by 𝑓 ∘ 𝑔, is defined by
(𝑓 ∘ 𝑔)(𝑎) = 𝑓(𝑔(𝑎))
➢First, function 𝑔 is applied to element 𝑎 ∈ 𝐴,
mapping it onto an element of 𝐵
➢Second, function 𝑓 is applied to this element
of 𝐵, mapping it onto an element of 𝐶
➢Therefore, the composite function maps from The composition of the functions 𝒇 and 𝒈
𝐴 to 𝐶
Composition (Example)
➢𝑓: ℝ → ℝ, 𝑓(𝑥) = 7𝑥 – 4
➢𝑔: ℝ → ℝ, 𝑔 𝑥 = 3𝑥