0% found this document useful (0 votes)
25 views

Unit-01 Set, Relation & Function

Uploaded by

nilgadhiya20
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)
25 views

Unit-01 Set, Relation & Function

Uploaded by

nilgadhiya20
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/ 103

Set, Relation & Function

P P Savani University

July 14, 2022

(P P Savani University) Set, Relation & Function July 14, 2022 1 / 103
Set Definition of Set

Definition of Set

(P P Savani University) Set, Relation & Function July 14, 2022 2 / 103
Set Definition of Set

Definition of Set
A set is an unordered collection of objects, called elements or members of the
set. A set is said to contain its elements. We write a ∈ A to denote that a is
an element of the set A. The notation a ∈ / A denotes that a is not an element
of the set A.
Any well-defined collection of objects is called a set.

Note : By the term ‘well-defined’ we mean that it is possible to say, without ambiguity, whether a
particular object belongs to the collection under discussion or not.

(P P Savani University) Set, Relation & Function July 14, 2022 3 / 103
Set Definition of Set

A few example of set are given below:


1 The collection of students of PPSU,
2 Collages in India having commerce faculty,
3 The collection of prime numbers which are less then 50,
4 The collection of two roots of the equation x2 = 4.
The following collection are not set as they are not well-defined:
a The collection of honest men in a village,
b The collection of good students in commercial arithmetic of commerce college.

(P P Savani University) Set, Relation & Function July 14, 2022 4 / 103
Set Representation of Set

Representation of Set

(P P Savani University) Set, Relation & Function July 14, 2022 5 / 103
Set Representation of Set

Representation of Set

Roster Method / Listing Method

Under this method, the elements of a set area enumerated between two curly
brackets {} separated by commas.

Set Builder / Rule Method

Under this method, the elements are indicated by description of their


characteristic or property.

(P P Savani University) Set, Relation & Function July 14, 2022 6 / 103
Set Representation of Set

Example

i W = The set of days in week.


Roster Method:
W ={Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}
Set Builder:
W ={x|x is the name of a day in a week}

(P P Savani University) Set, Relation & Function July 14, 2022 7 / 103
Set Equality of Sets

Equality of Sets
Two sets are equal if and only if they have the same elements. Therefore, if A and B are sets, then A and
B are equal if and only if ∀x (x ∈ A ↔ x ∈ B). We write A = B if A and B are equal sets. If sets A and
B are not equal then we write A 6= B.

Examples:
i A = {1, 2}, B = {1, 2, 1} : In this case A = B
ii A = {x|x is a letter of the word TALE}
B = {x|x is a letter of the word LATE}. In this case A = B
iii C = {x|x is a letter of the word SLATE}
D = {x|x is a letter of the word PLATE}. In this case C 6= D
iv P = {1, −1, 3}, Q = {±1, 3}. In this case P = Q.

(P P Savani University) Set, Relation & Function July 14, 2022 8 / 103
Set Type of Sets

Type of Sets

(1) Null set:

A set is said to be a null set if no elements belong to it. A null set is also called
empty set or void set. A null set is denoted by φ or {}

Examples:
i S = The set of female Indian noble laureates = φ = {}
ii S = The set of positive integers lying between 1 and 10 which are exactly
divisible by 11 = φ

(P P Savani University) Set, Relation & Function July 14, 2022 9 / 103
Set Type of Sets

Type of Sets

(2) Singleton Set

A set consisting of only one element is called a singleton set.

Examples:
i S = Set of prime numbers which are even = {2}
ii S = Set of Nobel Laureate Indian economists till 2007 = {Prof. Amartya Sen}
iii S = {x : x is an integer neither positive nor negative} = {0}
iv S ={x : x is an integer neither prime nor composite}={1}

(P P Savani University) Set, Relation & Function July 14, 2022 10 / 103
Set Type of Sets

Type of Sets

(3) Finite Set

If a set contains a finite or limited numbers of elements then it is called a finite


set.

Examples:
i S = The set of days in week,
ii S = The set of students of PPSU,
iii S = The set of prime numbers lying between 1 and 100

(P P Savani University) Set, Relation & Function July 14, 2022 11 / 103
Set Type of Sets

Type of Sets

(4) Infinite Set

A set is said to be infinite set if the number of elements in it is not finite.

Examples:
i Z = The set of integers = {0, ±1, ±2, ±3, · · · }
ii N = The set of natural numbers, = {1, 2, 3, · · · }
iii Q = The set of rational numbers.

(P P Savani University) Set, Relation & Function July 14, 2022 12 / 103
Set Subset of a Set

Subset of a Set

The set A is a subset of B if and only if every element of A is also an element


of B. We use the notation A ⊆ B to indicate that A is a subset of the set B.

(P P Savani University) Set, Relation & Function July 14, 2022 13 / 103
Set Subset of a Set

Examples:

i The set of all Computer 1st year student of a engineering collage is a subset of
the set of all students of the collage.
ii The set of natural number is a subset of the set of integers.
iii The set of positive integers exactly divisible by 4 is a subset of the set of
integers exactly divisible by 2.
iv Let A = {1, 2, 3}. Then the subset of A will be :
φ,{1},{2},{3},{1, 2},{1, 3},{2, 3},{1, 2, 3}

(P P Savani University) Set, Relation & Function July 14, 2022 14 / 103
Set The Size of a Set

The Size of a Set

Let S be a set. If there are exactly n distinct elements in S where n is a


nonnegative integer, we say that S is a finite set and that n is the cardinality
of S. The cardinality of S is denoted by |S| or n(S)

(P P Savani University) Set, Relation & Function July 14, 2022 15 / 103
Set Power Set

Power Set

Given a set S, the power set of S is the set of all subsets of the set S. The
power set of S is denoted by P(S).

Example: What is the power set of set {0, 1, 2}?


Solution: The power set P({0, 1, 2}) is the set of all subset of {0, 1, 2}.
Hence, P({0, 1, 2}) = {φ, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}} J
Note : The empty set and the set itself are members of this set of subsets.

(P P Savani University) Set, Relation & Function July 14, 2022 16 / 103
Set Cartesian Products

Cartesian Products

The ordered n-tuple (a1 , a2 , · · · , an ) is the ordered collection that has a1 as its
first element,a2 as its second element,· · · , and an as its nth element.

Let A and B be sets. The Cartesian product of A and B, denoted by A × B,


is the set of all ordered pairs (a, b), where a ∈ A and b ∈ B. Hence,

A × B = {(a, b)|a ∈ A ∧ b ∈ B}

(P P Savani University) Set, Relation & Function July 14, 2022 17 / 103
Set Cartesian Products

Examples:
1 What is the Cartesian product of A = {1, 2} and B = {a, b, c}?
Solution: The Cartesian product A × B is
A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}
2 Show that the Cartesian product B × A is not equal to the Cartesian product
A × B, where A and B are as above.
Solution: The Cartesian product B × A is
B × A = {(a, 1), (a, 2), (b, 1), (b, 2), (c, 1), (c, 2)}
This is not equal to A × B, which was found in above example. J
Note: The Cartesian products A × B and B × A are not equal, unless A = φ or B = φ (so that
A × B = φ) or A = B
(P P Savani University) Set, Relation & Function July 14, 2022 18 / 103
Set Cartesian Products

