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{.}\)
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{.}\)
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.
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.