Difference Between Relation and Function
Question: What is the fundamental difference between a relation and a function? Is every relation a function?
Solution
A relation is a set of ordered pairs that shows the relationship between two sets. A function is a special type of relation in which every input has exactly one output.
| Relation | Function |
|---|---|
| A relation may assign one element to many elements. | A function assigns exactly one output to each input. |
| Every ordered pairing is allowed. | Repeated first elements with different outputs are not allowed. |
| It is a general concept. | It is a special type of relation. |
Example of a relation:
$$ R = \{(1,2), (1,3), (2,4)\} $$
This is not a function because the input $1$ has two outputs: $2$ and $3$.
Example of a function:
$$ f = \{(1,2), (2,3), (3,4)\} $$
Here every input has exactly one output.
Therefore:
No, every relation is not a function.
But every function is a relation. :contentReference[oaicite:0]{index=0}