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

Lecture Topic 1.2.2

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

Lecture Topic 1.2.2

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

Relation - definition, types, and

properties
Binary Relation
• A binary relation R from set A to set B is a subset of the Cartesian
product A×B.
R⊆A×B
• As in Cartesian product of two sets A and B, is the set of all possible
ordered pairs (a, b), where a ∈ A and b ∈ B:
A×B={(a,b)∣a∈A and b∈B}
Binary Relation
• A binary relation describes a relationship between the elements of two
sets.
• If A and B are sets, then a binary relation R from A to B is a subset of
the Cartesian product of A and B (A x B).
• Let A = {1, 2, 3} and B = {4, 5, 6}. Let R be a binary relation from A
to B as follows:
given any (x, y) € A x B, (x, y) € R ↔ y/x € Z
Binary Relation
Example
Binary Relation
Example
Graph Representation of a Binary Relation
Matrix Representation of Binary Relation
Relation
• A connection between the elements of two or more sets is Relation.
The sets must be non-empty.
• A subset of the Cartesian product also forms a relation R.
• A relation may be represented either by Roster method or by Set-
builder method.
• Let A and B be two sets such that A = {2, 5, 7, 8, 10, 13} and B = {1,
2, 3, 4, 5}.
• R = {(x, y): x = 4y – 3, x ∈ A and y ∈ B} (Set-builder form)
Relation
• R = {(5, 2), (10, 3), (13, 4)} (Roster form)
Types of Relations
• Empty Relation
• Universal Relation
• Identity Relation
• Inverse Relation
• Reflexive Relation
• Symmetric Relation
• Transitive Relation
• Equivalence Relation
Empty Relation
• If no element of set X is related or mapped to any element of X, then
the relation R in A is an empty relation, i.e, R = Φ.
• Consider an example of set A consisting of only 100 hens in a poultry
farm.
• Is there any possibility of finding a relation R of getting any elephant
in the farm?
• No! R is a void or empty relation since there are only 100 hens and no
elephant.
Universal Relation
• A relation R in a set, say A is a universal relation if each element of A
is related to every element of A, i.e., R = A × A.
• It is also called Full relation.
• Suppose A is a set of all natural numbers and B is a set of all whole
numbers.
• The relation between A and B is universal as every element of A is in
set B.
• Empty relation and Universal relation are sometimes called trivial
relation.
Identity Relation
• In Identity relation, every element of set A is related to itself only.
I = {(a, a), ∈ A}
• For example,
• If we throw two dice, we get 36 possible outcomes, (1, 1), (1, 2), … ,
(6, 6).
• A relation is defined as R: {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)}, it
is an identity relation.
Inverse Relation
• Let R be a relation from set A to set B i.e., R ∈ A × B.
• The relation R-1 is said to be an Inverse relation if R-1 from set B to A
is denoted by R-1 = {(b, a): (a, b) ∈ R}.
• Considering the case of throwing of two dice if R = {(1, 2), (2, 3)},
R-1 = {(2, 1), (3, 2)}.
• Here, the domain of R is the range of R-1 and vice-versa.
Reflexive Relation
• If every element of set A maps to itself, the relation is Reflexive
Relation.
• For every a ∈ A, (a, a) ∈ R.
• A relation R is A relation R is reflexive iff, for any x ∈ S, x R x.
• Example:
let R be defined as follows:
for all x, y ∈ S, x R y ↔ xy > 0 reflexive iff, for any x ∈ S, x R x.
Reflexive Relation
• Then R is reflexive, since:

-1 R -1 -1 * -1 > 0

1R1 1*1>0

2R2 2*2>0
Symmetric Relation
• A relation R on a set A is said to be symmetric if (a, b) ∈ R then (b, a)
∈ R, for all a & b ∈ A.
• A relation R is symmetric iff, for all x, y ∈ S, if x R y then y R x.
Symmetric Relation
Let R be defined as follows: for all x, y ∈ S, x R y ↔ x 2 + y > 0
R is symmetric as follows:
Note that this relationship is also by definition reflexive: if x R x.
then x R x.

