Skip to main content

Discrete Mathematical Structures

Subsection 6.1.1 Binary relations

Definition 6.1.1.1.

Let \(A\) and \(B\) be sets. A binary relation or relation \(R\) from \(A\) to \(B\) is a subset of \(A \times B\text{,}\) \(R \subseteq A \times B\text{.}\) We use \(a\,R\,b\) to denote the fact that \((a,b)\) is in \(R\text{,}\) and say \(a\) is related to \(b\text{.}\)
One can think of a relation \(R\) as defining a relationship between elements from \(A\) to \(B\text{.}\)

Example 6.1.1.2. People and foods.

Let \(P\) denote the set of people on earth, and let \(F\) be the set of foods. Define a relation \(L\) from \(P\) to \(F\) by \((p, f) \in L\) if and only if \(p\) likes \(f\text{.}\) For example, \((\text{Dan}, \text{potato chips})\) is an element of \(L\text{.}\) We can also write that as \(\text{Dan~}L\text{~potato chips}\text{.}\)

Example 6.1.1.3. Cities and States.

Let \(C\) be the set of names of cities in the US. Let \(S\) be the set of names of states in the US. Let \(R\) be the relation from \(C\) to \(S\)
\begin{equation*} R = \{(a,b) \in C \times S \given a \text{ is a city in }b\}. \end{equation*}
Then \((\text{Greensboro}, \text{North Carolina})\) and \((\text{Dallas}, \text{Texas})\) are both in \(R\text{.}\)

Example 6.1.1.4. Grandfather relation.

Let \(P\) denote the set of all people (alive or dead). Let \(G\) be the relation on \(P\) by \(xGy\) if and only if \(y\) is the grandfather of \(x\text{.}\) People have two grandfathers (a paternal grandfather and a maternal grandfather), so \(G\) does not define a function from \(P\) to \(P\text{.}\) Functions are not allowed to have this ambiguity.

Example 6.1.1.5. States and cities.

Relations are more general than graphs of functions. Let \(C\) be the set of names of cities in the US. Let \(S\) be the set of names of states in the US. Let \(R\) be the relation from \(C\) to \(S\)
\begin{equation*} R = \{(a,b) \in C \times S \given a \text{ is a city in }b\}. \end{equation*}
Then \((\text{Greenville}, \text{North Carolina})\) and \((\text{Greenville}, \text{South Carolina})\) are in \(R\text{.}\) This cannot happen for the graph of a function, since functions have the property that there is a unique element in the range related to each element in the domain.

Example 6.1.1.6. Graph of a function is a relation.

A function \(f \colon A \to B\) defines a subset of \(A \times B\) called the graph of the function \(f\text{,}\) namely
\begin{equation*} \Gamma = \{(a, b) \in A \times B \given b = f(a)\}. \end{equation*}
Clearly \(\Gamma\) is a relation from \(A\) to \(B\text{.}\)
An example for the graph of a function can be found in FigureΒ 2.3.1.11.
In FigureΒ 2.3.2.6 and FigureΒ 2.3.2.7 we give graphical representations of relations that are not the graphs of functions.

Definition 6.1.1.7.

A relation on a set \(A\) is a relation from \(A\) to \(A\text{.}\)

Example 6.1.1.8. Equality as a relation.

Equality defines a relation on \(\RR\text{,}\) \(E \subseteq \RR \times \RR\text{.}\)
\begin{equation*} E = \{(a, b) \in \RR \times \RR \given a = b\}. \end{equation*}
Since \(2 = 2\text{,}\) we have \(2E2\text{.}\) Similarly, \(\pi E \pi\text{,}\) \(\sqrt{2} E \sqrt{2}\text{,}\) etc.

Example 6.1.1.9. Three relations on the integers.

The following define relations on \(\ZZ\text{.}\)
  1. \(R = \{(a,b) \in \ZZ^2 \given a\leq b\}\text{.}\)
  2. \(S = \{(a,b) \in \ZZ^2 \given a = b - 3\}\text{.}\)
  3. \(T = \{(a,b) \in \ZZ^2 \given a=(b-12)^2\}\text{.}\)
We have \(4 R 57\) and \(4 S 7\) and \(4 T 10\) and \(4 T 14\text{.}\)