Cartesian Product
Cartesian Product or cross product of two non-empty sets A A A and B B B expressed as A × B A\times B A × B is a set of all ordered pairs ( a , b ) (a,b) ( a , b ) , where a ∈ A a\in A a ∈ A , b ∈ B b\in B b ∈ B .
Mathematically it can be written as:
A × B = { ( a , b ) ∣ a ∈ A , b ∈ B } A\times B=\{(a,b)|a\in A,b\in B\} A × B = {( a , b ) ∣ a ∈ A , b ∈ B }
E.g.: Considering A = { 1 , 2 } A=\{1,2\} A = { 1 , 2 } , B = { a , b , c } B=\{a,b,c\} B = { a , b , c } . Then the Cartesian Product is, A × B = { ( 1 , a ) , ( 1 , b ) , ( 1 , c ) , ( 2 , a ) , ( 2 , b ) , ( 2 , c ) } A\times B=\{(1,a),(1,b),(1,c),(2,a),(2,b),(2,c)\} A × B = {( 1 , a ) , ( 1 , b ) , ( 1 , c ) , ( 2 , a ) , ( 2 , b ) , ( 2 , c )} .
Figure 1: Relation map for A × B A\times B A × B :
Binary Relation
Let A A A and B B B be two non-empty sets. A binary relation R R R is a subset of A × B A\times B A × B , i.e. , R ⊆ A × B R\subseteq A\times B R ⊆ A × B . If ( a , b ) ∈ R (a,b)\in R ( a , b ) ∈ R , then it is written as a R b aRb a R b .
Considering A = { 1 , 2 , 3 } A=\{1,2,3\} A = { 1 , 2 , 3 } , B = { a , b } B=\{a,b\} B = { a , b } , then R R R could be, R = { ( 1 , a ) , ( 1 , b ) , ( 3 , b ) } R=\{(1,a),(1,b),(3,b)\} R = {( 1 , a ) , ( 1 , b ) , ( 3 , b )} .
Figure 2: Relation map for a R b aRb a R b :
Example 1: Let A = { 2 , 3 , 4 , 5 , 6 } A=\{2,3,4,5,6\} A = { 2 , 3 , 4 , 5 , 6 } . Define a relation a R b aRb a R b such that a a a divides b b b .
Given, A = { 2 , 3 , 4 , 5 , 6 } A=\{2,3,4,5,6\} A = { 2 , 3 , 4 , 5 , 6 } . The relation a R b aRb a R b , such that a a a divides b b b is:
a R b = { ( 2 , 2 ) , ( 2 , 4 ) , ( 2 , 6 ) , ( 3 , 3 ) , ( 3 , 6 ) , ( 4 , 4 ) , ( 5 , 5 ) , ( 6 , 6 ) } aRb=\{(2,2),(2,4),(2,6),(3,3),(3,6),(4,4),(5,5),(6,6)\} a R b = {( 2 , 2 ) , ( 2 , 4 ) , ( 2 , 6 ) , ( 3 , 3 ) , ( 3 , 6 ) , ( 4 , 4 ) , ( 5 , 5 ) , ( 6 , 6 )}
Example 2: Let A = { 0 , 1 , 2 , 3 , 4 } A=\{0,1,2,3,4\} A = { 0 , 1 , 2 , 3 , 4 } . Define a relation a R b aRb a R b such that a + b = 4 a+b=4 a + b = 4 .
Given, A = { 0 , 1 , 2 , 3 , 4 } A=\{0,1,2,3,4\} A = { 0 , 1 , 2 , 3 , 4 } . The relation a R b aRb a R b such that, a + b = 4 a+b=4 a + b = 4 , is:
a R b = { ( 0 , 4 ) , ( 1 , 3 ) , ( 2 , 2 ) , ( 3 , 1 ) , ( 4 , 0 ) } aRb=\{(0,4),(1,3),(2,2),(3,1),(4,0)\} a R b = {( 0 , 4 ) , ( 1 , 3 ) , ( 2 , 2 ) , ( 3 , 1 ) , ( 4 , 0 )}
Matrix of a relation
The matrix of a relation A × B A\times B A × B , where A A A has n n n elements, and B B B has m m m elements, is an n × m n\times m n × m matrix, M R M_R M R defined as follows:
M R = [ m i j ] M_R=[m_{ij}] M R = [ m ij ]
It can be perceived that:
m i j = 1 m_{ij}=1 m ij = 1 , if ( a i , b j ) ∈ R (a_i,b_j)\in R ( a i , b j ) ∈ R , and
m i j = 0 m_{ij}=0 m ij = 0 , if ( a i , b j ) ∉ R (a_i,b_j)\notin R ( a i , b j ) ∈ / R .
E.g.: Considering A = { 1 , 2 , 3 } A=\{1,2,3\} A = { 1 , 2 , 3 } , B = { a , b , c , d } B=\{a,b,c,d\} B = { a , b , c , d } , and a R b = { ( 1 , a ) , ( 2 , a ) , ( 3 , b ) , ( 3 , d ) } aRb=\{(1,a),(2,a),(3,b),(3,d)\} a R b = {( 1 , a ) , ( 2 , a ) , ( 3 , b ) , ( 3 , d )} . Then their matrix, M R M_R M R is:
M R = [ 1 0 0 0 1 0 0 0 0 1 0 1 ] M_R={\begin{bmatrix}
1&0&0&0\\
1&0&0&0\\
0&1&0&1\\
\end{bmatrix}} M R = 1 1 0 0 0 1 0 0 0 0 0 1
While drawing matrix, the first element in the relation is taken as the row, and the second element is taken as the column.
Di-graph
Di-graph stands for directed graph . It is used to map out the relation between elements of sets. Considering a relation a R b = { ( 1 , a ) , ( 2 , a ) , ( 3 , b ) , ( 3 , d ) } aRb=\{(1,a),(2,a),(3,b),(3,d)\} a R b = {( 1 , a ) , ( 2 , a ) , ( 3 , b ) , ( 3 , d )} , we have the following di-graph, for it:
Example 3: Let A = { 0 , 1 , 2 , 3 , 4 } A=\{0,1,2,3,4\} A = { 0 , 1 , 2 , 3 , 4 } . Define a relation a R b aRb a R b , such that a + b = 4 a+b=4 a + b = 4 . Define its relation matrix and draw its di-graph.
For the set A = { 0 , 1 , 2 , 3 , 4 } A=\{0,1,2,3,4\} A = { 0 , 1 , 2 , 3 , 4 } , we have a relation such that a + b = 4 a+b=4 a + b = 4 . Therefore we have, a R b = { ( 0 , 4 ) , ( 1 , 3 ) , ( 2 , 2 ) , ( 3 , 1 ) , ( 4 , 0 ) } aRb=\{(0,4),(1,3),(2,2),(3,1),(4,0)\} a R b = {( 0 , 4 ) , ( 1 , 3 ) , ( 2 , 2 ) , ( 3 , 1 ) , ( 4 , 0 )} . It's relation matrix M R M_R M R is:
M R = [ 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 ] M_R=
\begin{bmatrix}
0&0&0&0&1\\
0&0&0&1&0\\
0&0&1&0&0\\
0&1&0&0&0\\
1&0&0&0&0
\end{bmatrix} M R = 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0
Di-graph for the above relation a R b aRb a R b is:
Example 4: Let A = { 0 , 1 , 2 , 3 , 4 } A=\{0,1,2,3,4\} A = { 0 , 1 , 2 , 3 , 4 } . Define a relation a R b aRb a R b such that HCF of ( a , b ) (a,b) ( a , b ) is 1 1 1 .
Given, A = { 0 , 1 , 2 , 3 , 4 } A=\{0,1,2,3,4\} A = { 0 , 1 , 2 , 3 , 4 } . A relation, a R b aRb a R b , such that HCF of ( a , b ) (a,b) ( a , b ) is 1 1 1 , is:
a R b = { ( 1 , 1 ) , ( 1 , 2 ) , ( 1 , 3 ) , ( 1 , 4 ) , ( 2 , 1 ) , ( 2 , 3 ) , ( 3 , 1 ) , ( 3 , 2 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 ) } aRb=\{(1,1),(1,2),(1,3),(1,4),(2,1),(2,3),(3,1),(3,2),(3,4),(4,1),(4,3)\} a R b = {( 1 , 1 ) , ( 1 , 2 ) , ( 1 , 3 ) , ( 1 , 4 ) , ( 2 , 1 ) , ( 2 , 3 ) , ( 3 , 1 ) , ( 3 , 2 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 )}
M R = [ 0 0 0 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 ] M_R=
\begin{bmatrix}
0&0&0&0&0\\
0&1&1&1&1\\
0&1&0&1&0\\
0&1&1&0&1\\
0&1&0&1&0
\end{bmatrix} M R = 0 0 0 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0
flowchart LR
A((0))
B((1))-->B
B-->C
B-->D
B-->E
C((2))-->B
C-->D
D((3))-->B
D-->C
D-->E
E((4))-->B
E-->D
Properties of Relations
Reflexive: There should be a R a aRa a R a for all a ∈ A a\in A a ∈ A .
Symmetric: If a R b aRb a R b exists then b R a bRa b R a should also exist for all ( a , b ) ∈ A (a,b)\in A ( a , b ) ∈ A .
Antisymmetric: If a R b aRb a R b exists, then b R a bRa b R a must not exist, but b R a bRa b R a can exist if a = b a=b a = b and ( a , b ) ∈ A (a,b)\in A ( a , b ) ∈ A .
Asymmetric: If a R b aRb a R b exist, then b R a bRa b R a must not exist for all ( a , b ) ∈ A (a,b)\in A ( a , b ) ∈ A ,
Transitive: If a R b aRb a R b and b R c bRc b R c exists, then a R c aRc a R c must exist where, ( a , b , c ) ∈ A (a,b,c)\in A ( a , b , c ) ∈ A .
Equivalence Relation
A binary relation R R R on set A A A is called an equivalence relation if R R R is reflexive , symmetric and transitive .
E.g. Let A = { 1 , 2 , 3 } A=\{1,2,3\} A = { 1 , 2 , 3 } and R = { ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 1 ) , ( 2 , 2 ) , ( 3 , 2 ) } R=\{(1,1),(1,2),(2,1),(2,2),(3,2)\} R = {( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 1 ) , ( 2 , 2 ) , ( 3 , 2 )} . To check whether R R R is reflexive or not, the following conditions must hold true:
M R = [ 1 1 0 1 1 0 0 0 1 ] M_R=
\begin{bmatrix}
1&1&0\\
1&1&0\\
0&0&1
\end{bmatrix} M R = 1 1 0 1 1 0 0 0 1
Test for reflexive :
Since, all elements in the right bearing diagonal are 1 1 1 , therefore, the relation is reflexive.
Test for symmetric :
M R − 1 = [ 1 1 0 1 1 0 0 0 1 ] M_R^{-1}=
\begin{bmatrix}
1&1&0\\
1&1&0\\
0&0&1
\end{bmatrix} M R − 1 = 1 1 0 1 1 0 0 0 1
Since, M R − 1 = M R M_R^{-1}=M_R M R − 1 = M R , therefore, the relation is symmetric.
Test for transitive :
( M R ) ⊙ 2 = [ 1 1 0 1 1 0 0 0 1 ] [ 1 1 0 1 1 0 0 0 1 ] = [ 1 1 0 1 1 0 0 0 1 ] (M_R)^2_\odot=
\begin{bmatrix}
1&1&0\\
1&1&0\\
0&0&1
\end{bmatrix}
\begin{bmatrix}
1&1&0\\
1&1&0\\
0&0&1
\end{bmatrix}
=\begin{bmatrix}
1&1&0\\
1&1&0\\
0&0&1
\end{bmatrix} ( M R ) ⊙ 2 = 1 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0 0 1 = 1 1 0 1 1 0 0 0 1
Since, ( M R ) ⊙ 2 = M R (M_R)^2_\odot=M_R ( M R ) ⊙ 2 = M R , therefore, the relation is transitive.
Since the relation R R R , is reflexive, symmetric and transitive, therefore, it is an equivalence relation.
Example 5: Let, A = 1 , 2 , 3 A={1,2,3} A = 1 , 2 , 3 , and R = { ( 1 , 1 ) , ( 2 , 2 ) , ( 2 , 3 ) , ( 3 , 2 ) , ( 3 , 3 ) } R=\{(1,1),(2,2),(2,3),(3,2),(3,3)\} R = {( 1 , 1 ) , ( 2 , 2 ) , ( 2 , 3 ) , ( 3 , 2 ) , ( 3 , 3 )} . Find out if R R R is an equivalence relation or not.
For R R R to be an equivalence relation, it must be reflexive, symmetric and transitive.
The matrix for R R R , M R M_R M R is:
M R = [ 1 0 0 0 1 1 0 1 1 ] M_R=
\begin{bmatrix}
1&0&0\\
0&1&1\\
0&1&1
\end{bmatrix} M R = 1 0 0 0 1 1 0 1 1
Test for reflexive :
Since all the right bearing diagonals are 1 1 1 , therefore, the relation is reflexive.
Test for symmetric :
M R − 1 = [ 1 0 0 0 1 1 0 1 1 ] M_R^{-1}=
\begin{bmatrix}
1&0&0\\
0&1&1\\
0&1&1
\end{bmatrix} M R − 1 = 1 0 0 0 1 1 0 1 1
Since, M R − 1 = M R M_R^{-1}=M_R M R − 1 = M R , therefore, the relation is symmetric.
Test for transitive :
( M R ) ⊙ 2 = M R = [ 1 0 0 0 1 1 0 1 1 ] [ 1 0 0 0 1 1 0 1 1 ] = [ 1 0 0 0 1 1 0 1 1 ] (M_R)^2_\odot=
M_R=
\begin{bmatrix}
1&0&0\\
0&1&1\\
0&1&1
\end{bmatrix}
\begin{bmatrix}
1&0&0\\
0&1&1\\
0&1&1
\end{bmatrix}
=
\begin{bmatrix}
1&0&0\\
0&1&1\\
0&1&1
\end{bmatrix} ( M R ) ⊙ 2 = M R = 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 0 1 1 = 1 0 0 0 1 1 0 1 1
Since, ( M R ) ⊙ 2 = M R (M_R)^2_\odot=M_R ( M R ) ⊙ 2 = M R , therefore, the relation is transitive.
Since the relation R, is reflexive, symmetric and transitive, therefore, it is an equivalence relation.
Closure
Certain elements added to the relation set to make it obey properties like reflexive, symmetry etc., is known as a relation closure.
E.g.: A = { 0 , 1 , 2 , 3 } A=\{0,1,2,3\} A = { 0 , 1 , 2 , 3 } , and R = { ( 0 , 1 ) , ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 0 ) , ( 2 , 2 ) , ( 3 , 0 ) } R=\{(0,1),(1,1),(1,2),(2,0),(2,2),(3,0)\} R = {( 0 , 1 ) , ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 0 ) , ( 2 , 2 ) , ( 3 , 0 )} .
Matrix of the relation, M R M_R M R is:
M R = [ 0 1 0 0 0 1 1 0 1 0 1 0 1 0 0 0 ] M_R=
\begin{bmatrix}
0&1&0&0\\
0&1&1&0\\
1&0&1&0\\
1&0&0&0
\end{bmatrix} M R = 0 0 1 1 1 1 0 0 0 1 1 0 0 0 0 0
Reflexive closure:
In order for R R R to be reflexive, all right-bearing diagonal elements should be 1 1 1 . If ( 0 , 0 ) (0,0) ( 0 , 0 ) and ( 3 , 3 ) (3,3) ( 3 , 3 ) is added, the relation will be reflexive. Therefore reflexive closure R ′ R' R ′ , is:
R ′ = { ( 0 , 1 ) , ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 0 ) , ( 2 , 2 ) , ( 3 , 0 ) , ( 0 , 0 ) , ( 3 , 3 ) } R'=\{(0,1),(1,1),(1,2),(2,0),(2,2),(3,0),(0,0),(3,3)\} R ′ = {( 0 , 1 ) , ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 0 ) , ( 2 , 2 ) , ( 3 , 0 ) , ( 0 , 0 ) , ( 3 , 3 )}
Symmetric closure:
To find the symmetric closure, we derive R − 1 R^{-1} R − 1 , and perform R ∪ R − 1 R\cup R^{-1} R ∪ R − 1 .
R − 1 = { ( 1 , 0 ) , ( 1 , 1 ) , ( 2 , 1 ) , ( 0 , 2 ) , ( 2 , 2 ) , ( 0 , 3 ) } R^{-1}=\{(1,0),(1,1),(2,1),(0,2),(2,2),(0,3)\} R − 1 = {( 1 , 0 ) , ( 1 , 1 ) , ( 2 , 1 ) , ( 0 , 2 ) , ( 2 , 2 ) , ( 0 , 3 )}
Therefore, symmetric closure, R ′ R' R ′ , is:
R ′ = R ∪ R − 1 = { ( 0 , 1 ) , ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 0 ) , ( 2 , 2 ) , ( 3 , 0 ) , ( 1 , 0 ) , ( 2 , 1 ) , ( 0 , 2 ) , ( 0 , 3 ) } R'=R\cup R^{-1}=\{(0,1),(1,1),(1,2),(2,0),(2,2),(3,0),(1,0),(2,1),(0,2),(0,3)\} R ′ = R ∪ R − 1 = {( 0 , 1 ) , ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 0 ) , ( 2 , 2 ) , ( 3 , 0 ) , ( 1 , 0 ) , ( 2 , 1 ) , ( 0 , 2 ) , ( 0 , 3 )}
Transitive closure:
Transitive closure is performed using Warshall's Algorithm .
Considerin a set A = { 1 , 2 , 3 , 4 } A=\{1,2,3,4\} A = { 1 , 2 , 3 , 4 } , and R = { ( 2 , 1 ) , ( 2 , 3 ) , ( 3 , 1 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 ) } R=\{(2,1),(2,3),(3,1),(3,4),(4,1),(4,3)\} R = {( 2 , 1 ) , ( 2 , 3 ) , ( 3 , 1 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 )} . Then, its matrix is:
M R = [ 0 0 0 0 1 0 1 0 1 0 0 1 1 0 1 0 ] M_R=
\begin{bmatrix}
0&0&0&0\\
1&0&1&0\\
1&0&0&1\\
1&0&1&0
\end{bmatrix} M R = 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 0
C R C.P. { 2 , 3 , 4 } \{2,3,4\} { 2 , 3 , 4 } { ϕ } \{\phi\} { ϕ } - { ϕ } \{\phi\} { ϕ } { 1 , 3 } \{1,3\} { 1 , 3 } - { 2 , 4 } \{2,4\} { 2 , 4 } { 1 , 4 } \{1,4\} { 1 , 4 } { ( 2 , 1 ) , ( 2 , 4 ) , ( 4 , 1 ) , ( 4 , 4 ) } \{(2,1),(2,4),(4,1),(4,4)\} {( 2 , 1 ) , ( 2 , 4 ) , ( 4 , 1 ) , ( 4 , 4 )} { 3 } \{3\} { 3 } { 1 , 3 } \{1,3\} { 1 , 3 } { ( 3 , 1 ) , ( 3 , 3 ) } \{(3,1),(3,3)\} {( 3 , 1 ) , ( 3 , 3 )}
M R ′ = [ 0 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 ] M_R'=
\begin{bmatrix}
0&0&0&0\\
1&0&1&1\\
1&0&1&1\\
1&0&1&1
\end{bmatrix} M R ′ = 0 1 1 1 0 0 0 0 0 1 1 1 0 1 1 1
C R C.P. { 2 , 3 , 4 } \{2,3,4\} { 2 , 3 , 4 } { ϕ } \{\phi\} { ϕ } - { ϕ } \{\phi\} { ϕ } { 1 , 3 , 4 } \{1,3,4\} { 1 , 3 , 4 } - { 2 , 3 , 4 } \{2,3,4\} { 2 , 3 , 4 } { 1 , 3 , 4 } \{1,3,4\} { 1 , 3 , 4 } { ( 2 , 1 ) , ( 2 , 3 ) , ( 2 , 4 ) , ( 3 , 1 ) , ( 3 , 3 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 ) , ( 4 , 4 ) } \{(2,1),(2,3),(2,4),(3,1),(3,3),(3,4),(4,1),(4,3),(4,4)\} {( 2 , 1 ) , ( 2 , 3 ) , ( 2 , 4 ) , ( 3 , 1 ) , ( 3 , 3 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 ) , ( 4 , 4 )} { 2 , 3 , 4 } \{2,3,4\} { 2 , 3 , 4 } { 1 , 3 , 4 } \{1,3,4\} { 1 , 3 , 4 } { ( 2 , 1 ) , ( 2 , 3 ) , ( 2 , 4 ) , ( 3 , 1 ) , ( 3 , 3 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 ) , ( 4 , 4 ) } \{(2,1),(2,3),(2,4),(3,1),(3,3),(3,4),(4,1),(4,3),(4,4)\} {( 2 , 1 ) , ( 2 , 3 ) , ( 2 , 4 ) , ( 3 , 1 ) , ( 3 , 3 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 ) , ( 4 , 4 )}
M R ′ ′ = [ 0 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 ] M_R''=
\begin{bmatrix}
0&0&0&0\\
1&0&1&1\\
1&0&1&1\\
1&0&1&1
\end{bmatrix} M R ′′ = 0 1 1 1 0 0 0 0 0 1 1 1 0 1 1 1
Since, M R ′ = M R ′ ′ M_R'=M_R'' M R ′ = M R ′′ , therefore, transitive closure, R ′ R' R ′ is:
R ′ = { ( 2 , 1 ) , ( 2 , 3 ) , ( 2 , 4 ) , ( 3 , 1 ) , ( 3 , 3 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 ) , ( 4 , 4 ) } R'=\{(2,1),(2,3),(2,4),(3,1),(3,3),(3,4),(4,1),(4,3),(4,4)\} R ′ = {( 2 , 1 ) , ( 2 , 3 ) , ( 2 , 4 ) , ( 3 , 1 ) , ( 3 , 3 ) , ( 3 , 4 ) , ( 4 , 1 ) , ( 4 , 3 ) , ( 4 , 4 )}
Example 6: Given the set A = { a , b , c , d } A=\{a,b,c,d\} A = { a , b , c , d } , and R = { ( a , d ) , ( b , a ) , ( b , c ) , ( c , a ) , ( c , d ) , ( d , c ) } R=\{(a,d),(b,a),(b,c),(c,a),(c,d),(d,c)\} R = {( a , d ) , ( b , a ) , ( b , c ) , ( c , a ) , ( c , d ) , ( d , c )} .
It's matrix is:
M R = [ 0 0 0 1 1 0 1 0 1 0 0 1 0 0 1 0 ] M_R=
\begin{bmatrix}
0&0&0&1\\
1&0&1&0\\
1&0&0&1\\
0&0&1&0
\end{bmatrix} M R = 0 1 1 0 0 0 0 0 0 1 0 1 1 0 1 0
C R C.P. { b , c } \{b,c\} { b , c } { d } \{d\} { d } { ( b , d ) , ( c , d ) } \{(b,d),(c,d)\} {( b , d ) , ( c , d )} { ϕ } \{\phi\} { ϕ } { a , c } \{a,c\} { a , c } - { b , d } \{b,d\} { b , d } { a , d } \{a,d\} { a , d } { ( b , a ) , ( b , d ) , ( d , a ) , ( d , d ) } \{(b,a),(b,d),(d,a),(d,d)\} {( b , a ) , ( b , d ) , ( d , a ) , ( d , d )} { a , c } \{a,c\} { a , c } { c } \{c\} { c } { ( a , c ) , ( c , c ) } \{(a,c),(c,c)\} {( a , c ) , ( c , c )}
M R ′ = [ 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 ] M_R'=
\begin{bmatrix}
0&0&1&1\\
1&0&1&1\\
1&0&1&1\\
1&0&1&1
\end{bmatrix} M R ′ = 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1
C R C.P. { b , c , d } \{b,c,d\} { b , c , d } { c , d } \{c,d\} { c , d } { ( b , c ) , ( b , d ) , ( c , c ) , ( c , d ) , ( d , c ) , ( d , d ) } \{(b,c),(b,d),(c,c),(c,d),(d,c),(d,d)\} {( b , c ) , ( b , d ) , ( c , c ) , ( c , d ) , ( d , c ) , ( d , d )} { ϕ } \{\phi\} { ϕ } { a , c , d } \{a,c,d\} { a , c , d } - { a , b , c , d } \{a,b,c,d\} { a , b , c , d } { a , c , d } \{a,c,d\} { a , c , d } { ( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d ) } \{(a,a),(a,c),(a,d),(b,a),(b,c),(b,d),(c,a),(c,c),(c,d),(d,a),(d,c),(d,d)\} {( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d )} { a , b , c , d } \{a,b,c,d\} { a , b , c , d } { a , c , d } \{a,c,d\} { a , c , d } { ( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d ) } \{(a,a),(a,c),(a,d),(b,a),(b,c),(b,d),(c,a),(c,c),(c,d),(d,a),(d,c),(d,d)\} {( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d )}
M R ′ ′ = [ 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 ] M_R''=
\begin{bmatrix}
1&0&1&1\\
1&0&1&1\\
1&0&1&1\\
1&0&1&1
\end{bmatrix} M R ′′ = 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1
C R C.P. { a , b , c , d } \{a,b,c,d\} { a , b , c , d } { a , c , d } \{a,c,d\} { a , c , d } { ( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d ) } \{(a,a),(a,c),(a,d),(b,a),(b,c),(b,d),(c,a),(c,c),(c,d),(d,a),(d,c),(d,d)\} {( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d )} { ϕ } \{\phi\} { ϕ } { a , c , d } \{a,c,d\} { a , c , d } - { a , b , c , d } \{a,b,c,d\} { a , b , c , d } { a , c , d } \{a,c,d\} { a , c , d } { ( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d ) } \{(a,a),(a,c),(a,d),(b,a),(b,c),(b,d),(c,a),(c,c),(c,d),(d,a),(d,c),(d,d)\} {( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d )} { a , b , c , d } \{a,b,c,d\} { a , b , c , d } { a , c , d } \{a,c,d\} { a , c , d } { ( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d ) } \{(a,a),(a,c),(a,d),(b,a),(b,c),(b,d),(c,a),(c,c),(c,d),(d,a),(d,c),(d,d)\} {( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d )}
M R ′ ′ ′ = [ 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 ] M_R'''=
\begin{bmatrix}
1&0&1&1\\
1&0&1&1\\
1&0&1&1\\
1&0&1&1
\end{bmatrix} M R ′′′ = 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1
Since, M R ′ ′ = M R ′ ′ ′ M_R''=M_R''' M R ′′ = M R ′′′ , therefore, transitive closure, R ′ R' R ′ is achieved.
R ′ = { ( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d ) } R'=\{(a,a),(a,c),(a,d),(b,a),(b,c),(b,d),(c,a),(c,c),(c,d),(d,a),(d,c),(d,d)\} R ′ = {( a , a ) , ( a , c ) , ( a , d ) , ( b , a ) , ( b , c ) , ( b , d ) , ( c , a ) , ( c , c ) , ( c , d ) , ( d , a ) , ( d , c ) , ( d , d )}
Equivalence of class and partition
The general equation for equivalent classes:
[ x ] = { y ∣ y ∈ A , ( x , y ) ∈ R } [x]=\{y|y\in A,(x,y)\in R\} [ x ] = { y ∣ y ∈ A , ( x , y ) ∈ R }
E.g.: A = { 1 , 2 , 3 , 4 , 5 } A=\{1,2,3,4,5\} A = { 1 , 2 , 3 , 4 , 5 } , and R = { ( 1 , 1 ) , ( 2 , 2 ) , ( 3 , 3 ) , ( 4 , 4 ) , ( 5 , 5 ) , ( 1 , 2 ) , ( 2 , 1 ) , ( 4 , 5 ) , ( 5 , 4 ) } R=\{(1,1),(2,2),(3,3),(4,4),(5,5),(1,2),(2,1),(4,5),(5,4)\} R = {( 1 , 1 ) , ( 2 , 2 ) , ( 3 , 3 ) , ( 4 , 4 ) , ( 5 , 5 ) , ( 1 , 2 ) , ( 2 , 1 ) , ( 4 , 5 ) , ( 5 , 4 )}
[ 1 ] = { 1 , 2 } , [ 2 ] = { 2 , 1 } , [ 3 ] = { 3 } , [ 4 ] = { 4 , 5 } , [ 5 ] = { 5 , 4 } [1]=\{1,2\}, [2]=\{2,1\}, [3]=\{3\}, [4]=\{4,5\}, [5]=\{5,4\} [ 1 ] = { 1 , 2 } , [ 2 ] = { 2 , 1 } , [ 3 ] = { 3 } , [ 4 ] = { 4 , 5 } , [ 5 ] = { 5 , 4 }
Therefore, the partitions are:
P 1 = { 1 , 2 } P_1=\{1,2\} P 1 = { 1 , 2 } , P 2 = { 3 } P_2=\{3\} P 2 = { 3 } , P 3 = { 4 , 5 } P_3=\{4,5\} P 3 = { 4 , 5 }
From the above, it can be drawn out that:
P 1 ∪ P 2 ∪ P 3 = A P_1\cup P_2\cup P_3=A P 1 ∪ P 2 ∪ P 3 = A
P 1 ∩ P 2 ∩ P 3 = { ϕ } P_1\cap P_2\cap P_3 = \{\phi\} P 1 ∩ P 2 ∩ P 3 = { ϕ }
Example 7: A = { 1 , 2 , 3 } A=\{1,2,3\} A = { 1 , 2 , 3 } , and R = { ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 1 ) , ( 2 , 2 ) , ( 3 , 3 ) } R=\{(1,1),(1,2),(2,1),(2,2),(3,3)\} R = {( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 1 ) , ( 2 , 2 ) , ( 3 , 3 )} .
Equivalence classes:
[ 1 ] = { 1.2 } , [ 2 ] = { 2 , 1 } , [ 3 ] = { 3 } [1]=\{1.2\}, [2]=\{2,1\}, [3]=\{3\} [ 1 ] = { 1.2 } , [ 2 ] = { 2 , 1 } , [ 3 ] = { 3 }
Partitions are:
P 1 = { 1 , 2 } P_1=\{1,2\} P 1 = { 1 , 2 } , P 2 = { 3 } P_2=\{3\} P 2 = { 3 }
Example 8: Let set A = { 1 , 2 , 3 , 4 , 5 , 6 } A=\{1,2,3,4,5,6\} A = { 1 , 2 , 3 , 4 , 5 , 6 } , P 1 = { 1 , 3 , 5 } P_1=\{1,3,5\} P 1 = { 1 , 3 , 5 } , P 2 = { 2 , 4 , 6 } P_2=\{2,4,6\} P 2 = { 2 , 4 , 6 } , where P 1 P_1 P 1 , and P 2 P_2 P 2 are partitions. Find the relation set of the set A A A .
R R R could be found by the union of the Cartesian products of the two partitions.
R = { ( 1 , 1 ) , ( 1 , 3 ) , ( 1 , 5 ) , ( 3 , 1 ) , ( 3 , 3 ) , ( 3 , 5 ) , ( 5 , 1 ) , ( 5 , 3 ) , ( 5 , 5 ) , ( 2 , 2 ) , ( 2 , 4 ) , ( 2 , 6 ) , ( 4 , 2 ) , ( 4 , 4 ) , ( 4 , 6 ) , ( 6 , 2 ) , ( 6 , 4 ) , ( 6 , 6 ) } R=\{(1,1),(1,3),(1,5),(3,1),(3,3),(3,5),(5,1),(5,3),(5,5),\\(2,2),(2,4),(2,6),(4,2),(4,4),(4,6),(6,2),(6,4),(6,6)\} R = {( 1 , 1 ) , ( 1 , 3 ) , ( 1 , 5 ) , ( 3 , 1 ) , ( 3 , 3 ) , ( 3 , 5 ) , ( 5 , 1 ) , ( 5 , 3 ) , ( 5 , 5 ) , ( 2 , 2 ) , ( 2 , 4 ) , ( 2 , 6 ) , ( 4 , 2 ) , ( 4 , 4 ) , ( 4 , 6 ) , ( 6 , 2 ) , ( 6 , 4 ) , ( 6 , 6 )}
POSET
POSET stands for partial-order set . Let R R R be a relation on set A A A . The relation R R R is called partial order set (POSET), if R R R is reflexive, antisymmetric, and transitive. A POSET is symbolically represented as ( A , ≤ ) (A,\le) ( A , ≤ ) .
E.g.: Let a set be A = { 1 , 2 , 3 , 4 } A=\{1,2,3,4\} A = { 1 , 2 , 3 , 4 } , and its relation set be defined by R = { ( a , b ) ∣ ( a , b ) ∈ A , a ≥ b } R=\{(a,b)|(a,b)\in A, a\ge b\} R = {( a , b ) ∣ ( a , b ) ∈ A , a ≥ b } .
R = { ( 1 , 1 ) , ( 2 , 1 ) , ( 2 , 2 ) , ( 3 , 1 ) , ( 3 , 2 ) , ( 3 , 3 ) , ( 4 , 1 ) , ( 4 , 2 ) , ( 4 , 3 ) , ( 4 , 4 ) } R=\{(1,1),(2,1),(2,2),(3,1),(3,2),(3,3),(4,1),(4,2),(4,3),(4,4)\} R = {( 1 , 1 ) , ( 2 , 1 ) , ( 2 , 2 ) , ( 3 , 1 ) , ( 3 , 2 ) , ( 3 , 3 ) , ( 4 , 1 ) , ( 4 , 2 ) , ( 4 , 3 ) , ( 4 , 4 )}
It's relation matrix is:
M R = [ 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 ] M_R=
\begin{bmatrix}
1&0&0&0\\
1&1&0&0\\
1&1&1&0\\
1&1&1&1
\end{bmatrix} M R = 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1
Check for reflexive :
Since all diagonal elements are 1 1 1 , therefore the relation is reflexive.
Check for antisymmetric :
For all non-diagonal elements, [ m i j ] = 1 [m_{ij}]=1 [ m ij ] = 1 , [ m j , i = 0 ] [m_{j,i}=0] [ m j , i = 0 ] , hence it is antisymmetric.
Check for transitive :
( M R ) ⊙ 2 = [ 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 ] [ 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 ] = [ 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 ] (M_R)^2_\odot=
\begin{bmatrix}
1&0&0&0\\
1&1&0&0\\
1&1&1&0\\
1&1&1&1
\end{bmatrix}
\begin{bmatrix}
1&0&0&0\\
1&1&0&0\\
1&1&1&0\\
1&1&1&1
\end{bmatrix}
=
\begin{bmatrix}
1&0&0&0\\
1&1&0&0\\
1&1&1&0\\
1&1&1&1
\end{bmatrix} ( M R ) ⊙ 2 = 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1 = 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1
Since, ( M R ) ⊙ 2 = M R (M_R)^2_\odot=M_R ( M R ) ⊙ 2 = M R , therefore the relation is transitive.
Since the relation is reflexive, antisymmetric, and transitive, therefore the relation is a POSET.