Example: What is the Cartesian product A × B × C, where A = {0, 1}, B = {1, 2},
and C = {0, 1, 2}?
Solution: The Cartesian product A×B×C consists of all ordered triples (a, b, c),where
a ∈ A, b ∈ B, and c ∈ C. Hence,

A × B × C = {(0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 0), (0, 2, 1), (0, 2, 2),
(1, 1, 0), (1, 1, 1), (1, 1, 2), (1, 2, 0), (1, 2, 1), (1, 2, 2)}

Remark: Note that when A, B, and C are sets, (A × B) × C is not the same as A × B × C.
We use the notation A2 to denote A × A, the Cartesian product of the set A with
itself. Similarly, A3 = A × A × A, A4 = A × A × A × A, and so on.
Suppose that A = {1, 2}. It follows that A2 = {(1, 1), (1, 2), (2, 1), (2, 2)} and
A3 = {(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2), (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)}.
(P P Savani University) Set, Relation & Function July 14, 2022 19 / 103
Set Set Operation

An element x belongs to the intersection of the


Set Operation x belongs to B. This tells us that

A ∩ B = {x | x ∈ A ∧ x ∈ B}.
Union Venn Diagram
Let A and B be sets. The union of the U

sets A and B, denoted by A ∪ B, is the


set that contains those elements which A B

are either in A or in B, or in both.

A ∪ B = {x|x ∈ A ∨ x ∈ B} A 傼 B is shaded.

Example: The union of the sets {1, 3, 5} and FIGURE


{1, 2, 3} 1is Venn
the set {1, 2,of
Diagram 3,the
5}; that
is,{1, 3, 5} ∪ {1, 2, 3} = {1, 2, 3, 5}. Union of A and B.

(P P Savani University) Set, Relation & Function July 14, 2022 20 / 103
Set Set Operation

An element x belongs to the intersection of the sets A and B if and only if x belongs to A and
Set Operation
x belongs to B. This tells us that

A ∩ B = {x | x ∈ A ∧ x ∈ B}.
Intersection Venn Diagram
Let A and B be sets. The U
intersection U

of the sets A and B, denoted by A∩B, is


A
the set containing those Belements which A B

are both in A and B.

A ∩ B = {x|x ∈ A ∧ x ∈ B}
A 傼 B is shaded. A 傽 B is shaded.

Example:FIGUREThe1 intersection of of
Venn Diagram thethesets {1, 3, 5}FIGURE
and {1,22, 3}
Vennis Diagram {1,the
the set of 3}; that
Union of A and B.
is,{1, 3, 5} ∩ {1, 2, 3} = {1, 3}. Intersection of A and B.

(P P Savani University) Set, Relation & Function July 14, 2022 21 / 103
Set Set Operation

Disjoint
Two sets are called disjoint if their intersection is the empty set.

Example: Let A = {1, 3, 5, 7, 9} and B = {2, 4, 6, 8, 10}. Because A ∩ B = φ, A and


B are disjoint.
Note: |A ∪ B| = |A| + |B| − |A ∩ B|

(P P Savani University) Set, Relation & Function July 14, 2022 22 / 103
Set Set Operation

Difference
Let A and B be sets. The difference of
A and B, denoted by A − B, is the set Venn Diagram
containing those elements which are in U
A but not in B. The difference of A
and B is also called the complement of A B
B with respect to A.

A − B = {x|x ∈ A ∧ x ∈
/ B}.
A – B is shaded.

Remark: The difference of sets A and FIGURE 3 Venn Diagram for


B is sometimes denoted by A \ B. the Difference of A and B.

Once the universal set U has been specifi


(P P Savani University) Set, Relation & Function July 14, 2022 23 / 103
Set Set Operation

2.2 Set Operations 129


Complement
Venn Diagram
Let U be the universalU set. The U
complement of the set A, denoted by
Ā, is the complement of A with respect
A B A
to U . Therefore, the complement of the
set A is U − A.

– B is shaded.
A Ā A is shaded.
= {x ∈ U |x ∈
/ A}.
FIGURE 3 Venn Diagram for FIGURE 4 Venn Diagram for
the Difference of A and B. the Complement of the Set A.

Once the universal set U has been specified, the complement of a set can be defined.
(P P Savani University) Set, Relation & Function July 14, 2022 24 / 103
Set Set Operation

Set Identities

1 Identity laws
A∩U =A
A∪φ=A
2 Domination laws
A∪U =U
A∩φ=φ
3 Idempotent laws
A∪A=A
A∩A=A

(P P Savani University) Set, Relation & Function July 14, 2022 25 / 103
Set Set Operation

Set Identities

4 Complementation law

A =A
5 Commutative laws
A∪B =B∪A
A∩B =B∩A
6 Associative laws
A ∪ (B ∪ C) = (A ∪ B) ∪ C
A ∩ (B ∩ C) = (A ∩ B) ∩ C

(P P Savani University) Set, Relation & Function July 14, 2022 26 / 103
Set Set Operation

Set Identities

7 Distributive laws
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
8 De Morgan‘s laws
A∩B =A∪B
A∪B =A∩B
9 Absorption laws
A ∪ (A ∩ B) = A
A ∩ (A ∪ B) = A

(P P Savani University) Set, Relation & Function July 14, 2022 27 / 103
Set Set Operation

Set Identities

10 Complement laws
A∪A=U
A∩A=φ

(P P Savani University) Set, Relation & Function July 14, 2022 28 / 103
Relation Definition of Relation

Definition of Relation

(P P Savani University) Set, Relation & Function July 14, 2022 29 / 103
Relation Definition of Relation

Definition of Relation
Let A and B be sets. A binary relation from A to B is a subset of A × B.

In other words, a binary relation from A to B is a set R of ordered pairs where the
first element of each ordered pair comes from A and the second element comes from
B. We use the notation a R b to denote that (a, b) ∈ R and a 6R b to denote that
(a, b) ∈
/ R. Moreover, when (a, b) belongs to R, a is said to be related to b by R.

A relation on a set A is a relation from A to A.

In other words, a relation on a set A is a subset of A × A.

(P P Savani University) Set, Relation & Function July 14, 2022 30 / 103
Relation Definition of Relation

Example

If A = {1, 2, 5} and B = {2, 4} then

A × B = {(1, 2), (1, 4), (2, 2), (2, 4), (5, 2), (5, 4)}

If we take the relationship x < y, then some ordered pairs are related and some are
not. The subset of A × B whose elements are related is the relation R and is given
by
R = {(1, 2), (1, 4), (2, 4)}
If R is a relationship from a set A to itself, that is, if R is a subset of A2 = A × A,
then we say R is a relation on A.

(P P Savani University) Set, Relation & Function July 14, 2022 31 / 103
Relation Definition of Relation

Example: Let A be the set {1, 2, 3, 4}. Which ordered pairs are in the relation
R = {(a, b) | a divides b}?
Solution: Because (a, b) is in R if and only if a and b are positive integers not
exceeding 4 such that a divides b, we see that

R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.

(P P Savani University) Set, Relation & Function July 14, 2022 32 / 103
Relation Domain and Range

Domain and Range


Domain
The set {a ∈ A : (a, b) ∈ R for some b ∈ B} is called the domain of R and
denoted by Dom(R).

Range

The set {b ∈ B : (a, b) ∈ R for some a ∈ A} is called the range of R and


denoted by Ran(R).

Thus, the domain of a relation R is the set of all the first element of the ordered pairs
which belong to R and the range of R is the set of second elements.
(P P Savani University) Set, Relation & Function July 14, 2022 33 / 103
Relation Domain and Range

