A binary relation
R
can be conveniently depicted by a directed graph, in which each pair
(
a
,
b
)
∈
R
corresponds to a directed edge from vertex
a
to vertex
b
.
Example.
The following digraph represents the
Student-major
relation defined in the
preceding example (p. 2-1).
More generally, A relation can be defined over
n
sets,
n
≥
2.
Definition.
An
n
-ary relation
R
over sets
A
1
,
A
2
,
…, A
n
, n
≥
2, is a subset of the cartesian
product
, that is,
R
⊆
.
The
degree
of
R
is
n
.
Example.
Consider the purchase of a new car, which frequently involves a buyer, a
salesperson, a new car, and a trade-in.
Thus, a car purchase is a relation of degree 4,
because it can be considered as a subset of
B
×
S
×
N
×
T
, where
B
,
S
,
N
, and
T
stand
for, respectively, the sets of buyers, salespersons, new cars, and trade-ins.
Adam
John
Smith
Art
History
Mathematics
∏
=
n
i
i
A
1
∏
=
n
i
i
A
1
4-2,
© Dr. S. Lang