Functions & Transformations

relation

A relation is the broadest way to pair things up: any collection of ordered pairs that links inputs to outputs, with no rules about how. A guest list matching people to seats is a relation; so is a table of names to phone numbers, even if one person has two numbers.

Formally, a relation is simply a set of ordered pairs (x, y). The first entries form the inputs and the second the outputs. There is no requirement of uniqueness — a single input is allowed to pair with several outputs, which is exactly what a function forbids.

So every function is a relation, but not every relation is a function. A function is the special, well-behaved kind of relation in which each input appears with exactly one output. The vertical line test is precisely the graphical way of asking whether a relation has earned the stricter title of function.

{(1, 2), (1, 5), (3, 4)} is a relation but not a function: the input 1 has two outputs.

Every function is a relation, not conversely.