-12+ 1 > 0 12+ -1 > 0

-12+ 2 > 0 22+ -1 > 0

12+ 2 > 0 22+ 1 > 0


Transitive Relation
• A relation in a set A is transitive if, (a, b) ∈ R, (b, c) ∈ R, then (a, c) ∈
R, for all a, b, c ∈ A
• A relation R is transitive iff, for all x, y S, if x R y and y R z then x R
z.
Transitive Relation
Let R be defined as follows:
for all x, y, z ∈ S, x R y ↔ x2+1 > y
R is transitive as follows:
for x = -1, y = 1, and z = 2;

-12+ 1 > 1 x2+1 > y

12+ 1 > 2 y2+1 > z


-12+ 1 > 2 x2+1 > z

This relationship holds for any other combination of x, y, z ∈ S.


Equivalence Relation and Partitions
• A relation is said to be equivalence if and only if it is Reflexive,
Symmetric, and Transitive.
• For example, if two dices are thrown, say A & B and note down all the
possible outcome.
• Define a relation R= {(a, b): a ∈ A, b ∈ B}, find that {(1, 1), (2, 2), …,
(6, 6) ∈ R} (reflexive).
⮚ If {(a, b) = (1, 2) ∈ R} then, {(b, a) = (2, 1) ∈ R} (symmetry). ).
⮚ If {(a, b) = (1, 2) ∈ R} and {(b, c) = (2, 3) ∈ R} then {(a, c) = (1, 3) ∈ R}
(transitive)
Properties of Equivalence Classes
• If R (also denoted by ∼) is an equivalence relation on set A, then
• Every element a∈A is a member of the equivalence class [a].
∀a∈A,a∈[a]
• Two elements a,b∈A are equivalent if and only if they belong to the
same equivalence class.
∀a,b∈A,a∼b iff [a]=[b]
• Every two equivalence classes [a] and [b] are either equal or disjoint.
∀a,b∈A,[a]=[b] or [a]∩[b]=∅
Example
Consider three right angle triangles T 1 with sides 3,4,5,
T2 with sides 5,12,13 and T3 with sides 6,8,10. Which
triangles among T1, T2 and T3 are related?
R = {(T1, T2): T1 is similar to T2}
T1 has sides 3, 4, 5, T2 has sides 5,12,13 and T3 has sides 6,8,10
Two triangles are similar if ratio of their sides are equal
For triangle T1 & T3
Ratio of sides 3/6=4/8=5/10=1/2. Since, ratio of sides is equal,
T1 & T3 are similar, i.e. T1 & T3 are related.
Partitions
• Let A be a set and A1,A2,…,An be its non-empty subsets. The subsets
form a partition P of A if

⋃i=1nAi=A1∪A2∪…∪An=A
• The union of the subsets in P is equal to A.

• The partition P does not contain the empty set ∅.


