0% found this document useful (0 votes)
951 views16 pages

Relation PDF

The document defines basic concepts related to sets and relations in discrete mathematics, including: - Sets are collections of distinct objects and can be empty, finite, or infinite. Examples include sets of numbers or people. - Relations associate objects in ordered pairs and can have properties like reflexivity, symmetry, and transitivity. Relations can be represented using graphs or matrices. - Equivalence relations partition a set into disjoint subsets where all elements in a subset are equivalent. Equivalence classes are the disjoint subsets that form this partition.

Uploaded by

Bhavesh Garg
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)
951 views16 pages

Relation PDF

The document defines basic concepts related to sets and relations in discrete mathematics, including: - Sets are collections of distinct objects and can be empty, finite, or infinite. Examples include sets of numbers or people. - Relations associate objects in ordered pairs and can have properties like reflexivity, symmetry, and transitivity. Relations can be represented using graphs or matrices. - Equivalence relations partition a set into disjoint subsets where all elements in a subset are equivalent. Equivalence classes are the disjoint subsets that form this partition.

Uploaded by

Bhavesh Garg
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/ 16

Discrete Math

(Set, Relation )
Sets
Set: collection of distinct objects
Example: attendees in this class; prime numbers

Objects: elements, or members, of the set

Set with no elements: empty, or null, set

Set of all even numbers between 1 and 10: {2,4,6,8,10}


Infinite set of all positive, even numbers: {2,4,6, …}
Readers of the Kohavi-Jha book living in Antarctica: most likely empty

2
Set Definitions
Universe U: set of all possible outcomes
Example: Rolling a die
• U = {f1, f2, f3, f4, f5, f6}
U has 26 = 64 subsets
• Null, {f1}, …, {f6}, {f1,f2}, …, {f5,f6}, {f1,f2,f3}, …, U

A=B: A and B are identical


A  B: A is a subset of B
A B: A is a proper subset of B
A+B: union of A and B
AB: intersection of A and B
A’: complement of A

3
Venn Diagrams
A
A B A B A

(a) AB. (b) A + B. (c) A .

A B B A

(d) AB = . (e) A B.

4
Ordered Pair
Ordered pair (a,b): specific order associated with a and b
• a: first coordinate
• b: second coordinate
Example: mother and daughter; teacher and student

Example: {(a,a), (a,b), (b,a), (b,c), (c,a)}

b
Generalization: Ordered n-tuple (a1, a2, …, an)

5
Binary Relation
Binary relation R: set of ordered pairs (a,b)

a R b: a is related to b by R

Cartesian product AxB: set of ordered pairs (a,b) s.t. a is in A and b is in B

Example: If A = {p,q} and B = {r,s,t}, then


AxB = {(p,r), (p,s), (p,t), (q,r), (q,s), (q,t)}

Relation from set A to A: relation in A – subset of AxA or A2

6
Properties of Relations
Relation R in set A is
 Reflexive if it contains (a,a) for every a in A
 Symmetric if existence of (a,b) in R implies the existence of (b,a)
 Transitive if existence of (b,a) and (a,c) in R implies existence of (b,c)
Example: Relation {(a,a), (b,b), (a,b)} – reflexive and transitive, but not
symmetric
Example: Relation {(a,b), (b,a)} – symmetric, but not transitive since it
does not contain (a,a)

Binary relation R in set S: equivalence relation if it is reflexive, symmetric


and transitive
Example: Relation = is an equivalence relation since it satisfies for all
a, b, and c in R
• Reflexive: a = a
• Symmetric: If a = b, then b = a
7 • Transitive: If a = b and b = c, then a = c
Equivalence Classes
Equivalence relation: partitions elements of a set into disjoint subsets s.t. all
members of a subset are equivalent and members of different subsets
are not equivalent

Disjoint subsets: equivalence classes

Example: Relation of parallelism between lines in a plane

a d
b e
c
f