Example: Let A = {2, 3, 4} and B = {3, 4, 5}. List all elements of each relation R
defined below and the domain and range.
(a) a ∈ A is related to b ∈ B, that is, a R b if, and only if a < b.
(b) a ∈ A is related to b ∈ B, that is, a R b if a and b are both odd numbers.
Solution: (a) 2 ∈ A is less than 3 ∈ B, then 2 R 3. Similarly, 2 R 4, 2 R 5, 3 R 4,
3 R 5, 4 R 5. Therefore,
R = {(2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)}
Dom(R) = {2, 3, 4} and Ran(R) = {3, 4, 5}
(b) Since 3 ∈ A and 3 ∈ B are both odd then 3 R 3. Similarly, 3 R 5. Therefore,
R = {(3, 3), (3, 5)}
Dom(R) = {3} and Ran(R) = {3, 5}
J
(P P Savani University) Set, Relation & Function July 14, 2022 34 / 103
Relation Domain and Range

Total number of distinct relation from a set A to a set B


Let the number of elements of A and B be m and n respectively. Then the
number of elements of A × B is mn. Therefore, the number of elements of
the power set of A × B is 2mn . Thus, A × B has 2mn different subsets. Now
every subset of A × B is relation from A to B. Hence, the number of different
relations from A to B is 2mn .

(P P Savani University) Set, Relation & Function July 14, 2022 35 / 103
Relation Domain and Range

Some operation on Sets


If R and S denote two relations, then R ∩ S, know as intersection of R and S, defines
a relation such that
x(R ∩ S)y = x R y ∧ x S y
Similarly, R ∪ S know as union of R and S, such that

x(R ∪ S)y = x R y ∨ x S y

Also, R − S is known as difference of R and S

x(R − S)y = x R y ∧ x 6S y and

x(R0 )y = x 6R y where R0 is the complement of R


(P P Savani University) Set, Relation & Function July 14, 2022 36 / 103
Relation Domain and Range

Example: If A = {x, y, z}, B = {X, Y, Z}, C = {x, y} and D = {Y, Z}. R is a


relation from A to B defined by R = {(x, X), (x, Y ), (y, Z)} and S is a relation from
C to D defined by S = {(x, Y ), (y, Z)}. Find R0 , R ∪ S, R ∩ S and R − S.
Solution: The complement of R consists of all pairs of the Cartesian product A × B
that are not R. Thus,
A × B = {(x, X), (x, Y ), (x, Z), (y, X), (y, Y ), (y, Z), (z, X), (z, Y ), (z, Z)}
Hence,
R0 = {(x, Z), (y, X), (y, Y ), (z, X), (z, Y ), (z, Z)}
R ∪ S = {(x, X), (x, Y ), (y, Z)}
R ∩ S = {(x, Y ), (y, Z)}
R − S = {(x, X)}

(P P Savani University) Set, Relation & Function July 14, 2022


J
37 / 103
Relation Types of Relation in a Set

Types of Relation in Set

Inverse Relation
Let R be any relation from a set A to a set B. The inverse of R, denoted by
R−1 is the relation from B to A which consist of those ordered pairs which,
when reversed, belong to R; that is R−1 = {(b, a) : (a, b) ∈ R}. Consequently,
x R y = y R−1 x

For example, Let A be the set of all living people. Define relation B and C on A as
follows: B = {(x, y) : x is a parent of y} C = {(y, x) : y is a child of x}
Then each of B and C is the inverse of other, written as B = C −1 and C = B −1 .

(P P Savani University) Set, Relation & Function July 14, 2022 38 / 103
Relation Types of Relation in a Set

Similarly, on the set of real numbers, the relation < is the inverse of the relation >.

Note the difference between R0 and R−1 . The relation R0 contains all elements not in
R, R−1 contains all elements of R, except that their order is reversed. For instance,
if R is the relation <, then R−1 is the relation >, because a < b if and only if b > a.
On the other hand, R0 is the relation ≥ because if x < y is false then x ≥ y.

(P P Savani University) Set, Relation & Function July 14, 2022 39 / 103
Relation Types of Relation in a Set

Identity Relation
A relation R in a set A is said to be identity relation, generally denoted by IA ,
if
IA = {(x, x) : x ∈ A}

Example Let A = {1, 2, 3} then IA = {(1, 1), (2, 2), (3, 3)} is an identity relation in
A.

(P P Savani University) Set, Relation & Function July 14, 2022 40 / 103
Relation Properties of Relation

Properties of Relation

Reflexive Relation
A relation R on a set A is called reflexive if (a, a) ∈ R for every element a ∈ A.

For Example,
(a) If R1 = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 3)} be a relation on A = {1, 2, 3}, then R1
is reflexive relation since for every a ∈ A, (a, a) ∈ R1 .
(b) If R2 = {(1, 1), (1, 2), (2, 3), (3, 3)} be a relation on A = {1, 2, 3}, then R2 is not
a reflexive relation since for 2 ∈ A, (a, a) ∈ R2 .

(P P Savani University) Set, Relation & Function July 14, 2022 41 / 103
Relation Properties of Relation

Symmetric Relation

A relation R on a set A is called symmetric if (b, a) ∈ R whenever (a, b) ∈ R,for


all a, b ∈ A.

Antisymmetric Relation

A relation R on a set A such that for all a, b ∈ A, if (a, b) ∈ R and (b, a) ∈ R,


then a = b is called antisymmetric.

(P P Savani University) Set, Relation & Function July 14, 2022 42 / 103
Relation Properties of Relation

Example: Symmetric
(a) R1 = {(1, 1), (1, 2), (1, 3), (2, 2), (2, 1), (3, 1)} on A = {1, 2, 3} is a symmetric
relation.
(b) R2 = {(x, y) ∈ R2 : x2 + y 2 = 1} is a symmetric relation on R since if x2 + y 2 = 1
then y 2 + x2 = 1 too, i.e. if (x, y) ∈ R2 then (y, x) ∈ R2 .
Example: Antisymmetric Relation
(a) R1 = {(1, 2), (2, 2), (2, 3)} on A = {1, 2, 3} is an antisymmetric relation.
(b) R2 = {(x, y) ∈ R2 |x ≤ y} is an antisymmetric relation on R since x ≤ y and
y ≤ x implies x = y then (x, y) ∈ R and (y, x) ∈ R implies x = y.
(c) R = {(x, y) ∈ N |x is divisor of y} is an antisymmetric relation since x divides y
and y divides x implies x = y.

(P P Savani University) Set, Relation & Function July 14, 2022 43 / 103
Relation Properties of Relation

Note that antisymmetric is not the same as not symmetric (asymmetric). A relation
may be symmetric as well as antisymmetric at the same time. For example, the
relation R = {(1, 1), (3, 3)} is both symmetric and antisymmetric on A = {1, 2, 3}.

(P P Savani University) Set, Relation & Function July 14, 2022 44 / 103
Relation Properties of Relation

Transitive Relation
A relation R on a set A is called transitive if whenever (a, b) ∈ R and (b, c) ∈ R,
then (a, c) ∈ R, for all a, b, c ∈ A.

(a) The relation ‘is parallel to’ on the set of lines in a plane is transitive, because if
a line x is parallel to the line y and if y is parallel to line z, then x is parallel to z.
(b) The relation ‘is less than’ and ‘is greater than’ are transitive relations on the set
of real numbers. If a < b and b < c implies a < c and if a > b and b > c implies a > c
for all real numbers a, b, c.

(P P Savani University) Set, Relation & Function July 14, 2022 45 / 103
Relation Properties of Relation

Composite of relations
Let R be a relation from a set A to a set B and S a relation from B to a set
C. The composite of R and S is the relation consisting of ordered pairs (a, c),
where a ∈ A, c ∈ C, and for which there exists an element b ∈ B such that
(a, b) ∈ R and (b, c) ∈ S. We denote the composite of R and S by S ◦ R.

(P P Savani University) Set, Relation & Function July 14, 2022 46 / 103
Relation Properties of Relation

Example: What is the composite of the relations R and S,where R is the relation
from {1, 2, 3} to {1, 2, 3, 4} with R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)} and S is the
relation from {1, 2, 3, 4} to {0, 1, 2} with S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)}?
Solution: S ◦ R is constructed using all ordered pairs in R and ordered pairs in S,
where the second element of the ordered pair in R agrees with the first element of the
ordered pair in S. For example, the ordered pairs (2, 3) in R and (3, 1) in S produce
the ordered pair (2, 1) in S ◦ R. Computing all the ordered pairs in the composite,
we find
S ◦ R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}.
J

(P P Savani University) Set, Relation & Function July 14, 2022 47 / 103
Relation Properties of Relation

Equivalence Relation
A relation on a set A is called an equivalence relation if it is reflexive,
symmetric, and transitive.

(P P Savani University) Set, Relation & Function July 14, 2022 48 / 103
Relation Properties of Relation

Example: Suppose that R is the relation on the set of strings of English letters such
that a R b if and only if l(a) = l(b), where l(x) is the length of the string x. Is R an
equivalence relation?
Solution: Because l(a) = l(a), it follows that a R a whenever a is a string, so that
R is reflexive.
Next, suppose that a R b, so that l(a) = l(b). Then b R a, because l(b) = l(a).
Hence, R is symmetric.
Finally, suppose that a R b and b R c. Then l(a) = l(b) and l(b) = l(c). Hence,
l(a) = l(c), so a R c. Consequently, R is transitive.
Because R is reflexive, symmetric, and transitive, it is an equivalence relation.

(P P Savani University) Set, Relation & Function July 14, 2022 49 / 103
Relation Properties of Relation

Partial order Relation


A relation R on a set A is called a partial ordering or partial order if it is
reflexive, antisymmetric, and transitive. A set A together with a partial
ordering R is called a partially ordered set, or poset, and is denoted by
(A, R). Members of A are called elements of the poset.

(P P Savani University) Set, Relation & Function July 14, 2022 50 / 103
Relation Properties of Relation

For example, the greater or equal (≥) relation is a partial ordering on Z, the set of
integers.

Reflexive: Since a ≥ a for every integer a, ≥ is reflexive.


Antisymmetric: Since a ≥ b and b ≥ a imply a = b, ≥ is antisymmetric.
Transitive: Since a ≥ b and b ≥ c imply a ≥ c, ≥ is transitive.

Hence, ≥ is a partial ordering on Z and (Z, ≥) is a poset.

(P P Savani University) Set, Relation & Function July 14, 2022 51 / 103
Relation Properties of Relation

Example: Does divisibility relation | is a partial ordering on the set of positive


integers?
Solution: (i) a|a whenever a is a positive integer, the “divides” relation is reflexive.
(ii)It is antisymmetric, for if a and b are positive integers with a|b and b|a, then a = b
(iii)Suppose that a divides b and b divides c. Then there are positive integers k and
l such that b = ak and c = bl. Hence, c = a(kl), so a divides c. It follows that this
relation is transitive.
Hence, The divisibility relation | is a partial ordering on the set of positive integers,
because it is reflexive, antisymmetric, and transitive. So, We say that (Z+ , |) is a
poset. J

(P P Savani University) Set, Relation & Function July 14, 2022 52 / 103
Relation Representing Relations

Representing Relations
The Matrix of Relation
Let A = {a1 , a2 , a3 , · · · , am } and B = {b1 , b2 , b3 , · · · , bn } are finite sets
containing m and n elements respectively and let R be a relation from A to B.
Then R can be represented by the mn matrix

MR = [mij ] where

1 if (a , b ) ∈ R
i j
mij =
0 if (ai , bj ) ∈
/R

The matrix MR is called the matrix of R.

(P P Savani University) Set, Relation & Function July 14, 2022 53 / 103
Relation Representing Relations

Example: Suppose that A = {1, 2, 3} and B = {1, 2}. Let R be the relation from
A to B containing (a, b) if a ∈ A, b ∈ B, and a > b. What is the matrix representing
R?
Solution: Because R = {(2, 1), (3, 1), (3, 2)}, the matrix for R is
 
0 0
MR = 1 0
 

1 1

The 1s in MR show that the pairs (2, 1), (3, 1), and (3, 2) belong to R. The 0s show
that no other pairs belong to R. J

(P P Savani University) Set, Relation & Function July 14, 2022 54 / 103
Relation Representing Relations

Example: Let A = {a1 , a2 , a3 } and B = {b1 , b2 , b3 , b4 , b5 }. Which ordered pairs are


in the relation R represented by the matrix
 
0 1 0 0 0
MR = 1 0 1 1 0?
 

1 0 1 0 1

Solution: Because R consists of those ordered pairs (ai , bj ) with mij = 1, it follows
that R = {(a1 , b2 ), (a2 , b1 ), (a2 , b3 ), (a2 , b4 ), (a3 , b1 ), (a3 , b3 ), (a3 , b5 )}. J

