Describe difference between relation and function.
Relation and function:
Relations are a group of ordered pairs from one set of objects to another set of objects while functions are relations that connect one set of inputs to another set of outputs. So all functions are relations while all relations are not functions.
By the definition, relations and functions seem to be quite similar but actually, there is a major difference between them.
If the set is a collection of ordered pairs, where is from set while is from set . Then we say is related to . A group of such sets is called a relation.
In a function, exactly one can be paired with some , where x is from set and is from set .
All functions are relations, but all relations are not functions. This is because, in a function, one input can connect to only one output and not more than one, while there is no such condition in a relation.
It can be said that function does not have a one-many relationship, which means one object cannot pair up with many objects in a function.
Many-one relation is valid in a function. Many different objects can be paired with the same object.