0% found this document useful (0 votes)
11 views55 pages

Unit8 Set Function

Uploaded by

khdguata
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views55 pages

Unit8 Set Function

Uploaded by

khdguata
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Set Theory and Functions

Basic Set Theory 1-1


Set
❑ A set is a collection of objects.
❑ Suppose the set A contains an object called x.
 x is an element (or member) of A.
 x is denoted by x  A.

❑ The roster notation of a set simply lists all


members of the set inside braces { }.
❑ Example:
C = {10¢, 20¢, 50¢, $1, $2, $5, $10}
• The order is not important.
• The same element needs not appear more than once.
(Duplicate elements are redundant and can be removed.)
Basic Set Theory 1-2
Elements of a Set
• The object used to form a set are called its element or its
members.
• In set theory notation, the elements of a set are written inside
a pair of curly braces { } and are represented by commas “,”.
{3, t, 6, m, A}
• The name of the set is always written in capital letter
A = {3, t, 6, m, A}

• We use a mathematical notation, ∈, to imply an element of .


3 ∈ A, m ∈ A.

Basic Set Theory 1-3


Two Basic Properties of Sets
1. The change in order of writing the elements does not make
any changes in the set
{a, b, c} can also be written as {c, a, b}

2. If one or many elements of a set are repeated, the set


remains the same
Set A = {1, 2, 3, 3, 4, 4, 4} is the same as {1, 2, 3, 4}

The set of letters in the word “GOOGLE” = {G, O, L, E}

Basic Set Theory 1-4


Set Description
“equal” “such that”
Read as:
A equals the set of all x
“Set A” A = { x | conditions }. such that x …

“the set of all x” varies with sets

Example:
Let
C = {ECE students, CE students, IE students, CS students, Mech
students, Building students}.
A is the set whose elements, x, are elements of C, x ∈ C, such that x is
completely EE Dept students.
A = {x | x ∈ C, is completely EE Dept students}
A = {ECE, CE, IE}
Basic Set Theory 1-5
Identity
❑ Two sets are identical iff (if and only if) they
have exactly the same members.

❑ A=B for every x, x ∈ A ⟺ x ∈ B.

❑ Example:
{0,2,4} = {x | x is an even natural number less than 5}

(Note: ‘iff’ is the abbreviation of ‘if and only if’,


∈ is read as is an element or a member of)
Basic Set Theory 1-6
Cardinality
❑ The cardinality of a set A is defined as the
number of elements in the set.
❑ It is denoted by |A|.

❑ Example:
C = {10¢, 20¢, 50¢, $1, $2, $5, $10}
|C| = 7.

Basic Set Theory 1-7


Subset and Proper subset

❑ A is a subset of B, written as A ⊆ B, if every


member of A is also a member of B.
❑ A is a proper subset of B, 𝐴 ⊂ B. All element of A
are in B, but B contains some elements that are
not in A.
 i.e., A is not the same as B, and B has more elements
than A has.
❑ Example:
 The set of all women is a proper subset of the set of
all human beings.

Basic Set Theory 1-8


The Empty Set (Null set)

❑ A set is empty if it contains no elements at all.


❑ There is only one empty set.
❑ We denote it by ∅ and is also denoted by { }.
❑ A set of elements with certain properties turns
out to be { }, i.e., the set of squares with 5 sides,
the set of dogs with 6 legs.
❑ Confusion: the empty set ∅ with the set {∅}.

Basic Set Theory 1-9


Power set
❑ Many CS problems involve testing all combinations of
elements of a set to see if they satisfy certain property.
To consider all such combinations of elements of a set
S, we build a new set that has its members all the
subsets of S
❑ The set of all subsets of a set A is called the power set
of A.
❑ It is denoted as 𝑃(𝐴)
❑ Example: What is the power set {0, 1, 2}?
 𝑃 {0, 1, 2} 𝑖𝑠 𝑡ℎ𝑒 𝑠𝑒𝑡 𝑜𝑓 𝑎𝑙𝑙 𝑠𝑢𝑏𝑠𝑒𝑡𝑠 𝑜𝑓 0, 1, 2 .
 𝑃 {0, 1, 2} = {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}
 The cardinality of a power set is 2𝑛 , where n is the number
of element of the set

Basic Set Theory 1-10


Venn Diagram and Relationship
between Sets
U
❑ A universal set U is a set A
containing everything that we
B
are considering.
❑ Venn diagram B is a subset of A.
 U is represented by a rectangular