(P P Savani University) Set, Relation & Function July 14, 2022 55 / 103
ji ij
i,for all pairs of integers the i and relation
j with hasi certain 2,properties.
= 1, Relation andRecall
. . . , n Representing that . , n. R on A is reflexive if (a, a) ∈
2, .a.relation
j = 1,Relations
thatofis,
nition theif transpose
MR is a symmetric a ∈ A. Thus,
of a matrixmatrix. R is
The form
from Section reflexive
ofwe
2.6, if
thesee and
matrix only
that for if (a i i ) ∈ relation
R isa symmetric, a
symmetric R for i = 1, 2, . . . , n. Hence, R
is illustrated
in1 Figure 2(a). if and only if m ii = 1, for i = 1, 2, . . . , n. In other words, R is reflexive if all the
1 The relation R is antisymmetric if and onlyRif (a, b) ∈ R and (b, a) ∈ R imply that
the main diagonal of M are equal to 1, as shown in Figure a = b.
1. Note that the elem
t 1
, Consequently, the matrix of an antisymmetric relation has the property that if mij = 1 with
main diagonal can be either 0 or 1.
i  = j , then mj i = 0. Or, inThe words, Reither
otherrelation mij = 0 orifm(a,
is symmetric b) ∈ R implies that (b, a) ∈ R. Conse
j i = 0 when i  = j . The form of
the matrix
symmetric for
matrix. 1 an relation
antisymmetric R on
relationthe set A =
for aissymmetric {a , a
illustrated1 relation , .
in 2Figure. . , a n } is symmetric if and only if (aj , ai ) ∈ R
is 2(b).
1The form(a of the matrix
, a ) ∈ R.
illustrated
i j
The Zero–One In terms of the entries
Matrix for a Reflexive Relation. of M R , R is symmetric if and only if mj i =
R isFIGURE m = 1.
ij if (a, This ∈ R and (b, a) ∈j iR imply that a =mb.
also means m = 0 whenever ij = 0. Consequently, R is symm
0b)=
1
antisymmetric
1 if and only
e matrix
1 The
of an Matrix
antisymmetric only if m
relation m j i property that if m = 1 withj with i = 1, 2, . . . , n and j =
ij 0 has the , for all pairs of integers i and
0 ij
of from Section 2.6, we see that R i
Zero–One
= 0. for other words, either mij = 0 or mj i = 0ofwhen
Or,ainReflexive Recalling the definition the transpose
i = j . The of aform
matrix
1 0if and only if
antisymmetric
Relation. relation is illustrated
(Off 0 in Figure 2(b).
0 The Zero–One 1 Matrix for a Symmetric Relation.
Diagonal Ele-
1 MR = (MR )t ,
ments Can0
(a) Symmetric (b) Antisymmetric
Be 0 or 1.) 0 that is, if MR is a symmetric matrix. The form of the matrix for a symmetric relation
FIGURE 2 The Zero–One Matrices for
0 in Figure 2(a).
Symmetric and Antisymmetric Relations.
0 The relation R is antisymmetric if and only if (a, b) ∈ R and (b, a) ∈ R imply
1 The Zero–One Matrix for a Antisymmetric Relation.
Consequently, the matrix of an antisymmetric relation has the property that if m
(b) Antisymmetric
3 Suppose that the relation i =R jon, then = 0. Or, inby
a setmisj irepresented other matrix either mij = 0 or mj i = 0 when i = j . T
the words,
(P P Savani University)
the matrix for an antisymmetric relation
Set, Relation & Function
is illustrated in Figure 2(b).
July 14, 2022 56 / 103
Relation Representing Relations

Example: Suppose that the relation R on a set is represented by the matrix


 
1 1 0
MR = 1 1 1
 

0 1 1

Is R reflexive, symmetric, and/or antisymmetric?


Solution: Because all the diagonal elements of this matrix are equal to 1,R is
reflexive. Moreover, because MR is symmetric, it follows that R is symmetric. It is
also easy to see that R is not antisymmetric. J

(P P Savani University) Set, Relation & Function July 14, 2022 57 / 103
Relation Representing Relations

Representing Relations

Representing Relations Using Digraphs

A directed graph, or digraph, consists of a set V of vertices (or nodes) together


with a set E of ordered pairs of elements of V called edges (or arcs). The
vertex a is called the initial vertex of the edge (a, b), and the vertex b is called
the terminal vertex of this edge.

An edge of the form (a, a) is represented using an arc from the vertex a back to itself.
Such an edge is called a loop.

