Relations

1. Ordered Pair

An ordered pair is a pair of elements written as $(a,b)$ where the order matters: $(a,b) \neq (b,a)$ unless $a=b$.

Example: $(1,2)$ is different from $(2,1)$.

2. Cartesian Product

The Cartesian product of two sets $A$ and $B$ is $A \times B = \{(a,b) : a \in A, b \in B\}$.

Example: If $A = \{1,2\}, B = \{x,y\}$, then $A \times B = \{(1,x),(1,y),(2,x),(2,y)\}$.

$A = \{1,2\}, B = \{x,y\}$(1,x)(1,y)(2,x)(2,y)

3. Relation

A relation from set $A$ to set $B$ is a subset of $A \times B$.

Example: If $A = \{1,2\}, B = \{x,y\}$, a relation $R = \{(1,x),(2,y)\} \subseteq A \times B$.

4. Domain and Range

Domain: The set of all first elements of ordered pairs in a relation $R$, denoted $dom(R)$.

Range: The set of all second elements, denoted $ran(R)$.

Example: For $R = \{(1,x),(2,y)\}$, $dom(R) = \{1,2\}, ran(R) = \{x,y\}$.

5. Types of Relations

6. Examples of Relations

Let $A = \{1,2,3\}$, $B = \{x,y\}$: