Introduction
A relation describes a connection between elements of two sets. Before understanding relations, we need to understand the Cartesian product.
Cartesian Product
Definition
The Cartesian product of sets $A$ and $B$, denoted $A \times B$, is the set of all ordered pairs $(a, b)$ where $a \in A$ and $b \in B$.
$$\boxed{A \times B = \{(a, b) : a \in A \text{ and } b \in B\}}$$Example
If $A = \{1, 2\}$ and $B = \{x, y\}$:
$$A \times B = \{(1, x), (1, y), (2, x), (2, y)\}$$Properties
- Not commutative: $A \times B \neq B \times A$ (unless $A = B$ or one is empty)
- Cardinality: $|A \times B| = |A| \times |B|$
- Empty product: $A \times \emptyset = \emptyset = \emptyset \times A$
Graphical Representation
For $A = \{1, 2\}$ and $B = \{a, b\}$:
B
│
b │ • •
│
a │ • •
│
└──────── A
1 2
Each point represents an ordered pair.
In an ordered pair $(a, b)$:
- Order matters: $(1, 2) \neq (2, 1)$
- $(a, b) = (c, d) \iff a = c$ AND $b = d$
What is a Relation?
Definition
A relation $R$ from set $A$ to set $B$ is a subset of $A \times B$.
$$R \subseteq A \times B$$If $(a, b) \in R$, we write $aRb$ and say “$a$ is related to $b$”.
Example
Let $A = \{1, 2, 3\}$ and $B = \{1, 4, 9\}$.
Define relation $R$: “$a$ is the square root of $b$”
$$R = \{(1, 1), (2, 4), (3, 9)\}$$Here, $1R1$, $2R4$, $3R9$ are true statements.
Relation on a Set
A relation $R$ from set $A$ to itself ($R \subseteq A \times A$) is called a relation on $A$.
Example: On $A = \{1, 2, 3\}$, define $R$: “$a$ divides $b$”
$$R = \{(1, 1), (1, 2), (1, 3), (2, 2), (3, 3)\}$$Domain, Co-domain, and Range
Definitions
For a relation $R$ from $A$ to $B$:
| Term | Definition | Notation |
|---|---|---|
| Domain | Set of first elements of ordered pairs in $R$ | $\text{Dom}(R)$ |
| Co-domain | The set $B$ | - |
| Range | Set of second elements of ordered pairs in $R$ | $\text{Range}(R)$ |
Important Relationship
$$\boxed{\text{Range}(R) \subseteq \text{Co-domain}}$$The range is always a subset of the co-domain!
Example
Let $A = \{1, 2, 3, 4\}$ and $B = \{a, b, c, d, e\}$.
$R = \{(1, a), (2, b), (3, c), (1, b)\}$
- Domain = $\{1, 2, 3\}$ (first elements)
- Co-domain = $\{a, b, c, d, e\}$ (the set $B$)
- Range = $\{a, b, c\}$ (second elements)
Note: 4 is not in the domain, and $d, e$ are not in the range.
Range ≠ Co-domain (in general)
Range only includes elements that are actually “hit” by the relation.
Ways to Represent Relations
1. Roster Form
List all ordered pairs:
$$R = \{(1, 2), (2, 4), (3, 6)\}$$2. Set-Builder Form
Describe the relationship:
$$R = \{(a, b) : b = 2a, a \in \{1, 2, 3\}\}$$3. Arrow Diagram
Draw arrows from elements of $A$ to related elements of $B$:
A B
1 ──────► 2
2 ──────► 4
3 ──────► 6
4. Matrix Representation
For $A = \{a_1, a_2, ..., a_m\}$ and $B = \{b_1, b_2, ..., b_n\}$:
Create an $m \times n$ matrix $M$ where:
$$M_{ij} = \begin{cases} 1 & \text{if } (a_i, b_j) \in R \\ 0 & \text{otherwise} \end{cases}$$Example: For $R = \{(1, a), (2, b), (2, c)\}$ on $A = \{1, 2\}$ and $B = \{a, b, c\}$:
$$M = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 1 \end{pmatrix}$$Number of Relations
Counting Relations
Since a relation from $A$ to $B$ is a subset of $A \times B$:
$$\boxed{\text{Number of relations} = 2^{|A| \times |B|}}$$Example: If $|A| = 2$ and $|B| = 3$:
- $|A \times B| = 6$
- Number of relations = $2^6 = 64$
Special Cases
| Relation Type | Count |
|---|---|
| Empty relation | 1 |
| Universal relation | 1 |
| Non-empty relations | $2^{mn} - 1$ |
Inverse of a Relation
Definition
The inverse of relation $R$ from $A$ to $B$, denoted $R^{-1}$, is:
$$R^{-1} = \{(b, a) : (a, b) \in R\}$$$R^{-1}$ is a relation from $B$ to $A$.
Example
If $R = \{(1, a), (2, b), (3, a)\}$
Then $R^{-1} = \{(a, 1), (b, 2), (a, 3)\}$
Properties
- $(R^{-1})^{-1} = R$
- Domain of $R^{-1}$ = Range of $R$
- Range of $R^{-1}$ = Domain of $R$
Interactive Demo: Visualize Relations
Explore relations, domain, range, and inverse relations graphically.
Practice Problems
Find all ordered pairs in $A \times B$ where $A = \{1, 2\}$ and $B = \{3\}$.
Let $R = \{(x, y) : y = x + 1\}$ on $A = \{0, 1, 2, 3\}$. List all elements of $R$.
Find the domain and range of $R = \{(1, 4), (2, 5), (3, 6), (4, 6)\}$.
How many relations are possible from a set of 3 elements to a set of 2 elements?