box.
U
 Subsets of U (e. g. A and B) are A
represented by circles (more
precisely, regions inside closed curves). B
❑ A and B are disjoint if they have
A and B are disjoint.
no elements in common.
Basic Set Theory 1-11
Four Fundamental Operations
❑ The union of A and B, denoted by A ∪
B, is the set of all elements that
belong to either A or B, or in both.
❑ The intersection of A and B, denoted
by A ∩ B, is the set of all elements
that are in both A and B.
❑ The complement of A, denoted by Ac, ∩
is the set of all elements in U that do
not belong to A.
complement of A is denoted as Ac, A’ , or ~A

❑Cartesian Product of sets


Basic Set Theory 1-12
Exercise

1. x ∈ 𝐴 ⋆ 𝐵 if x ∈ 𝐴 or x ∈ 𝐵, what is “⋆”?

∪ Union Operator
2. x ∈ 𝐴 ⋄ 𝐵 if x ∈ 𝐴 and x ∈ 𝐵, what is “⋄”?

∩ Intersection Operator
3. A = {@, $, %, ^, *, **, 3, 5, 99, M, N, K, ☺, , ☺ #,  ☺}

What is |A|, |P(A)|?

Basic Set Theory 1-13


Proof on De Morgan’s law 𝐴 ∪ 𝐵 𝑐 = 𝐴𝑐 ∩ 𝐵𝑐

𝐴 ∪ 𝐵 = 𝐴ҧ ∩ 𝐵ത
Equivalent just the same as 2 ways iff
prove 𝐴 ∪ 𝐵 ⊆ 𝐴ҧ ∩ 𝐵,ത and 𝐴ҧ ∩ 𝐵ത ⊆ 𝐴 ∪ 𝐵

Proof in the opposite direction


Proof
Assume x𝜖 𝐴ҧ ∩ 𝐵ത
Assume x𝜖 𝐴 ∪ 𝐵
B
x∉𝐴∪𝐵 x 𝜖 𝐴ҧ 𝑎𝑛𝑑 x𝜖𝐵ത A

x ∉ 𝐴 𝑎𝑛𝑑 x ∉ 𝐵 x ∉ 𝐴 𝑎𝑛𝑑 x ∉ 𝐵

x 𝜖 𝐴ҧ 𝑎𝑛𝑑 x𝜖𝐵ത x∉𝐴∪𝐵


x 𝜖 𝐴ҧ ∩ 𝐵ത x𝜖𝐴∪𝐵

Therefore 𝐴 ∪ 𝐵 = 𝐴ҧ ∩ 𝐵ത
QED

Basic Set Theory 1-14


Venn Diagram Examples
❑ Suppose

𝐴 ={Strawberry, Mango, Apple, Tomato, Grape}

𝐵 ={Mango, Banana, Orange, Apple}

C ={Tomato, Apple, Watermelon, Orange}

❑ Draw a Venn diagram of three sets 𝐴, 𝐵, and 𝐶.

❑ Find A ∪ 𝐶 ∩ 𝐵. A B

U C

Basic Set Theory 1-15


Venn Diagram Examples
A ∪ 𝐶 ∩ 𝐵 ={Mango, Apple, Orange}

𝐴 𝐵
Strawberry Mango Banana
Grape
Apple
Tomato Orange

Watermelon
𝐶

Basic Set Theory 1-16


Cartesian Product of sets
❑ A Cartesian product is defined as
 A × B = {(a,b) | a ∈ A and b ∈ B}
 This is a set of ordered pairs, hence order is essential

A = {a, b, c}, B={b, e}


A × B = {(a, b), (a, e), {b, b), (b, e), (c, b), (c, e)}

In Cartesian Product or people also call it cross product, the


order is important

A×B≠B×A

Basic Set Theory 1-17


Example of Cartesian Product

X = {x ∈ all x coordinates of any point on the XY-plane}


Y = {y ∈ all y coordinates of any point on the XY-plane}

y y

X = x
x

𝑋 × 𝑌 = { 𝑥, 𝑦 | 𝑥∈𝑋 & 𝑦 ∈ 𝑌}

Basic Set Theory 1-18


The Algebra of Sets

❑ Set difference:
 𝐴 − 𝐵 is defined as the set of all elements that are in
𝐴 but not in 𝐵.
 𝐴 − 𝐵 = 𝐴 ∩ 𝐵𝑐 (Difference Law)

Basic Set Theory 1-19


The Algebra of Sets

❑ Set difference:
 𝐴 − 𝐵 is defined as the set of all elements that are in
𝐴 but not in 𝐵.
 𝐴 − 𝐵 = 𝐴 ∩ 𝐵𝑐 (Difference Law)

A B

𝐴−𝐵

Basic Set Theory 1-20


The Algebra of Sets: Fundamental Laws
❑ For any sets 𝐴, 𝐵, and 𝐶:
 commutative laws:
• 𝐴∪𝐵 =𝐵∪𝐴
• 𝐴∩𝐵 =𝐵∩𝐴

 associative laws:
• 𝐴 ∪ 𝐵 ∪ 𝐶 = 𝐴 ∪ (𝐵 ∪ 𝐶)
• 𝐴 ∩ 𝐵 ∩ 𝐶 = 𝐴 ∩ (𝐵 ∩ 𝐶)

 distributive laws:
• 𝐴∪ 𝐵∩𝐶 = 𝐴∪𝐵 ∩ 𝐴∪𝐶
• 𝐴 ∩ 𝐵 ∪ 𝐶 = 𝐴 ∩ 𝐵 ∪ (𝐴 ∩ 𝐶)

o difference law:
• 𝐴 − 𝐵 = 𝐴 ∩ 𝐵𝑐
Basic Set Theory 1-21
The Algebra of Sets: Fundamental
Laws (cont.)
❑ For any subset 𝐴 of universal set 𝑈:
 identity laws:
• 𝐴∪∅=𝐴
• 𝐴∩𝑈 =𝐴

 complement laws:
• 𝐴 ∪ 𝐴𝑐 = 𝑈
• 𝐴 ∩ 𝐴𝑐 = ∅

Basic Set Theory 1-22


The Algebra of Sets: Additional
Laws
❑ For unions and intersections.
❑ For any subsets 𝐴 and 𝐵 of a universal set 𝑈:
 idempotent law:
• 𝐴∪𝐴 =𝐴
• 𝐴∩𝐴 =𝐴
 domination law:
• 𝐴∪𝑈 =𝑈
• 𝐴∩∅=∅

 absorption law:
• 𝐴∪ 𝐴∩𝐵 = 𝐴
• 𝐴∩ 𝐴∪𝐵 = 𝐴
Basic Set Theory 1-23
The Algebra of Sets: Additional
Laws (cont.)
❑ For complements.
❑ For any subsets 𝐴 and 𝐵 of a universal set 𝑈:
 De Morgan's law:
• 𝐴∪𝐵 𝑐 = 𝐴𝑐 ∩ 𝐵𝑐
• 𝐴∩𝐵 𝑐 = 𝐴𝑐 ∪ 𝐵𝑐
 double complement law:
• (𝐴𝑐 )𝑐 = 𝐴

 complements of 𝑈 and ∅:
• 𝑈𝑐 = ∅
• ∅𝑐 = 𝑈

Basic Set Theory 1-24


The Algebra of Sets: Example 1
Let A, B, C be sets. Show that

(𝐴 ∪ 𝐵 ∩ 𝐶 )𝑐 = (𝐶 𝑐 ∪ 𝐵𝑐 ) ∩ 𝐴𝑐

Proof:
Always start from the LHS and it is important to write each step with one move

(𝐴 ∪ 𝐵 ∩ 𝐶 )𝑐 = 𝐴𝑐 ∩ 𝐵 ∩ 𝐶 𝑐 De Morgan Law
= 𝐴𝑐 ∩ 𝐵𝑐 ∪ 𝐶 𝑐 De Morgan Law
= 𝐵𝑐 ∪ 𝐶 𝑐 ∩ 𝐴𝑐 Commutative Law
= 𝐶 𝑐 ∪ 𝐵𝑐 ∩ 𝐴𝑐 Commutative Law

QED
Basic Set Theory 1-25
The Algebra of Sets: Example 2

❑ Construct an algebraic proof that any sets 𝐴, 𝐵,


and 𝐶,
𝐴 ∪ 𝐵 − 𝐶 = 𝐴 − 𝐶 ∪ (𝐵 − 𝐶)
Proof:
Start from LHS
𝐴 ∪ 𝐵 − 𝐶 = 𝐴 ∪ 𝐵 ∩ 𝐶𝑐 by set difference law
= 𝐶 𝑐 ∩ (𝐴 ∪ 𝐵) by commutative law
= 𝐶 𝑐 ∩ 𝐴 ∪ (𝐶 𝑐 ∩ 𝐵) by distributive law
= 𝐴 ∩ 𝐶𝑐 ∪ 𝐵 ∩ 𝐶𝑐 by commutative law
= 𝐴 − 𝐶 ∪ (𝐵 − 𝐶) by set difference law
QED
Basic Set Theory 1-26
The Algebra of Sets: Example 3
❑ Construct an algebraic proof that for any sets 𝐴
and 𝐵,
𝐴− 𝐴∩𝐵 =𝐴−𝐵
Proof:
𝐴 − (𝐴 ∩ 𝐵) = 𝐴 ∩ 𝐴 ∩ 𝐵 𝑐
by set difference
= 𝐴 ∩ (𝐴𝑐 ∪ 𝐵𝑐 ) by De Morgan’s law

= 𝐴 ∩ 𝐴𝑐 ∪ (𝐴 ∩ 𝐵𝑐 ) by distributive law
= ∅ ∪ (𝐴 ∩ 𝐵𝑐 ) by complement law

= 𝐴 ∩ 𝐵𝑐 by identity law
=𝐴−𝐵 by set difference

QED Basic Set Theory 1-27


More Example
Construct an algebraic proof that for all sets 𝐴, 𝐵 and 𝐶,

𝐴𝐶 ∩ 𝐵𝐶 − 𝐶 𝐶 ∪ 𝐶 ∩ 𝐴 ∪ 𝐶 ∩ 𝐵 = C.

𝐴𝐶 ∩ (𝐵𝐶 −𝐶 𝐶 ) ∪ 𝐶 ∩ 𝐴 ∪ 𝐶 ∩ 𝐵
= 𝐴𝐶 ∩ 𝐵𝐶 ∩ 𝐶 ∪ 𝐶 ∩ 𝐴 ∪ 𝐶 ∩ 𝐵 by the Set Difference law
= 𝐴𝐶 ∩ 𝐵𝐶 ∩ 𝐶 ∪ 𝐴 ∩ 𝐶 ∪ 𝐵 ∩ 𝐶 by the Commutative law of ∩
= 𝐴𝐶 ∩ 𝐵𝐶 ∪ 𝐴 ∪ 𝐵 ∩ 𝐶 by the Distributive law

= 𝐴∪𝐵 𝐶
∪𝐴∪𝐵 ∩𝐶 by the De Morgan’s law

= 𝐴∪𝐵 𝐶 ∪ (𝐴 ∪ 𝐵) ∩ 𝐶 by the Associative law

= 𝑈∩𝐶 by the Complement law


= 𝐶 by the Identity law

Basic Set Theory 1-28


Functions
 One of the basic notions of mathematics is that of
functions.

 To mathematicians in the 17th centaury, a function


referred to an algebraic or trigonometrical formula
involving one or more variables.
 A function can be seen as an algebraic formula involving
one or more variables:
𝑦 = 𝑘𝑥 2
Changing the numerical value will result different outputs.

Basic Set Theory 4-29


Relations & Functions

Input output
function
Pair B Pair A Pair A Pair B

x= Sam Zhang x= 1 y= 1 y= 2309

x= Kim Wu x= 2 y= 4 y= 2791
x= CW Chan x=3 y= 9 y= 2811

We know the first ordered pair is a function f , 𝑦 = 𝑓 𝑥 2


The second pair is a kind of undefined relation or function
Basically we expect that we can plug in the value of x to obtain the
output value y. Sometimes, we may expect to find x when y is given.

Basic Set Theory 4-30


Relations & Functions
 It is, however, very important to broaden the scope of
function to include the relationships that could not be
expressed by a simple formula and to allow variables
that NOT necessarily NUMBERS.
 A “function” is something that connects one “set” to
another “set” in a particular way

Function Set 2
Set 1
Set 2:
Set 1: City
EE1001
U EE
students
students
Basic Set Theory 4-31
Relations and functions
ALL functions are Relations, but NOT ALL Relations are Functions
Given ordered pairs

Pair A: {(3,7), (8, -4), (-2, 9), (10, 0)}

Pair B: {(7,3), (7,8), (-2, 9), (10, 0)}

Pair A: Pair B:
Domain: {3, 8, -2. 10} Domain: {7, -2. 10}

Range: {7, -4, 9, 0} Range: {3, 8, 9, 0}

These 2 ordered pairs are relations (how input corresponds/map to output)


They both are relations but only Pair A is a function

Basic Set Theory 4-32


Relations
❑ In discrete mathematics, “relations” is used to describe a
collection of ordered pairs.
❑ Relation relates an object from one set to other sets, and the
sets must be non-empty.
❑ Relation can contain two or more than two sets. Suppose
there are two sets, A and B for instance. Set A contains an
object a, and set B contains an object b.
❑ The objects will be related to each other if there is a relation
of ordered pair (a, b).

Applications: In some computer languages, relations


(equivalence relation) is used to relate ordered pair of strings.

Basic Set Theory 4-33


Relations and Functions
• Relations represent one to many relationships between elements
in A and B. 1
• Example: a
2
b
3
• What is the difference between a relation and a function from A to
B? A function defined on sets 𝐴, 𝐵: 𝐴 → 𝐵 assigns each element in
the domain set A to exactly one element from B. So, it is a special
case of relation.
1
a
2
b
3

𝑦 = 𝑥 1/2 Not a function?


Basic Set Theory 4-34
In real world in particular the IT world applications,
most cases are discontinuous/ discrete.

We now move to broaden the scope of a function to


include relationships that could not be expressed by
simple numerical formula. This would enable
variables that are not necessarily numbers.

Basic Set Theory 4-35


Functions Definition
❑ Let X and Y be sets. A function, f, from X to Y is denoted
by
𝑓 ∶ 𝑋 → 𝑌 a rule that assigns to each element
Codomain
𝑥 ∈ 𝑋 , 𝑓 𝑥 ∈ 𝑌.

❑ The set X is called the domain of f, while


the set Y is called the codomain of f. X Y

The 𝑓 𝑥 ∈ 𝑌 is called the value of the function 𝑓 at 𝑥.


❑ Whenever a specific element is assigned to the variable
x, the corresponding value of y =f(x) is determined by
the function.
Basic Set Theory 4-36
❑ For example if f is the function from the real number, R, to
the real numbers in which f assigns to each real number
its cube,

❑ We would say that 𝑓(𝑥) = 𝑥 3 .


❑ The value of 3 would be 27, and the value of f at -3 would be
-27, and so on.

❑ Often, the set of values of a function is not the whole


codomain, but a proper subset of it.
The set of values of a function 𝑓: 𝑋 → 𝑌 is called the range or
image of f. It is usually a subset of the codomain Y.
In the case 𝑓(𝑥) = 𝑥 2 , the range is not the whole real
number set

Basic Set Theory 4-37


❑ A HK ID card number is assigned
to an individual (except new born
infant).
❑ HK ID number can be considered a HK permeant
function whose domain is HK
HK ID
citizens
number
Codomain

permeant citizens.
❑ And whose codomain is the set of
possible HK ID numbers.
❑ The range consists of those HK ID
numbers that are in actual use.
Some ID numbers may not be in use by HK
permeant citizens because of many different
reasons, such as passed away persons, and
temporary HK residents.
Basic Set Theory 4-38
To introduce 3 fundamental mathematical
functions:
• surjective, injective and bijective.

• Knowing the above properties of a function, we will


be able to know ie., from a given output can we
return to where we start (return home; just 1 unique
home, an invertible function). In a huge database,
can we find the pairwise relationship.
• Or whether or not there is no pair relationship.

Basic Set Theory 4-39


Mapping, Domain, Codomain
domain codomain

Domain: a set of all possible function


input values
Codomain: a set of all possible function
output values
Range: a set of all actual output
values
Codomain and range are often
confusing

f is a function from domain X to codomain Y.

The smaller oval inside Y is the range or image of f.


Basic Set Theory 4-40
Functions: Injective, Surjective, Bijective
3 functions that we use to define different
relationship between domain and codomain

∀𝑎. 𝑏 ∈ 𝑋, 𝑓 𝑎 = 𝑓(𝑏) ⟹ 𝑎 = 𝑏 ∀𝑦 ∈ 𝑌, ∃𝑥 ∈ 𝑋 such that 𝑦 =f(x)

∀𝑎, 𝑏 ∈ 𝑋, 𝑎 ≠ 𝑏 ⟹ 𝑓(𝑎) ≠ 𝑓(𝑏)

∀𝑦 ∈ 𝑌, ∃! 𝑥 ∈ 𝑋 such that 𝑦 =f(x)


“there exist exactly one x” Basic Set Theory 4-41
Functions: Examples of CityU Students
❑ Student Number → Student Name 65432100 → CHAN Tai Man
Injective No: Students may have duplicate names
Surjective Yes: All students names have corresponded student numbers
Bijective No: Surjective but not injective

❑ Student Number → HKID 65432100 → Z123456(A)


Injective Yes: Each student number corresponds to different HKID
Surjective No: Not all HK citizens are CityU students
Bijective No: Injective but not surjective

❑ Student Number → Electronic ID 65432100 → tmchan111


Injective Yes: Each student number corresponds to different EID
Surjective Yes: All EID have corresponded student numbers
Bijective Yes: Injective and surjective

Basic Set Theory 4-42


Injective (also called one-to–one)
❑ Injective means we won’t have two or more “x”
pointing to the same “y” ∀𝑎, 𝑏 ∈ 𝑋, 𝑓 𝑎 = 𝑓(𝑏) ⟹ 𝑎 =b
or ∀𝑎, 𝑏 ∈ 𝑋, 𝑎 ≠ 𝑏 ⟹ 𝑓(𝑎) ≠ 𝑓(𝑏)

❑ Many-to-one is NOT injective


❑ But we can have a “y” without being mapped from “x”

f f

Not injective,
4, 3 map to
the same “A”
4

injective Not injective Basic Set Theory 4-43


Example: Injective “one-to-one”

It means an output must be mapped from a unique input


The mathematical notation ሾ𝑎, 𝑐) indicates an interval from a to c that is inclusive of a,
but exclusive of c., i.e., ሾ6, 13) 6, 7, 8, 9, 10, 11, 12.

Proof: For arbitrary a, b, suppose f(a) = f(b), and


means they are in the interval from 0 to ∞, (positive number).
So 𝑓 𝑎 = 𝑎2 and 𝑓 𝑏 = 𝑏 2 ,
𝑎2 = 𝑏 2 , because f(a) = f(b),
𝑎2 = 𝑏 2 , hence a = b because +𝑣𝑒 number.
As a, b are arbitrary number, so proved, and f is injective.
QED
Note: f is not injective if 𝑓: −∞, ∞
a may not = b even 𝑎2 = 𝑏 2 , -3 and 3 Basic Set Theory 4-44
Surjective (also called “onto”)
❑ Surjective means that every element in the codomain does
get mapped, ∀𝑦 ∈ 𝑌, ∃𝑥 ∈ 𝑋 such that 𝑦 = f(x)
❑ Or the range of f equals to Y, no element in Y left out
without being mapped from the domain.
❑ Example: Domain is Bank account numbers, Codomain is
bank account holder
X Y
X Y

Basic Set Theory 4-45


Surjective function
Let say we have a function f, mapping from the set X to the set Y, f: X→ 𝑌.

X. f Y If there is an element in Y, there is an


. element x that f will map from X to Y,
that is surjective.
∀ y ∈ 𝑌, ∃𝑥, 𝑥 ∈ 𝑋 such that 𝑓 x = 𝑦.
Every y in the set Y can be mapped to by at least one of the
elements over the set X.

