Relation

## Definition of n-ary Relation

### Subjects to be Learned

- ordered n-tuple (review)
- Cartesian product (review)
- equality of n-tuples (review)
- n-ary relation
- empty relation
- universal relation

### Contents

Here we are going to formally define general *n*-ary relation
using the concept of **ordered n-tuple**.

**Definition (ordered n-tuple):**
An **ordered ***n*-tuple is a set of *n*
objects with an order
associated with them.
If *n* objects are represented by *x*_{1}, *x*_{2},
..., *x*_{n}, then we write the ordered *n*-tuple as
**<***x*_{1}, *x*_{2}, ..., *x*_{n}> .

**Definition (Cartesian product):**
Let *A*_{1}, ..., *A*_{n} be *n* sets.
Then the set of all ordered *n*-tuples
**<***x*_{1}, ..., *x*_{n}> ,
where *x*_{i}
*A*_{i}
for all *i*,
*1*
*i*
*n* ,
is called the **Cartesian product** of
*A*_{1}, ..., *A*_{n}, and is denoted by
*A*_{1}
...
*A*_{n} .

**Definition (equality of ***n*-tuples):
Two ordered *n*-tuples
**<***x*_{1}, ..., *x*_{n}> and
**<***y*_{1}, ..., *y*_{n}>
are **equal** if and only if
*x*_{i} = *y*_{i} for all *i*,
*1*
*i*
*n* .

For example the ordered *3*-tuple **<***1, 2, 3*>
can be equal to only **<***1, 2, 3*> and nothing else.
It is not equal to the ordered *n*-tuple **<***2, 3, 1*>
for example.

**Definition (n-ary relation):**
An *n*-ary relation on sets
*A*_{1}, ..., *A*_{n} is a set
of ordered *n*-tuples
**<***a*_{1}, ..., *a*_{n}>
where *a*_{i} is an element of *A*_{i}
for all *i*,
*1*
*i*
*n* .
Thus an *n*-ary relation on sets
*A*_{1}, ..., *A*_{n} is a subset of Cartesian
product
*A*_{1}
...
*A*_{n} .

**Example 1:** Let *A*_{1} be a set of names,
*A*_{2} a set of addresses, and *A*_{3} a set of
telephone numbers. Then a set of *3*-tuples **< name, address,
telephone number >** such as **{ < Amy Angels,
35 Mediterranean Ave, 224-1357 >, < Barbara Braves, 221 Atlantic Ave, 301-1734 >,
< Charles Cubs, 312 Baltic Ave, 223-9876 > }**, is a *3*-ary (ternary) relation over *A*_{1}, *A*_{2}
and *A*_{3}.

**Example 2:** Let *A*_{1} be a set of names.
Then a set of 1-tuples such as **{ < Amy
>, < Barbara
>,
< Charles > }**, is a *1*-ary (**unary**)
relation over *A*_{1}.

A **unary relation** represents a property/characteristic, such as tall, rich
etc., shared by
the members of *A*_{1} listed in the relation.

#### Special Relations

The empty set is certainly a set of ordered n-tuples. Therefore it is a relation.
It is called the **empty relation**.

The Cartesian product
*A*_{1}
...
*A*_{n}
of sets
*A*_{1} , ... , *A*_{n} ,
is also a relation, and it is called the **universal relation**.

### Test Your Understanding of n-ary Relation

Indicate which of the following statements are correct and which are not.

Click True or False , then Submit. There is one set of questions.

**
Next -- Equality of Relations **

Back to Schedule

Back to Table of Contents