What Is a Relation?
A relation R from set A to set B is a subset of the Cartesian product A ร B. If (a, b) โ R, we write aRb and say "a is related to b".
Cartesian Product: A ร B = {(a, b) | a โ A and b โ B}
If |A| = m and |B| = n, then |A ร B| = m ร n
Example: A = {1, 2}, B = {x, y}
A ร B = {(1,x), (1,y), (2,x), (2,y)}
Representing Relations
1. Set of ordered pairs: R = {(1,2), (2,3), (3,4)}
2. Matrix: M[i][j] = 1 if iRj, 0 otherwise
3. Directed Graph (Digraph): vertices = elements, edges = pairs
Properties of Relations on a Set
Reflexive: โa โ A: aRa
Every element relates to itself.
Symmetric: โa, b โ A: aRb โ bRa
If a relates to b, then b relates to a.
Antisymmetric: โa, b โ A: (aRb โง bRa) โ a = b
If a relates to b and b relates to a, they are equal.
Transitive: โa, b, c โ A: (aRb โง bRc) โ aRc
If a relates to b and b relates to c, then a relates to c.