X Y X Y
1 A 1 A
2 B 2 B
3 C 3 C
4 D 4 D
5 5 E
surjective Not surjective (element E
Basic Set Theory 4-46
left out)
Bijective
❑ Bijective means both Injective and Surjective together,
∀𝑦 ∈ 𝑌, ∃! 𝑥 ∈ 𝑋 such that 𝑦 = f(x).
❑ A function that is both “one-on-one” and “onto” is called a
bijection or a one-on-one correspondence.
❑ If every “x” goes to a unique “y” and every “y” has a mapping
from ‘x” then we can go back and forwards without confused.
❑ Every bijective function, f, has an inverse function, 𝑓 −1 .

f
Note:
∃! is read there exists only one

Basic Set Theory 4-47


Continuous function Examples

Not injective Injective


𝑓 𝑥 : 0°, 180° → ሾ−1, 1] 𝑓(𝑥): 0°, 90° → ሾ−1, 1]
𝑓(𝑥) 𝑓(𝑥)
𝑓(𝑥) = sin(𝑥) 𝑓(𝑥) = sin(𝑥)
Not
surjective
0 𝑥 0 𝑥

𝑓 𝑥 : −180°, 180° → ሾ−1, 1] 𝑓 𝑥 : −90°, 90° → ሾ−1, 1]