R = {(a,a), (b,b), (c,c), (d,d), (e,e), (f,f), (a,b), (b,a), (a,c), (c,a), (b,c), (c,b),
(d,e), (e,d)}
Equivalence classes: {a,b,c}, {d,e}, {f}
8
Representation of Relations
 Representation of Relations using Graph

 Representation of Relations using Matrix

Representation of Relations using Graph:

A relation can be represented using a directed graph.

✓ The number of vertices in the graph is equal to the number of elements


in the set from which the relation has been defined.

✓ For each ordered pair (x, y) in the relation R, there will be a directed
edge from the vertex ‘x’ to vertex ‘y’.

✓ If there is an ordered pair (x, x), there will be self- loop on vertex ‘x’.
Suppose there is a relation
R={(a, a),(b, b),(c, c),(a, b),(b, c), (c, b), (c, a)} on the set
S= {a, b, c}, it can be represented by the following graph
Your Task
1. Draw the directed graph that represents the relation
R ={(1,1), (2, 2), (1, 2), (2, 3), (3,2), (3,1), (3,3)} on the set
S = {1, 2, 3}.
2. Write the relation as a set of ordered pairs from the
digraph as shown below
1 3 4
1 1 1 0
𝑀𝑅 = 3 0 1 0
4 0 0 1

Reflexive : If all the elements in the main diagonal of the


matrix representation of a relation are , then the
relation is reflexive .
1 1 0
MR = 1 1 0
1 0 1
Note : If all 𝑀𝑖𝑖 = 0, the relation is irreflexive.
0 1 0 1 1 0
MR1 = 1 0 1 and MR2 = 1 0 0 , here
1 0 0 1 0 1
MR1 is irreflexive and MR2 is non reflexive
Symmetric: If the representative matrix of a relation is
symmetric with respect to the main diagonal then the
relation is symmetric (i.e. 𝑀𝑅 = 𝑀𝑅𝑇 ).
1 0 1
0 1 0
1 0 0
Antisymmetric : A relation is antisymmetric if and only
if 𝑚𝑖𝑗 = 1 necessitates that 𝑚𝑗𝑖 = 0.
0 0 1
0 1 0
0 1 0
Transitive : A relation R is transitive if and only if
𝑀𝑅2 + 𝑀𝑅 = 𝑀𝑅
Your Task
Let A = {1, 2, 3, 4} and let R be a relation on A whose
1 1 1 1
matrix is M𝑅 = 0 0 0 0 . Show that R is transitive.
1 1 1 1
1 1 0 0
Matrix Representation of Composition:
The matrix for the composition of relations can be found
by using the Boolean product of the matrices i.e.
(𝑀𝑅∘𝑆 = 𝑀𝑅 . 𝑀𝑆 ).

1 0 1 0 1 0
𝑀𝑅 = 0 1 0 and 𝑀𝑆 = 1 1 0
0 0 0 0 0 1

0 1 1
𝑀𝑅∘𝑆 = 1 1 0
0 0 0
Reflexive Closure: The reflexive closure of a relation R
on A is obtained by adding (a, a) to R for each 𝑎 ∈ 𝐴 i.e.
𝑅 (𝑟) = 𝑅 ∪ 𝐼𝐴
where 𝐼𝐴 = { 𝑎, 𝑎 : 𝑎 ∈ 𝐴}.
Symmetric Closure : The symmetric closure of R is
obtained by adding (b, a) to R for each (a, b) ∈ R i.e.
𝑅 (𝑠) = 𝑅 ∪ 𝑅−1
where 𝑅 (𝑟) = { 𝑏, 𝑎 : (𝑎, 𝑏) ∈ 𝑅}.
Transitive Closure: The transitive closure of R is
obtained by repeatedly adding (a, c) to R for each (a, b)
∈ R and (b, c) ∈ R. Let R be the relation defined on A
and A contains m elements one can calculate transitive
closure as
𝑅+ = 𝑅 ∪ 𝑅2 ∪ 𝑅3 … ∪ 𝑅𝑚 .

You might also like