# Relations

A relation is simply a set of ordered pairs. Usually, we talk about relations on sets of numbers, but not always.

Easy Example:

You could have a relation between the set of all names and the set of whole numbers. A name N is related to a number x if and only if N has fewer than x letters.

So, (Raj, 5) is in the relation, but (Abdullah, 7) is not.

Easy Example:

Here is a relation on the set of real numbers. Suppose x is related to y if and only if x is less than y.

The following table shows some ordered pairs which are in the relation, and some which are not.

 Related Not Related (1, 6) (3, –2) (5, 5.001) (–8, –9) (0, 9999) (4, 3)

## Input-Output Tables

One way in which relations are commonly displayed is in an input-output table. The idea is, you input some number x, and you get out some y.

 Input Output 0 0 1 3 2 0 3 9 1 3 –5 –15

This table describes a relation containing the ordered pairs (0, 0), (1, 3), (2, 0), (3, 9), (1, 9), (–5, –15).

If the same input always gives the same output, then the relation is called a function. Otherwise it is not a function. The relation in the table above is a function (it is okay if two different inputs give the same output). The relation in the table below is not a function because the same input 1 gives the output 5 the first time and 0 the second time.

 Input Output 0 0 1 5 2 0 3 15 1 0 –5 –15

If you have a graph of a relation, you can use the vertical line test to decide whether or not it is a function.