𝑓(𝑥) 𝑓(𝑥)
𝑓(𝑥) = sin(𝑥) 𝑓(𝑥) = sin(𝑥)
Surjective
0 𝑥 0 𝑥
Bijective

Basic Set Theory 4-48


More Examples: Injective, Surjective,
Bijective

Not injective Injective


𝑓(𝑥): 𝑅 → 𝑅 𝑓(𝑥): 0, +∞ → 𝑅
𝑓(𝑥) 𝑓(𝑥) = 𝑥 2 𝑓(𝑥) 𝑓(𝑥) = 𝑥 2

Not
surjective 𝑥 𝑥
0 0

𝑓 𝑥 : 𝑅 → ሾ0, +∞) 𝑓 𝑥 : 0, +∞ → ሾ0, +∞)


𝑓(𝑥) 𝑓(𝑥) = 𝑥 2 𝑓(𝑥) 𝑓(𝑥) = 𝑥 2

Surjective
0 𝑥 0 𝑥
Bijective

Basic Set Theory 4-49


Inverse Functions

Basic Set Theory 4-50


Composite Functions
Composition of functions
𝑓∘𝑔 𝑥 =𝑓 𝑔 𝑥
Given 𝑓 𝑥 = 3𝑥 + 8, 𝑔 𝑥 = 2𝑥 − 4
Recall that function is 𝑓 1 = 3 1 + 8=11
𝑓∘𝑔 𝑥 =𝑓 𝑔 𝑥
= 𝑓(2𝑥 − 4)
= 3 2𝑥 − 4 + 8
𝑓 ∘ 𝑔 𝑥 = 6𝑥 − 12 + 8 = 6𝑥 − 4