Ai≠∅∀i
• The intersection of any distinct subsets in P is empty.
Ai∩Aj=∅∀i≠j
Partitions
• There is a direct link between equivalence classes and partitions.
• For any equivalence relation on a set A, the set of all its equivalence
classes is a partition of A.
• The converse is also true.
• Given a partition P on set A, we can define an equivalence relation
induced by the partition such that a∼b if and only if the
elements a and b are in the same block in P.
Partial Order Relations
• A binary relation R on a set S is called a partial ordering, or partial
order if and only if it is Reflexive, Antisymmetric and Transitive.
• Partial order allow elements to “preceed” one another but not
necessarily.
• Examples:
⮚ subsets of a set are ordered partially
Partial Orders
Partial Orders
Functions and its Type
• A Function assigns to each element of a set, exactly one element of a
related set.
• A function or mapping (Defined as f:X→Y) is a relationship from
elements of one set X to elements of another set Y (X and Y are non-
empty sets).
• X is called Domain and Y is called Codomain of function ‘f’.
• Function ‘f’ is a relation on X and Y such that for each x ∈X, there
exists a unique y∈Y such that (x,y)∈R. ‘x’ is called pre-image and ‘y’
is called image of function f.
• A function can be one to one or many to one but not one to many.
Types of Functions
These are some of the types of function:
• Injective/ One-to-one Function
• Surjective/ Onto Function
• Bijective/One-to-one Correspondent (121 and on 2)
• Many-One Function
Injective/One-to-one Function:
• A function f:A→B is injective or one-to-one function if for every
b∈B, there exists at most one a∈A such that f(s)=t.
• This means a function f is injective
if a1≠a2a1≠a2 implies f(a1)≠f(a2)f(a1)≠f(a2).
• Example:
f:N→N,f(x)=5xf:N→N,f(x)=5x is injective.
f:N→N,f(x)=x2f:N→N,f(x)=x2 is injective.
f:R→R,f(x)=x2f:R→R,f(x)=x2 is not injective as (−x)2=x2(−x)2=x2
Surjective/Onto Function
• A function f:A→B is surjective (onto) if the image of f equals its range.
Equivalently, for every b∈B, there exists some a∈A such that f(a)=b.
• This means that for any y in B, there exists some x in A such
that y=f(x).
• Example:
f:N→N,f(x)=x+2 is surjective.
f:R→R,f(x)=x2 is not surjective since we cannot find a real number
whose square is negative.
Bijective/One-to-one Correspondent
• A function f:A→B is bijective or one-to-one correspondent if and only if f is
both injective and surjective.
• Prove that a function f:R→R defined by f(x)=2x–3 is a bijective function.
To prove this function is both injective and surjective.
If f(x1)=f(x2), then 2x1–3=2x2–3 and it implies that x1=x2.
Hence, f is injective.
Here, 2x–3=y
So, x=(y+5)/3 which belongs to R and f(x)=y.
Hence, f is surjective. Since f is both surjective and injective, therefore
f is bijective.
Many-One Function
• Let f: X → Y. The function f is said to be many-one functions if there
exist two or more than two different elements in X having the same
image in Y.
• Example:
Consider X = {1, 2, 3, 4, 5}
Y = {x, y, z} and f: X → Y such that
f = {(1, x), (2, x), (3, x), (4, y), (5, z)}
The function f is many-one function.
Composite Functions and Relation
• Let f : A → B and g : B → C be two functions.
• Then the composition of f and g, denoted by g ∘ f, is defined as the function
g ∘ f : A → C given by g ∘ f (x) = g(f (x)), ∀ x ∈ A.
• The order of function is an important thing while dealing with the
composition of functions since (f ∘ g) (x) is not equal to (g ∘ f) (x).
• Example
⮚ If f(x) = 3x+1 and g(x) = x2 , then f of g of x, f(g(x)) = f(x2) =
3x2+1.
⮚ If we reverse the function operation, such as f of f of x,
g(f(x)) = g(3x+1) = (3x+1)2
Properties of Function Compositions
• Associative Property: As per the associative property of function
composition, if there are three functions f, g and h, then they are said
to be associative if and only if;
f ∘ (g ∘ h) = (f ∘ g) ∘ h
• Commutative Property: Two functions f and g are said to be
commute with each other, if and only if;
g∘f=f∘g
Properties of Function Compositions
Few more properties are:
• The function composition of one-to-one function is always one to one.
• The function composition of two onto function is always onto
• The inverse of the composition of two functions f and g is equal to the
composition of the inverse of both the functions, such as (f ∘ g)-1 = (
g-1 ∘ f-1).
Facts about Composition
• If f and g are one-to-one then the function (gof) is also one-to-one.
• If f and g are onto then the function (gof) is also onto.
• Composition always holds associative property but does not hold
commutative property.
Applications
• Functions find their application in various fields like:
⮚ representation of the computational complexity of algorithms, counting
objects,
⮚ study of sequences and
⮚ strings, to name a few
Inverse of Relations and Functions

