Professional Documents
Culture Documents
Margaret M. Fleck
7 November 2008
This lecture covers relations and basic properties of relations, which is
most of section 8.1 of Rosen.
Announcements
Model solutions for the second midterm will be posted as soon as we finish
doing makeup exams, which will probably be mid next week.
Relations
Functions are one special case of relations. For example, suppose we want to
associate each state with its capital. We can describe this as a relation F from
the set of US states (A) to the set of US cities (C) So F is a set containing
pairs like (Massachusetts, Boston) and (Iowa, Des Moines). In this case, the
relation happens to associate each state with exactly one city. So we can also
describe C as a function from A to C.
You can formally define a function from A to B as a relation from A to
B such that each element of A is associated with exactly one element of B.
Or you can think of a relation as a generalized type of function, which
allows missing or multiple outputs for certain inputs. Many mathematical
applications use partial functions, which are functions that might not return a value for every input. Similarly, many programming languages let you
define procedures that do not return a value. Some programming languages
even let you define procedures that return multiple values.
If a relation is a function, its usually more convenient to define it as a
function and use function notation. So, if we observe them in the wild, mathematicians normally call something a relation only when it isnt a function,
or they are worried that it might not turn out to be a function.
The facts stored in a computer database are also relations. For this application, we need to generalize our notion of relation to more than two sets. For
example, a simple registration database might contain 4-tuples like
(Jean Luc Picard, Math CS 173, Fall 2325, A-)
The final big group of relations are relations that associate two elements
of the same set. A relation R on a set A is a relation from A to A, or
equivalently, a subset of A A. That is, R is a set of pairs of elements from
A.
For example, suppose we let A = {2, 3, 4, 5, 6, 7} We can define a relation
R on A by (x, y) R if and only if |x y| 2. This relation contains the
pairs (3, 4) and (4, 6) and (6, 4), but not the pair (3, 6).
Another relation on A is the familiar = relation. It contains only pairs
whose two elements are identical, such as (5, 5) and (3, 3). Another similar
relation is congruence mod 3 (3 ). The 3 relation contains a wider range
of pairs, e.g. (4, 7) and (6, 3). Relations like these, which resemble equality,
are known as equivalence relations. Well get back to defining them precisely
in a couple lectures.
Order relations such as < and are also relations on the set A. For
example, the relation contains pairs like (5, 4) and (7, 2) and (5, 5).
No one said that a relation needs to involve finite sets or even onedimensional sets. We can define similar relations on infinite sets. For example, normal numerical is a relation on the set of integers or the set of
3
real numbers. Another example: we can define a relation T on the real plane
R2 in which (x, y) is related to (p, q) if and only if x2 + y 2 = p2 + q 2 . In other
words, two points are related if they are the same distance from the origin.
Random relations
No one said that a relation had to make sense or have any practical use.
For example, lets let A = {a, b, c, d}. We can select any random subset of
A A to be a relation. For example, R = {(a, a), (b, a), (c, d), (d, d)} is a
perfectly good relation on A. Wierdo relations like this are often easiest to
represent by making a table showing which pairs are in the set, or by drawing
a dot-and-arrow diagram of the relation. [See pictures pp. 520521 of Rosen.
Notice that we can do the dot-and-arrow diagram with either one copy of
the points or two copies.]
If a set A has n elements, how many possible relations are there on A?
A A contains n2 elements. A relation is just a subset of A A, and so there
2
are 2n relations on A. So a 3-element set has 29 = 512 possible relations.
Yup: most of these relations are of no practical use whatsoever. Most of
the time, you will be manipulating relations generated by some underlying
pattern and, thus, make more sense. Just be aware that these random guys
are also legitimate relations.
Familiar relations such as = and < have certain special properties which
make them especially useful, both in proofs and in practical applications.
Moreover, some relations seem to be structurally similar: similar properties
for apparently similar reasons. For example, and and divides. We can
make these intuitions concrete by classifying relations according to certain
key properties.
The commonly-used properties are: reflexive, irreflexive, symmetric, antisymmetric, and transitive. Relations that act like equality are all reflexive,
symmetric, and transitive. Relations that act like < are all irreflexive, anti4
Irreflexive