So we can also find 𝑓 ∘ 𝑔 −1


𝑓 ∘ 𝑔 −1 = 6 −1 − 4
3/28/2024
= -10
4-51
Composition of Functions
• If 𝑓 : 𝑋 → 𝑌 and 𝑔 : Y → 𝑍
Composition of functions
𝑔∘𝑓 𝑥 =𝑔 𝑓 𝑥

• Two functions cannot always be composed.


• The two functions can only be composed when the codomain of
the first operation, f, is equal to the domain of the second, g.
operation.
• Even if 𝑔 ∘ 𝑓 is defined, where 𝑓: 𝑋 → 𝑌 and 𝑔: 𝑌 → 𝑍,
then the composite in the reverse order 𝑓 ∘ 𝑔, will not be
defined unless 𝑋 = 𝑍.
• In general 𝑔 ∘ 𝑓 ≠ 𝑓 ∘ 𝑔; composition is not commutative.
3/28/2024
4-52
Example:
Let 𝑓: 𝑅 → 𝑅 and g: 𝑅 → 𝑅 be functions defined by 𝑓 𝑥 = 𝑥 2 and
g 𝑥 = 4𝑥 − 5. Are 𝑔 ∘ 𝑓 and 𝑓 ∘ 𝑔 defined? If so, find them.

Solution. Since the codomain of 𝑓 and the domain of 𝑔 are both equal to
ℝ, and the codomain of 𝑔 and the domain of 𝑓 are also equal to 𝑅, both
composites are defined and are functions 𝑅 → 𝑅 ( from 𝑅 𝑡𝑜 𝑅).

Now
𝑔∘𝑓 𝑥 =𝑔 𝑓 𝑥 = 𝑔 𝑥 2 = 4𝑥 2 − 5

While
𝑓∘𝑔 𝑥 =𝑓 𝑔 𝑥 = 𝑓 4𝑥 − 5 = (4𝑥 − 5)2 = 16𝑥 2 − 40𝑥 + 25

Note: in general 𝑔 ∘ 𝑓 ≠ 𝑓 ∘ 𝑔.
The operation of composition is not commutative.

3/28/2024
4-53
Is Composition always Possible?
Not ALL functions can be composed.

Let 𝑓: 𝑅 → 𝑅 and g: 𝑅 → 𝑅

3/28/2024
4-54
END

Basic Set Theory 4-55

You might also like