This post is also available in: हिन्दी (Hindi)

The concepts of relations and functions are used in many areas in mathematics and many times students fail to recognize the difference between these two concepts. Among the many other ways of distinguishing a function from a relation, the easiest way is by using Vertical Line Test. It’s a visual technique of distinguishing a function from a relation.

## What is a Relation in Math?

Relations in math are used to describe a connection between the elements of two sets. They help to map the elements of one set (known as the **domain**) to elements of another set (called the **range**) such that the resulting ordered pairs are of the form (input, output).

Suppose there are two sets $X = \{ 4, 36, 49, 50 \} $ and $Y = \{1, -2, -6, -7, 7, 6, 2 \}$. A relation that states that “$ \left( x, y \right) $ is in the relation $R$ if $x$ is a square of $y$” can be represented using ordered pairs as $R = \{ \left( 4, -2 \right), \left( 4, 2 \right), \left( 36, -6 \right), \left( 36, 6 \right), \left( 49, -7 \right), \left( 49, 7 \right) \}$.

Diagrammatically, it can be represented as

## What is a Function in Math?

A function is a relation that associates each element ‘$a$’ of a non-empty set A , at least to a single element ‘$b$’ of another non-empty set B. A relation $f$ from a set $A$ (the domain of the function) to another set $B$ (the co-domain of the function) is called a function in math. $ f = \{ \left( a,b \right)| $ for all $a \in A, b \in B \}$. A relation is said to be a function if every element of set $A$ has **one and only one image** in set $B$.

For example a function representing the square of a number can be written as “$f \left( x \right) = x^{2}$ “. It is said as $f$ of $x$ is equal to $x$ square. This is represented as $f = \{ \left(1,1 \right), \left(2,4 \right), \left(3,9 \right) \}$. The domain and range of a function is given as $D = \{1, 2, 3 \}$, $R= \{1,4, 9 \}$. Here is a representation of a function in math as an ordered pair.

Diagrammatically, it can be represented as

## Difference Between Relation and Function

By the definition, relations and functions seem to be quite similar but actually, there is a major difference between them. These are the points that differentiate between a relation and a function.

- If the set $ \left(x,y \right)$ is a collection of ordered pairs, where $x$ is from set $A$ while $y$ is from set $B$. Then we say $x$ is related to $y$. A group of such sets is called a relation.
- In a function, exactly one $x$ can be paired with some $y$, where $x$ is from set $A$ and $y$ is from set $B$.
- 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 a 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.

## What is The Vertical Line Test?

A vertical line test helps to find if the graph is a function or not. The vertical line in a coordinate system represents a set of infinite points having the same $x$ coordinate values and different $y$ coordinate values for each of its points. The vertical line is drawn parallel to the $y$-axis, if it cuts the curve at one distinct point then it has one $y$-value for the given $x$ value and it follows the basic definition of a function and hence the graph represents a function, otherwise not.

## Conclusion

Every function in math is a relation, but every relation is not a function. The vertical line test is the easiest and quicker way of checking whether a given relation is a function or not.

## Recommended Reading

- 3 Systems of Measuring Angles
- How To Solve Quadratic Inequalities?
- Which One Will You Choose: Two 5-Inch Pizzas Or One 9-Inch Pizza?

Image Credit: Trigonometry vector created by macrovector_official – www.freepik.com