Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Relations of a Set
A relation describes a connection or association between elements of sets. Relations may exist between objects of the same set or between objects of two or more sets.
Definition and Properties
A binary relation R from set X to set Y (written as xRy or R(x, y)) is a subset of the Cartesian product X × Y. Each element of R is an ordered pair (x, y) where x ∈ X and y ∈ Y.
More generally, an n-ary relation R between sets A1, A2, ..., An is a subset of the Cartesian product A1 × A2 × ... × An.
Key facts about relations −
- The minimum cardinality of a relation R is 0 (empty relation).
- A binary relation R on a single set A is a subset of A × A, with maximum cardinality n2 (where n = |A|).
- For two distinct sets A and B with cardinalities m and n, the maximum cardinality of R from A to B is m × n.
Domain and Range
If there are two sets A and B, and relation R contains ordered pairs (x, y), then −
- The domain of R is Dom(R) = { x | (x, y) ∈ R for some y in B }
- The range of R is Ran(R) = { y | (x, y) ∈ R for some x in A }
Examples
Let A = { 1, 2, 9 } and B = { 1, 3, 7 } ?
Case 1: R is "equal to"
R = { (1,1), (3,3) }
Dom(R) = { 1, 3 }
Ran(R) = { 1, 3 }
Case 2: R is "less than"
R = { (1,3), (1,7), (2,3), (2,7) }
Dom(R) = { 1, 2 }
Ran(R) = { 3, 7 }
Case 3: R is "greater than"
R = { (2,1), (9,1), (9,3), (9,7) }
Dom(R) = { 2, 9 }
Ran(R) = { 1, 3, 7 }
Conclusion
A relation is a subset of the Cartesian product of two or more sets. The domain consists of all first elements in the ordered pairs, and the range consists of all second elements. The same pair of sets can have different relations depending on the condition that defines the association.
