Open In App

Types of Functions

Last Updated : 11 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Functions are defined as the relations which give a particular output for a particular input value. A function has a domain and codomain (range). f(x) usually denotes a function where x is the input of the function. In general, a function is written as y = f(x).

What is a Function?

A function is a relation between two sets set A and set B. Such that every element of set A has an image in set B and no element in set A has more than one image in set B.

Let A and B be two nonempty sets. A function or mapping f from A to B is written as f: A → B is a rule by which each element a ∈ A is associated with a unique element b ∈ B.

Function Test

Domain, Codomain, and Range of a Function

The elements of set X are called the domain of f and the elements of set Y are called the codomain of f. The images of the elements of set X are called the range of function, which is always a subset of Y. The image given below demonstrates the domain, codomain, and range of the function.

Domain, Codomain, and Range of a Function

The image demonstrates the domain, co-domain, and range of the function. Remember the element which is mapped only will be counted in the range as shown in the image. The domain, codomain, and range of the above function are:

Domain = {a, b, c}

Codomain = {1, 2, 3, 4, 5}

Range = {1, 2, 3}

Read More about Domain and Range.

Types of Functions in Maths

An example of a simple function is f(x) = x3. In this function, f(x) takes the value of “x” and then cubes it to find the value of the function. For example, if the value of x is taken to be 2, then the function gives 8 as output i.e. f(2) = 8.

Some other examples of functions are: 

f(x) = cos x, f(x) = 5x2 + 9, f(x) = 1/x3, etc.

There are several types of functions in maths. Some of the important types are:

  • One to One (Injective) function
  • Many to One function
  • Onto (Surjective) Function
  • Into Function

One to One (Injective) function

A function f: X → Y is said to be a one-to-one function if the images of distinct elements of X under f are distinct. Thus, f is one to one if f(x1) = f(x2)

Property: A function f: A → B is one-to-one if f(x1) = f(x2) implies x1 = x2, i.e, an image of a distinct element of A under f mapping (function) is distinct.

Condition to be One-to-One function: Every element of the domain has a single image with a codomain after mapping.

One to One (Injective) function

Read More about One-to-One Functions.

Examples of One to One Functions

Som of examples of one-one functions are:

  • f(x) = x (Identity function)
  • k(x) = 2x + 3 (Linear Polynomial)
  • g(x) = ex (Exponential function)
  • h(x) = √x​ (Square root function, defined for x ≥ 0)

Many to One Function

If the function is not one to one function, then it should be many to one function means every element of the domain has more than one image at codomain after mapping.

  • Property: One or more elements having the same image in the codomain
  • Condition to be Many to One function: One or more than one element in the domain having a single image in the codomain.

Many to One function

Read More about Many One Functions.

Examples of Many to One Function

Some of the most common examples of many to one functions are:

  • f(x) = x2 (Squared function)
  • g(x) = sin(x) (Sine function)
  • h(x) = cos(x) (Cosine function)
  • k(x) = tan(x) (Tangent function)
  • m(x) = ∣x∣ (Absolute value function)

Onto (Surjective) Function

A function f: X → Y is said to be an onto function if every element of Y is an image of some element of set X under f, i.e for every y ∈ Y there exists an element x in X such that f(x) = y.

Properties:

  • The range of functions should be equal to the codomain.
  • Every element of B is the image of some element of A.

Condition to be onto function: The range of function should be equal to the codomain.

Onto (Surjective) Function

As we see in the above two images, the range is equal to the codomain means that every element of the codomain is mapped with the element of the domain, as we know that elements that are mapped in the codomain are known as the range. So these are examples of the Onto function.

Read More about Onto Functions.

Examples of Onto Functions

Some of the most common examples of onto functions are:

  • f(x) = x (Identity function)
  • g(x) = ex (Exponential function)
  • h(x) = sin(x) (Sine function within a limited domain, e.g., h : R→[−1,1])
  • k(x) = cos(x) (Cosine function within a limited domain, e.g., k : [0,π]→[−1,1])
  • m(x) = x3 (Cubic function)

Into Function

A function f: X → Y is said to be an into a function if there exists at least one element or more than one element in Y, which does not have any pre-images in X, which simply means that every element of the codomain are not mapped with elements of the domain.

Into Function

From the above image, we can clearly see that every element of the codomain is not mapped with elements of the domain means the 10th element of the codomain is left unmapped. So this type of function is known as Into function.

Properties:

  • The Range of function is the proper subset of B
  • The Range of functions should not equal B, where B is the codomain.

Examples of Into Functions

Some examples of into functions you can consider are:

  • f(x) = sin(x) where f:R→[−1,1] is not onto because it doesn’t cover all values in the interval [−1,1][−1,1].
  • g(x) = x2 where g:R→R+ (positive real numbers) is not onto because it doesn’t map to any negative real numbers.
  • h(x) = ex where h:R→(0,∞) is not onto because it doesn’t map to zero.

Summary: Types of Functions

All types can be summarized in the following table:

Function Type Definition Example
One-to-One (Injective) A function where each element of the domain maps to a unique element in the codomain. f(x) = 2x+3
Many-to-One A function where multiple elements of the domain may map to the same element in the codomain. f(x) = x2
Onto (Surjective) A function where every element in the codomain is mapped to by at least one element in the domain. f(x) = ex, f : R→(0,∞)
Into (Non-surjective) A function that does not cover the entire codomain; there are elements in the codomain that are not mapped to by any element in the domain. f(x) = sin(x), f:R→[−1,1]

Read More,

Solved Examples on Types of Function

Example 1: Check whether the function f(x) = 2x + 3, is one-to-one or not if Domain = {1, 2, 1/2} and Codomain = {5, 7, 4}

Solution:

Putting 1, 2, 1/2 in place of x in f(x) = 2x + 3, we get

f(1) = 5,
f(2) = 7,
f(1/2) = 4

As, for every value of x we get a unique f(x) thus, we can conclude that our function f(x) is One to One.

Example 2: Check whether the function is one-to-one or not: f(x) = 3x – 2

Solution:

To check whether a function is one to one or not, we have to check that elements of the domain have only a single pre-image in codomain or not. For checking, we can write the function as,

f(x1) = f(x2

3x1 – 2 = 3x2 – 2 

3x1 = 3x2 

x1 = x2  

Since both x1 =  x2 which means that elements of the domain having a single pre-image in its codomain. Hence the function f(x) = 3x – 2 is one to one function.

Example 3: Check whether the function is one-to-one or not: f(x) = x2 + 3.

Solution: 

To check whether the function is One to One or not, we will follow the same procedure. Now let’s check, we can write the function as,

f(x1) = f(x2

(x1)2 + 3 = (x2)2 + 3 

(x1)2 = (x2)2  

Since (x1)2 = (x2)2 is not always true.

Hence the function f(x) = x2 + 3 is not one to one function.

Example 4: If N: → N, f(x) = 2x + 1 then check whether the function is injective or not.

Solution:

In question N → N, where N belongs to Natural Number, which means that the domain and codomain of the function is a natural number. For checking whether the function is injective or not, we can write the functions as,

Let, f(x1) = f(x2)

2x1 + 1= 2x2 + 1

2x1 = 2x

x1 = x2

Since x1 = x2, means all elements of the domain are mapped with a single element of the codomain. Hence function f(x) = 2x + 1 is Injective (One to One).

Example 5: f(x) = x2, check whether the function is Many to One or not.

Solution:

Domain = {1, -1, 2, -2}, let’s put the elements of the domain in the function

f(1) = 12 = 1

f(-1) = (-1)2 = 1

f(2) = (2)2 = 4

f(-2) = (-2)2 = 4

Thus, we can see that more than one element of the domain have similar image after mapping. So this is Many to One function.

Example 6: If f(x) = 2x + 1 is defined on R:→ R. Then check whether the following function is Onto or not

Solution: 

For checking the function is Onto or not, Let’s first put the function f(x) equal to y

f(x) = y

y = 2x + 1

y – 1 = 2x

x = (y – 1) / 2

Now put the value of x in the function f(x), we get,

f((y – 1) / 2) = 2 × [(y – 1) / 2] +1

Taking LCM 2, we get

= [2(y – 1) + 2] / 2

= (2y – 2 + 2) / 2

= y

Since we get back y after putting the value of x in the function. Hence the given function f(x) = 2x + 1 is Onto function.

Example 7: If f:N → N is defined by f(x) = 3x + 1. Then prove that function f(x) is Surjective.

Solution:

To prove that the function is Surjective or not, firstly we put the function equal to y. Then find out the value of x and then put that value in the function. So let’s start solving it.

Let f(x) = y

3x + 1 = y

3x = y – 1

x = (y – 1) / 3

Now put the value of x in the function f(x), we get

f((y – 1) / 3) = {3 (y – 1) / 3} + 1

= y – 1 + 1

= y

Since we get back y after putting the value of x in the function. Hence the given function f(x) = (3x + 1) is Onto function.

Example 8: If A = R – {3} and B = R – {1}. Consider the function f: A → B defined by f(x) = (x – 2)/(x – 3), for all x ∈ A. Then show that the function f is bijective.

Solution:

To show the function is bijective we have to prove the given function both One to One and Onto.

Let’s first check for One to One:

Let x1, x2 ∈  A such that f(x1) = f(x2

Then, (x1 – 2) / (x1 – 3) = (x2 – 2) / (x2 – 3)

(x1 – 2) ( x2 – 3) = (x2 – 2) (x1 – 3)

x1 . x2 – 3x1 – 2x1 + 6 = x1 . x2 – 3x2 -2x1 + 6

-3x1 – 2x2 = -3x2 – 2x1

-3( x1 – x2) + 2( x1 – x2) = 0

-( x1 – x2) = 0

x1 – x2  = 0 

⇒ x1 = x2

Thus, f(x1) = f(x2) ⇒ x1 = x2, ∀ x1, x2  ∈ A

So, the function is a One to One

Now let us check for Onto:

Let y ∈ B = R – {1} be any arbitrary element.

Then, f(x) = y

⇒ (x – 2) / (x – 3) = y

⇒ x – 2 = xy – 3y

⇒ x – xy = 2 – 3y

⇒ x(1 – y) = 2 – 3y

⇒ x =  (2 – 3y) / (1 – y) or x = (3y – 2) / (y – 1)

Now put the value of x in the function f(x) 

f((3y – 2) / (y – 1)) = { (3y – 2) / (y – 1) } – 2 / { (3y – 2) / (y – 1) – 3 }

= (3y – 2 – 2y + 2) / (3y – 2 – 3y + 3)

= y

Hence f(x) is Onto function. Since we proved both One to One and Onto this implies that the function is Bijective.

Example 9: A = {1, 2, 3, 4}, B = {a, b, c, d} then the function is defined as f = {(1, a), (2, b), (3, c), (4, d)}. Check whether the function is One to One Onto or not.

Solution: 

To check whether the function is One to One Onto or not. We have to check for both one by one. 

Let’s check for One to One:

As we know the condition for One to One that all the elements of the domain are having a single image in the codomain. As we see in the mapping that all the elements of set A are mapped with set B and each having a single image after mapping. 

So the function is One to One.

Now let’s check for Onto:

As we know the condition for the function to be Onto is that, Range = Codomain means all the elements of codomain are mapped with domain elements, in this case, codomain will equal to the domain. As we see in the mapping that the condition of the function to be Onto is satisfied. 

So the function is Onto. 

Since we had proved that the function is both One to One and Onto. 

Hence function is One to One Onto (Bijective).

Example 10: A = {1, 2, 3, 4}, B = {a, b, c, d}. The function is defined as f = {(1, a), (2, b), (3, c), (4, c)}. Check whether the function is Many to One Into or not.

Solution:

To check the function is Many to One Into or not. We have to check for both one by one.

Let’s first check for Many to One function:

As we know the condition for Many to One function is that more than one element of domain should have more same image in codomain. From the above mapping we can see that the elements of A {3, 4 } are having same image in B { c }, so the function is Many to One.

Now let’s check for Into function:

As we know the condition for Into function is that the Range of function should be the subset of codomain and also not equal to codomain. Let’s check both the conditions are satisfied or not.

  • Range of function = {a, b, c}
  • Codomain of function = {a, b, c, d}

Range of function ≠ Codomain of function

As we check that the range of function is not equal to codomain of the function. Hence we can say that the function is Into function. As we prove that the function is Many to One and Into. 

Hence the function is Many to One Into.

FAQs on Types of Function

What is domain and codomain of a function?

A domain of a function is defined as the set of values for which the function is defined. The function exist inside its domain. A codomain of a function is defined as the set of all possible output values f that function.

Define a function.

A function is defined as a relation between a set of values where for each input we have only one output.

Write the ways in which a function is represented.

A function is represented as y = f(x) where, x is the input value and f(x) is the output value.

How to Solve Cubic Functions?

The general form of cubic function is f(x) = ax3 + bx2 + cx +d, and if f(a) = 0, then x-a is the factor of this cubic function.

How do you prove that a Function is Onto?

In an onto function range is equal to co-domain, so any function is onto only when its range is equal to its codomain.



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads