Handout #16
CS103
April 13, 2011
Robert Plummer
Introduction to Relations
Relations are a fundamental concept in discrete mathematics, used to define how sets of objects
relate to other sets of objects.
Not only do they provide a formal way of being able to talk about
such relationships, they also provide the most widespread model used in modern commercial
database systems.
Understanding relations from a mathematical perspective not only gives you an
important modeling tool, but also gives you the foundational theory used in a number of
applications including relational database management systems, task scheduling systems, and
methods to solve various optimization problems.
To explore what relations are, let’s begin by considering the following set
G
Greek deities:
G
= {Zeus, Apollo, Cronus, Poseidon}
As you may know, Zeus is the father of Apollo, Cronus is the father of Poseidon, and Cronus is also
the father of Zeus.
So some of the elements of
G
that satisfy the "is the father of" relation with
respect to others
Notice that in this case, the elements that are related are both from the same set,
G, and that the relationship is "one way": if X is the father of Y, then Y is not the father of X.
If we
had another set, H, of female deities, then some members of G might bear the "is married to"
relation to members of H, and that relationship would also be true in the other direction.
We will
formalize all of these ideas, starting with some definitions.
Definitions
A
sequence
of objects is a list of these objects in some order.
Sequences may be finite or
infinite.
A finite sequence is called a
tuple
.
A sequence with
k
objects is called a
ktuple
.
An
ordered pair
is a 2tuple; that is, an ordered sequence of two elements.
We write
ordered pairs in parentheses, for example
(a, b)
, and we call
a
the first element and
b
the
second element of the pair.
The
Cartesian product
or
cross product
of two sets A and B, written
A
B
, is the set
of all ordered pairs wherein the first element is a member of A and the second element is a
member of B.
A
binary
relation
R
between two sets
A
and
B
(which may be the same) is a subset of the
Cartesian product
A
B
.
If element a
A is related by
R
to element b
B, we denote this
fact by writing
(a, b)
R
, or alternately, by
a R b
.
We say that
R is a relation on A
and B
.
A
relation on a set A
is a subset of A
A.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
– 2 –
A good way to think of a binary relation is that it is a way to designate that of all the ordered pairs
in the cross product of two sets, some are "interesting" because there is a certain relationship
between them.
We often name relations with capital letters, but some relations, such as "less
than" have their own symbols, like "<".
What we defined above is a
binary relation
because it operates on ordered pairs.
We can also
define
unary relations,
which operate on single elements, or
ternary relations
, which operate
on ordered triples.
In general an
n
ary relation
will operate on
n
tuples.
Formally, we can
express this as:
Definition
An
n
ary relation
on the sets
A
1
,
A
2
, …,
A
n
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '11
 PLUMMER
 Binary relation, relation

Click to edit the document details