(P P Savani University) Set, Relation & Function July 14, 2022 58 / 103
Relation Representing Relations
An edge of the form (a, a
an edge is called a loop.

Example: Draw directed graph withEXAMPLE vertices a, b, 7


c, and d, directed
The and edgesgraph
(a, b),with
(a, d),
vert
(b, b), (b, d), (c, a), (c, b), and (d, b). (c, b), and (d, b) is displayed
Solution:
a b
The relation R on a set A
vertices and the ordered pairs
to-one correspondence betwe
set of vertices. Thus, every st
graphs, and vice versa. Direc
such, they are often used to s
d c A to a set B can be represent
A Directed Graph. A and a vertex for each J elem
FIGURE 3 representation provides much
A Directed Graph. use of directed graphs to repr
(P P Savani University) Set, Relation & Function July 14, 2022 59 / 103
Relation Solution: Because there are l
Representing Relations

Example: Draw directed graph of the relation


neither symmetric nor antisym
a, but there are edges in both
R = {(1, 1), (1, 3), (2, 1), (2, 3), (2, 4), (3, 1),there
(3, 2),is(4, edge from a to b a
an1)}

on the set {1, 2, 3, 4}.


Solution:
1 2
1 2

4 3 4 3
J
(P P Savani University)
FIGURE 4 The
Set, Relation & Function
FIGURE
July 14, 2022
5 60 /The
103
Relation Representing Relations

Example: What are the ordered pairs in the relation R represented by the directed
graph shown in Figure a
1 2
1 2

b
4 3 4 3 (a) Directed graph o

Solution: The ordered pairs (x, y) in the relation are


IGURE 4 The FIGURE 5 The FIGURE 6 The
Directed Graph Directed Graph Relations R and
f the Relation = {(1, 3), (1, 4), (2,of
R R. 1),the
(2, 2), (2, 3), (3,R.1), (3, 3), (4, 1), (4, 3)}.
Relation
J
(P P Savani University) Set, Relation & Function July 14, 2022 61 / 103
Relation Representing Relations

The directed graph representing a relation can be used to determine whether the
relation has various properties.
1 A relation is reflexive if and only if there is a loop at every vertex of the
digraph.
2 A relation is symmetric if and only if for every edge between distinct vertices
in its digraph there is an edge in the opposite direction.
3 A relation is antisymmetric if no two distinct points in the digraph have an
edge going between them in both directions.
4 A relation is transitive if and only if whenever there is a directed edge from a
vertex a to a vertex b and from a vertex b to vertex c, then there is also a
directed edge from a to c.

(P P Savani University) Set, Relation & Function July 14, 2022 62 / 103
b and c.
are edges in both directions connectingRelation Finally,
Representing R is not transitive because
Relations
dge from a to b and an edge from b to c, but no edge from a to c.
Example: Determine whether the relation R for the directed graphs shown in Figure are
reflexive, symmetric, antisymmetric, and/or transitive.
a b
a
1 2

b c c d
4 Solution: 3 Because there are loops
(a) Directed
at every graph of R of the directed
vertex (b) Directed graphofof R,
graph S it is
reflexive. R is neither symmetric nor antisymmetric because there is an edge from a to
FIGURE 5 The FIGURE 6 The Directed Graphs of the
b but not one from b to a, but there are edges in both directions connecting b and c.
Directed Graph Relations R and S.
Finally,
f the R is not
Relation R. transitive because there is an edge from a to b and an edge from b to c,
but no edge from a to c. J
(P P Savani University) Set, Relation & Function July 14, 2022 63 / 103
e from b to c, but no edge from a to c. Relation Representing Relations

Example: Determine whether the relation S for the directed graphs shown in Figure are
reflexive, symmetric, antisymmetric, and/or transitive.
a b
a

b c c d
(a) Directed
Solution: graph of
Because R are not
loops (b)present
Directed at allofthe
graph S vertices of the directed graph of
S,this relation is not reflexive. It is symmetric and not antisymmetric, because every
FIGURE 6 The Directed Graphs of the
edge between distinct vertices is accompanied by an edge in the opposite direction. It is
Relations R and S.
also not hard to see from the directed graph that S is not transitive, because (c, a) and
(a, b) belong to S, but (c, b) does not belong to S. J
(P P Savani University) Set, Relation & Function July 14, 2022 64 / 103
Relation Hasse Diagram

Hasse Diagram

We can represent a finite poset (S, ) using this procedure: Start with the directed
graph for this relation. Because a partial ordering is reflexive, a loop (a, a) is present
at every vertex a. Remove these loops.
Next, remove all edges that must be in the partial ordering because of the presence
of other edges and transitivity. That is, remove all edges (x, y) for which there is an
element z ∈ S such that x ≺ z and z ≺ x.
Finally, arrange each edge so that its initial vertex is below its terminal vertex.
Remove all the arrows on the directed edges, because all edges point “upward” toward
their terminal vertex.
The resulting diagram is called the Hasse diagram of (S, )
(P P Savani University) Set, Relation & Function July 14, 2022 65 / 103
Relation Hasse Diagram

9.6 Pa
For instance, consider the directed graph for the partial ordering {(a, b)|a ≤ b} on
the set {1, 2, 3, 4}, shown in Figure(a).
4 4 4

3 3 3

2 2 2

1 1 1
(a) (b) (c)

Because this relation is aFIGURE


partial 2ordering, it is reflexive,
Constructing and its directed graph has
the Hasse Diagram
for ({1, 2, 3, 4}, ≤).
loops at all vertices.Consequently, we do not have to show these loops because they

(P P Savani University) Set, Relation & Function July 14, 2022 66 / 103
Relation Hasse Diagram

must be present; in Figure (b) loops are not shown. Because a partial ordering
is transitive, we do not have to show those edges that must be present because of
transitivity. For example, in Figure (c) the edges (1, 3), (1, 4), and (2, 4) are not shown
because they must be present. If we assume that all edges are pointed “upward” (as
they are drawn in the figure), we do not have to show the directions of the edges;
Figure (c) does not show directions.

(P P Savani University) Set, Relation & Function July 14, 2022 67 / 103
Relation Hasse Diagram

Example: Draw the Hasse diagram representing the partial ordering {(a, b)|a divides b}
on {1, 2, 3, 4, 6, 8, 12}.
Relations

Solution: Begin with the digraph for this partial order, as shown in Figure (a).
8 12 8 12 8 12

4 6 4 6
4 6

2 3
2 3
2 3

1 1 1

(a) (b) (c)

(P P Savani University) Set, Relation & Function July 14, 2022 68 / 103
Relation Hasse Diagram

Remove all loops, as shown in Figure (b). Then delete all the edges implied by the
transitive property. These are (1, 4), (1, 6), (1, 8), (1, 12), (2, 8), (2, 12), and (3, 12).
Arrange all edges to point upward, and delete all arrows to obtain the Hasse diagram.
The resulting Hasse diagram is shown in Figure (c). J

(P P Savani University) Set, Relation & Function July 14, 2022 69 / 103
Relation Hasse Diagram

Example: Draw the Hasse diagramSometimes there isordering


for the partial an element
{(A, in a poset
B)|A ⊆ B}that is gre
on the
element is called the greatest element. That is, a is the
power set P(S) where S = {a, b, c}.
Solution:
{a, b, c}

{a, c} {b, c}
{a, b}

{a} {b}
{c}

The Hasse Diagram of (P(S), ⊆). J


(P P Savani University)
FIGURE 4 The Hasse Diagram
Set, Relation & Function July 14, 2022 70 / 103
Relation Maximal and Minimal Elements

Maximal Elements
An element of a poset is called maximal if it is not less than any element of
the poset. That is, a is maximal in the poset (S, ) if there is no b ∈ S such
that a  b.

Minimal Elements
An element of a poset is called minimal if it is not greater than any element
of the poset. That is, a is minimal if there is no element b ∈ S such that b  a.

Maximal and minimal elements are easy to spot using a Hasse diagram. They are
the “top” and “bottom” elements in the diagram.

(P P Savani University) Set, Relation & Function July 14, 2022 71 / 103
in a poset that is greater than every other
Relation
element. Such an
Maximal and Minimal Elements

That is, a Which


nt.Example: is the greatest element
elements of of ({2,
the poset the 4,
poset 12, 
5, 10,(S, 20,) 25}, |) are maximal, and
which are minimal?
Solution:
12 20

4 10 25

2
5
The Hasse diagram in Figure for this poset shows that the maximal elements are
FIGURE 5 The Hasse
12, 20, and 25, and the minimal elements are 2 and 5. J
(P P Savani University) DiagramSet,ofRelation
a Poset.
& Function July 14, 2022 72 / 103
Relation Maximal and Minimal Elements

As this example shows, a poset can have more than one maximal
element and more than one minimal element.

(P P Savani University) Set, Relation & Function July 14, 2022 73 / 103
Relation Maximal and Minimal Elements

Greatest element & Least element


There is an element in a poset that is greater than every other element. Such
an element is called the greatest element. That is, a is the greatest element
of the poset (S, ) if b  a for all b ∈ S. The greatest element is unique when
it exists. Likewise, an element is called the least element if it is less than all
the other elements in the poset. That is, a is the least element of (S, ) if
a  b for all b ∈ S. The least element is unique when it exists

(P P Savani University) Set, Relation & Function July 14, 2022 74 / 103
Relation Maximal and Minimal Elements

9.6 Partial Orde


Example: Determine whether the posets represented by each of the Hasse diagrams
in Figure have a greatest element and a least element.
b c d d e d d

c c b c

a a b a b a

(a) (b) (c) (d)

Solution:FIGURE
The least6 element of the poset
Hasse Diagrams withPosets.
of Four Hasse diagram (a) is a. This poset
has no greatest element. The poset with Hasse diagram (b) has neither a least nor
if b  a for all b ∈ S. The greatest element is unique when it exists [see Exercis
a greatest Likewise,
element. anThe poset
element with Hasse
is called diagram
the least element(c)if ithas no than
is less leastallelement. Its
the other eleme
greatest element
poset. That is, aThe
is d. is theposet with Hasse
least element  ) if a 
of (S,diagram (d)b for b ∈ S.element
hasallleast The leasta element
and
when it d.
greatest element exists [see Exercise 40(b)]. J
(P P Savani University) Set, Relation & Function July 14, 2022 75 / 103
Relation Maximal and Minimal Elements

Upper bound and Lower bound


An element that is greater than or equal to all the elements in a subset A of a
poset (S, ). If u is an element of S such that a  u for all elements a ∈ A,
then u is called an upper bound of A. Likewise, there may be an element
less than or equal to all the elements in A. If l is an element of S such that
l  a for all elements a ∈ A, then l is called a lower bound of A.

(P P Savani University) Set, Relation & Function July 14, 2022 76 / 103
Relation
all the elements in A. If l is an eleme
Maximal and Minimal Elements

Example: Find the lower and upper bounds of the called a lower
subsets {a,bound of A.
b, c}, {j, h}, and
EXAMPLE
{a, c, d, f } in the poset with the Hasse diagram 18 Find
shown the lower and upper bounds of
in Figure
h with the Hasse diagram shown in Fig
j

g f Solution: The upper bounds of {a, b,


are no upper bounds of {j, h}, and its
of {a, c, d, f } are f , h, and j , and its
d e
The element x is called the least
is less than every other upper bound o
b c it makes sense to call this element the
least upper bound of A if a  x when
a A. Similarly, the element y is called
A and z  y whenever z is a lower b
Solution: The upper bounds ofFIGURE {a, b, c} are e, f, j, and
7 The h, and its only lower bound
exists [see Exercise 42(b)]. The great
is a. There are no upper boundsHasseof {j,Diagram
h}, and ofits lower bounds
denoted are a,and
by glb(A) b, c, d, e, and
lub(A), respec
a Poset.
f . The upper bounds of {a, c, d, f } are f, h, and j, and its lower bound is a. J
(P P Savani University) Set, Relation & Function July 14, 2022 77 / 103
Relation Maximal and Minimal Elements

Least upper bound and Greatest lower bound


The element x is called the least upper bound of the subset A if x is an
upper bound that is less than every other upper bound of A. That is, x is the
least upper bound of A if a  x whenever a ∈ A, and x  z whenever z is
an upper bound of A. Similarly, the element y is called the greatest lower
bound of A if y is a lower bound of A and z  y whenever z is a lower bound
of A. The greatest lower bound of A is unique if it exists. The greatest lower
bound and least upper bound of a subset A are denoted by glb(A) and lub(A),
respectively.

(P P Savani University) Set, Relation & Function July 14, 2022 78 / 103
Relation
all the elements in A. If l is an eleme
Maximal and Minimal Elements

called
Example: Find the greatest lower bound and the least a lower
upper bound
bound {b,A.d, g}, if
of of
EXAMPLE 18 Find the lower and upper bounds of
they exist, in the poset shown in Figure
h with the Hasse diagram shown in Fig
j

g f Solution: The upper bounds of {a, b,


are no upper bounds of {j, h}, and its
of {a, c, d, f } are f , h, and j , and its
d e
The element x is called the least
is less than every other upper bound o
b c it makes sense to call this element the
least upper bound of A if a  x when
a A. Similarly, the element y is called
A and z  y whenever z is a lower b
{b, d, g} 7areThe
Solution: The upper bounds ofFIGURE g and h. Because g < h, g is the least
exists [see Exercise 42(b)]. The great
of {b,
upper bound. The lower boundsHasse Diagram
d, g} areof a and b. Because
denoted by glb(A)a and
< b, b is the
lub(A), respec
greatest lower bound. a Poset. J
(P P Savani University) Set, Relation & Function July 14, 2022 79 / 103
Relation Maximal and Minimal Elements

Example: Find the greatest lower bound and the least upper bound of the sets
{3, 9, 12} and {1, 2, 4, 5, 10},if they exist, in the poset (Z + , |).
Solution: An integer is a lower bound of {3, 9, 12} if 3, 9, and 12 are divisible by
this integer. The only such integers are 1 and 3. Because 1|3, 3 is the greatest lower
bound of {3, 9, 12}.The only lower bound for the set {1, 2, 4, 5, 10} with respect to |
is the element 1. Hence, 1 is the greatest lower bound for {1, 2, 4, 5, 10}.
An integer is an upper bound for {3, 9, 12} if and only if it is divisible by 3, 9, and 12.
The integers with this property are those divisible by the least common multiple of
3, 9, and 12, which is 36. Hence, 36 is the least upper bound of {3, 9, 12}. A positive
integer is an upper bound for the set {1, 2, 4, 5, 10} if and only if it is divisible by 1,
2, 4, 5, and 10. The integers with this property are those integers divisible by the
least common multiple of these integers, which is 20. Hence, 20 is the least upper
bound of {1, 2, 4, 5, 10}.
(P P Savani University) Set, Relation & Function July 14, 2022 80 / 103
Function

Definition of Function

(P P Savani University) Set, Relation & Function July 14, 2022 81 / 103
Function Definition of Function

Function
Let A and B be nonempty sets. A function f from A to B is an assignment of
exactly one element of B to each element of A. We write f (a) = b if b is the
unique element of B assigned by the function f to the element a of A. If f is
a function from A to B, we write f : A → B.

Remark: Functions are sometimes also called mappings or transformations.

(P P Savani University) Set, Relation & Function July 14, 2022 82 / 103
of f is the set ofFunction
all images of elements
Domain, A. Also, if f is a function fro
ofRange
Codomain and
that f maps A to B.
Domain, Codomain and Range
Figure 2 represents a function f from A to B.
If f is a function from A to
When we B, we asay
define that we
function A is the domain
specify of fitsand
its domain, B is the
codomain, and the m
codomain of f . Ifof fthe
(a)domain
= b, weto say that binisthe
elements the image ofTwo
codomain. a and a is a preimage
functions are equal when
of b. The range,domain,
or image,have
ofthe same
f is thecodomain,
set of all and map of
images each elementofofA.
elements their common
Also,
element in their common codomain. Note that if we change either the doma
if f is a function from A to B, we say that f maps A to B.

a b = f(a)

A B
f

The2 Function
FIGURE f Maps
The Function AA
f Maps totoB.
B.
(P P Savani University) Set, Relation & Function July 14, 2022 83 / 103
Function Domain, Codomain and Range

Example: What are the domain, codomain, and range of the function that assigns
grades to students in below data?
Adams A

Chou B

Goodfriend C

Rodriguez D

Stevens F

Solution: Let G be theFIGURE


function1that assigns a of
Assignment grade
Gradesto ainstudent in Mathematics
a Discrete our discrete C
mathematics class. Note that G(Adams) = A, for instance. The domain of G is the
set {Adams, Chou, Goodfwhich
riend,are functions defined
Rodriguez, in terms
Stevens}, andof the
themselves,
codomainare used througho
is the set
will be studied in Chapter 5. This section reviews the basic concepts in
{A, B, C, D, F }. The range of G is the set {A, B, C, F }, because each grade except
in discrete mathematics.
D is assigned to some student. J
(P P Savani University) Set, Relation & Function July 14, 2022 84 / 103
Function Domain, Codomain and Range

Example: Let R be the relation with ordered pairs (Abdul, 22), (Brenda, 24),
(Carla, 21), (Desire, 22), (Eddie, 24), and (F elicia, 22). Here each pair consists
of a graduate student and this student’s age. Specify a function determined by this
relation.
Solution: If f is a function specified by R, then f (Abdul) = 22, f (Brenda) = 24,
f (Carla) = 21, f (Desire) = 22, f (Eddie) = 24, and f (F elicia) = 22. (Here, f (x)
is the age of x, where x is a student.)
For domain take the set {Abdul, Brenda, Carla, Desire, Eddie, F elicia}.
For codomain contain all possible ages of students. we take it as all positive integers.
And the range of the function we have specified is the set of different ages of these
students, which is the set {21, 22, 24}. J

(P P Savani University) Set, Relation & Function July 14, 2022 85 / 103
Function Domain, Codomain and Range

Let f be a function from A to B and let S be a subset of A. The image of


S under the function f is the subset of B that consists of the images of the
elements of S. We denote the image of S by f (S).

Remark: The notation f (S) for the image of the set S under the function f is
potentially ambiguous. Here, f (S) denotes a set, and not the value of the function
f for the set S.
Example: Let A = {a, b, c, d, e} and B = {1, 2, 3, 4} with f (a) = 2,f (b) = 1,f (c) =
4, f (d) = 1, and f (e) = 1. The image of the subset S = {b, c, d} is the set f (S) =
{1, 4}. J

(P P Savani University) Set, Relation & Function July 14, 2022 86 / 103
Function Type of Function

Type of Function

One-to-One Function
A function f is said to be one-to-one, or an injunction, 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
injective if it is one-to-one.

(P P Savani University) Set, Relation & Function July 14, 2022 87 / 103
Function Type of Function

Example: Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5} with


f (a)
142= 4,2 f/ (b) = 5,
Basic f (c) = 1,Sets,
Structures: andFunctions,
f (d) = 3 Sequences,
is one-to-one?
Sums, and Matrices
Solution: The function f is one-to-one because f takes on different values at the
four elements of its domain. This is illustrated in Figure
a 1

b 2

c 3

d 4

FIGURE 3 A One-to-One Function. J


(P P Savani University) Set, Relation & Function July 14, 2022 88 / 103
Function Type of Function

Example: Determine whether the function f (x) = x2 from the set of integers to the
set of integers is one-to-one.
Solution: The function f (x) = x2 is not one-to-one because, for instance,
f (1) = f (−1) = 1, but 1 6= −1. J

(P P Savani University) Set, Relation & Function July 14, 2022 89 / 103
Function Type of Function

Onto Function
A function f from A to B is called onto, or a surjection, if and only if for every
element b ∈ B there is an element a ∈ A with f (a) = b. A function f is called
surjective if it is onto.

(P P Savani University) Set, Relation & Function July 14, 2022 90 / 103
Function Type of Function

Example: 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 function?
Solution: Because all three elements of the codomain are images of elements in
the domain, we see that f is onto. This is illustrated in Figure. Note that if the
codomain were {1, 2, 3, 4}, then f would not be onto.
a

b 1

c 2

d 3

FIGURE 4 An Onto Function. J

(P P Savani University) Set, Relation & Function July 14, 2022 91 / 103
Function Type of Function

Example: Is the function f (x) = x2 from the set of integers to the set of integers
onto?
Solution: The function f is not onto because there is no integer x with x2 = −1,for
instance. J

(P P Savani University) Set, Relation & Function July 14, 2022 92 / 103
Function Type of Function

Bijective
The function f is a one-to-one correspondence, or a bijection, if it is both
one-to-one and onto. We also say that such a function is bijective.

Example: Let f be the function from {a, b, c, d} to {1, 2, 3, 4} with f (a) = 4, f (b) =
2, f (c) = 1, and f (d) = 3. Is f a bijection?
Solution: 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. J

(P P Savani University) Set, Relation & Function July 14, 2022 93 / 103
Function Type of Function

(a) One-to-one, (b) Onto, (c) One-to-one, (d) Neither one-to-one (e) N
not onto not one-to-one and onto nor onto
1 a a 1 a 1
a 1 a
2 b b 2 b 2
b 2 b
es, Sums, and Matrices 3 c c 3 c 3
c 3 c
4 d d 4 d 4
One-to-one, (d) Neither one-to-one (e) Not a function
and onto nor onto
FIGURE
1 a 5 Examples of1 Different Types of Correspondences.
1
a
2 b 2 2
Solution:b This function is onto, because for every integer y there
3 c f (x)3 = y. To see this, note
3 that f (x) = y if and only if x + 1 = y,
x = y −c 1.
4 d 4 4

EXAMPLE 15
(P P Savani University) ConsiderSet,
theRelation
function f in Example 11 that assigns
& Function jobs
July 14, 2022 to workers
94 / 103
Function Type of Function

A function f whose domain and codomain are subsets of the set of real numbers
is called increasing if f (x) ≤ f (y), and strictly increasing if f (x) < f (y),
whenever x < y and x and y are in the domain of f . Similarly, f is called
decreasing if f (x) ≥ f (y), and strictly decreasing if f (x) > f (y), whenever
x < y and x and y are in the domain of f . (The word strictly in this definition
indicates a strict inequality.)

(P P Savani University) Set, Relation & Function July 14, 2022 95 / 103
Function Type of Function

Note

Suppose that f : A → B.
To show that f is injective Show that if f (x) = f (y) for arbitrary x, y ∈ A
with x 6= y,then x = y.
To show that f is not injective Find particular elements x, y ∈ A such that
x 6= y and f (x) = f (y).
To show that f is surjective Consider an arbitrary element y ∈ B and find
an element x ∈ A such that f (x) = y.
To show that f is not surjective Find a particular y ∈ B such that f (x) 6= y
for all x ∈ A.

(P P Savani University) Set, Relation & Function July 14, 2022 96 / 103
f is not one-to-one,Function
some element b in the codomain is the image of more th
Inverse Function
the domain. If f is not onto, for some element b in the codomain, no elemen
exists for which f (a) = b. Consequently, if f is not a one-to-one correspon
Inverse Functions
assign to each element b in the codomain a unique element a in the domain su
Let f be a one-to-one
(becausecorrespondence
for some b therefrom themore
is either set Athanto the
one set
suchB. The
a or no inverse
such a).
function of f is theA function that assigns to an element b belonging
one-to-one correspondence is called invertible because we to B can
the define
unique elementfunction. A function
a in A such is not
that f (a) = b.invertible
The inverse if it function
is not a one-to-one correspond
of f is denoted
inverse of such a function does not exist.
by f −1 . Hence, f −1 (b) = a when f (a) = b.

f –1(b)

a = f –1(b) f (a) b = f (a)

f –1

A B

(P P Savani University) Set, Relation & Function July 14, 2022 97 / 103
Function Inverse Function

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 it is, what is its inverse?
Solution: 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, and f −1 (3) = b. J

Example: Let f : Z → Z be such that f (x) = x + 1. Is f invertible, and if it is,


what is its inverse?
Solution: The function f has an inverse because it is a one-to-one correspondence.
To reverse the correspondence, suppose that y is the image of x, so that y = x + 1.
Then x = y − 1. This means that y − 1 is the unique element of Z that is sent to y
by f . Consequently, f −1 (y) = y − 1. J
(P P Savani University) Set, Relation & Function July 14, 2022 98 / 103
Function Composite Function

Composition of the Functions


Let g be a function from the set A to the set B and let f be a function from
the set B to the set C. The composition of the functions f and g, denoted for
2.3 Functions 147
all a ∈ A by f ◦ g, is defined by (f ◦ g)(a) = f (g(a)).
(f g)(a)

g(a) f( g(a))

a g(a) f (g(a))

g f

A B C

f g

(P P Savani University) Set, Relation & Function July 14, 2022 99 / 103
Function Composite Function

Example: 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: The composition f ◦ g is defined by

(f ◦ g)(a) = f (g(a)) = f (b) = 2


(f ◦ g)(b) = f (g(b)) = f (c) = 1, and
(f ◦ g)(c) = f (g(c)) = f (a) = 3.

Note that g ◦ f is not defined, because the range of f is not a subset of the domain
of g.

(P P Savani University) Set, Relation & Function July 14, 2022 100 / 103
Function Composite Function

Some Important Function


Floor Function
The floor function assigns to the real number x the largest integer that is less
than or equal to x. The value of the floor function at x is denoted by bxc.
The ceiling function assigns to the real number x the smallest integer that is
greater than or equal to x. The value of the ceiling function at x is denoted by
dxe.

Remark: The floor function is often also called the greatest integer function. It is
often denoted by [x].
b 12 c = 0, d 12 e = 1, b− 21 c = −1, d− 12 e = 0, b3.1c = 3, d3.1e = 4, b7c = 7, d7e = 7
(P P Savani University) Set, Relation & Function July 14, 2022 101 / 103
Function Composite Function

Recursive Function
A function is said to be recursive if and only if it can be obtained from the
initial functions and by it self.

Example: n! = n(n − 1)! where 0! = 1

(P P Savani University) Set, Relation & Function July 14, 2022 102 / 103
Function Composite Function

τ ~αnk Ψφu !!

(P P Savani University) Set, Relation & Function July 14, 2022 103 / 103

You might also like