**Relations and Functions** are the most essential topics in algebra. Relations and functions – these are the two different words having separate meanings mathematically. You might get confused about their difference. Before we go deeper, let’s understand the variation between both with a simple example.

An ordered pair is described as (INPUT, OUTPUT):

The relation gives the relationship between INPUT and OUTPUT. Whereas, a function is a relation that determines one OUTPUT for each given INPUT.

In this section, you will find the basics of the topic – definition of functions and relations, special functions, different types of relations, and some of the solved examples.

## What is a Function?

A function is a relation that explains that there should be only one output for each input (or) we can say that a special kind of relation (a set of ordered pairs), which reflects a rule i.e., every X-value should be associated with only one y-value is called a function.

**Example:**

In the relation, {(-2, 3), {4, 5), (6, -5), (-2, 3)},

The domain is {-2, 4, 6} and range is {-5, 3, 5}.

**Note**: Don’t examine duplicates while writing the domain and range and also write it in increasing order.

### Types of Functions

In words of relations, we can define the types of functions as:

**One to one function or Injective function:**A function f: P → Q is stated to be one to one if for each element of P there is a distinct element of Q.**Many to one function:**A function that maps two or more elements of P to the same element of set Q.**Onto Function or Surjective function:**A function for which each element of set Q there is pre-image in set P**One-one correspondence or Bijective function:**The function f matches with every element of P with a discrete element of Q and every element of Q has a pre-image in P.

### Special Functions in Algebra

Some of the primary functions are as follow:

- Constant Function
- Identity Function
- Linear Function
- Absolute Value Function
- Inverse Functions

## What is the Relation?

It is a subset of the Cartesian product. Or really, a bunch of points (ordered pairs). In other words, the relation between the two sets is described as the collection of the ordered pair, in which the ordered pair is formed by the object from each set.

Example: {(-2, 1), (4, 3), (7, -3)}, normally written in set notation form with curly brackets.

## Types of Relations

Different types of relations are as follows:

- Empty Relations
- Universal Relations
- Identity Relations
- Inverse Relations
- Reflexive Relations
- Symmetric Relations
- Transitive Relations

Let us explain all the types one by one.

### Empty Relation

When there’s no element of set X is linked or mapped to any element of X, then the relation R in A is an empty relation, and also called the void relation, i.e R= ∅.

For instance, if there are 100 mangoes in the fruit basket. There’s no possibility of obtaining a relation R of getting any apple in the basket. So, R is Void as it has 100 mangoes and no apples.

### Universal relation

R is a relation in a set, let’s say A is a universal relation because, in this full relation, each element of A is related to every element of A. i.e R = A × A.

It’s a full relation as each element of Set A is in Set B.

### Identity Relation

If each element of set A is related to itself only, it is called Identity relation.

I={(A, A), ∈ a}.

For Example,

When we throw a dice, the total number of probable outcomes is 36. I.e (1, 1) (1, 2), (1, 3)…..(6, 6). From these, if we think the relation (1, 1), (2, 2), (3, 3) (4, 4) (5, 5) (6, 6), it is an identity relation.

### Inverse Relation

If R is a relation from set A to set B i.e R ∈ A X B. The relation R−1−1 = {(b,a):(a,b) ∈ R}.

For Example,

If you throw two dice if R = {(1, 2) (2, 3)}, R−1−1= {(2, 1) (3, 2)}. Here the domain is the range R−1−1 and vice versa.

### Reflexive Relation

A relation is a reflexive relation if each element of set A maps to itself, i.e for every a ∈ A, (a, a) ∈ R.

### Symmetric Relation

Asymmetric relation is a relation R on a set A if (a, b) ∈ R then (b, a) ∈ R, for all a & b ∈ A.

### Transitive Relation

If (a, b) ∈ R, (b, c) ∈ R, then (a, c) ∈ R, for all a,b,c ∈ A and this relation in set A are transitive.

### Equivalence Relation

If a relation is reflexive, symmetric, and transitive, then the relation is called an equivalence relation.

## FAQs

**Does the relation define the function?**

A relation from a set P to another set Q represents a function if each element of the set P is related to exactly one element of the set Q.

**What are relations in Math?**

In math, a relation represents the relationship between sets of values of ordered pairs. The set of elements in the first set are called domain which is related to the set of the element in a different set, which is called range.

**How to define if a relation is a function?**

When every input value of a function generates one and only output, it is called a function. Here, the input values are acknowledged as domain, and output values are known as the range.

**How to graph a function?**

If y = x + 2, is a function, then we have to put different values of x to generate y values. Here, x is the input value and y is the output value. Suppose, if x = 0, then y =2, if x = 1, then y = 3, if x = -1, then y = 1, and so on. Now plot these values in a graph and attach the points.