An inverse relation is the inverse of a relation and is obtained by interchanging the elements of each
ordered pair of the given relation. Let R be a relation from a set A to another set B. Then R is of the form
{(x, y): x ∈ A and y ∈ B}. The inverse relationship of R is denoted by R-1 and its formula is R-1 = {(y, x): y ∈
B and x ∈ A}. i.e.,
The first element of each ordered pair of R = second element of corresponding ordered pair of R-1.
The second element of each ordered pair of R = first element of corresponding ordered pair of R-1.
In simple words, if (x, y) ∈ R, then (y, x) ∈ R-1 and vice versa. i.e., If R is from A to B, then R-1 is from B to A.
Thus, if R is a subset of A x B, then R-1 is a subset of B x A.
Example:
The following relations and their inverse relations on two sets A = {a, b, c, d, e} and B = {1, 2, 3, 4, 5}.
If R = {(a, 2), (b, 4), (c, 1)} ⇔ R-1 = {(2, a), (4, b), (1, c)}
If R = {(c, 1), (b, 2), (a, 3)} ⇔ R-1 = {(1, c), (2, b), (3, a)}
If R = {(b, 3), (c, 2), (e, 1)} ⇔ R-1 = {(3, b), (2, c), (1, e)}
Domain and Range of Inverse Function:
The domain of a relation is the set of all first elements of its ordered pairs whereas the range is the set of
all second elements of its ordered pairs. Let us consider the first example from the list of above
Inverse of Relations and Functions

For R = {(a, 2), (b, 4), (c, 1)}, domain = {a, b, c} and range = {2, 4, 1}
For R-1 = {(2, a), (4, b), (1, c)}, domain = {2, 4, 1} and range = {a, b, c}
The domain and range interchanged for R and R-1 i.e.,
the domain of R-1 = the range of R and
the range of R-1 = the domain of R.
Note: If R is a symmetric relation (i.e., if (b, a) ∈ R, for every (a, b) ∈ R), then R = R-1. For example, consider a
symmetric relation R = {(1, a) (a, 1), (2, b), (b, 2)}. The inverse of this relation is, R-1 = {(a, 1), (1, a), (b, 2), (2, b)}.
Technically, R = R-1, because the order of elements is NOT important while writing a set. In this case, the
domain of R = range of R = domain of R-1 = range of R-1 = {1, 2, a, b}.
Inverse Relation Theorem
Statement: For any relation R, (R-1)-1 = R.
Proof: Here is the proof of the inverse relation theorem.
Let (x, y) ∈ R
⇔ (y, x) ∈ R-1
⇔ (x, y) ∈ (R-1)-1
Thus, (R-1)-1 = R.
Relevant Books
• Textbooks
⮚ C.L. Liu “Elements of Discrete Mathematics". McGraw Hill, 3rd Edition.
⮚ Santha,"Discrete Mathematics with Graph Theory, Cengage Learning, 1st
Edition.
• Reference Books
⮚ B. Kolaman, and R.C. Busby, “Discrete Mathematical Structures”, PHI, 1st
Edition.
⮚ Gersting, L. Judith “Mathematical Structures for computer Science”,
Computer Science Press.
• Links for e-book:
⮚ http://discrete.openmathbooks.org/pdfs/dmoi-tablet.pdf
References

• Other Resources:
⮚ https://www.csm.ornl.gov/~sheldon/ds/sec4.5.html
⮚ https://math24.net/binary-relations.html
⮚ https://www.toppr.com/guides/maths/relations-and-functions/types-of-relations/
Link of e-book
https://www.science4all.org/article/duality-in-linear-programming/
http://discrete.openmathbooks.org/pdfs/dmoi-tablet.pdf
weblinks :
https://www.javatpoint.com/algebra-of-sets
• https://www.javatpoint.com/principle-of-duality-in-discrete-mathematics
• PPT - Discrete Mathematics SETS PowerPoint Presentation, free download - ID:4004039 (slideserve.com)
• PPT - Discrete Mathematics: Set Operations and Identities PowerPoint Presentation - ID:5559797 (slideserv
e.com)
• VEDIOLINK:
• https://www.youtube.com/watch?v=wGLTV8MgLlA&list=PLU6SqdYcYsfJ27O0dvuMwafS3X8CecqUg
• https://www.youtube.com/watch?v=RW42KXPaw_A&list=PLmXKhU9FNesRORH5XXsErmamVvUT_zbG4

You might also like