Last updated on July 21st, 2025
An onto function is a type of mapping where each element in the codomain set has a corresponding element in the domain set. In this article, we will discuss onto function, its properties, composition, and how to represent it.
Functions are used to represent relationships between two sets. A function f: A → B is said to be onto if every element in the codomain B is the image of at least one element in the domain.
Functions can be classified as onto or into based on how the elements of the domain are mapped to elements in the codomain. With the help of the table below, let’s look at the differences between the functions.
Onto Function | Into Function |
|
|
|
|
|
|
To calculate the number of onto functions from set A to set B, assume that set A has n elements and set B has m elements.
Let:
|A| = n
|B| = m
The number of onto functions from A to B can be calculated using the formula:
Number of onto functions = total number of functions - number of functions that are not onto
The total number of functions from A to B = mn
The number of onto functions =
mn - 1m (m - 1)n + 2m (m - 2)n + .... + (-1)mm -1 m (0)n
The number of onto functions is 0 if n < m
If n = m, then the number of onto functions is m!
A function is called onto whenever an element of the codomain is mapped to at least one element from the domain. The onto function follows certain properties; by understanding these properties, we can identify the functions.
The composition of a function in mathematics is an operation that combines two functions to create a new function. If any two functions are onto functions, then their composition is also onto. For example, if two onto functions, f: A → B and g: B → C, their composition is (g∘f): A → C is also an onto function.
This is because every element in C is mapped to B through the function g, and every element in B is mapped to A through the function f. So, composition (g∘f) has element C mapped to A.
Representing a function in a graph is the easiest way to compare the range with the co-domain. So, to verify whether the function is onto, we use a graph. A function is onto if every horizontal line intersects the graph at least once. This indicates that every value in the codomain is mapped to at least one element in the domain.
Understanding one-to-one and onto functions is important when learning about inverse functions. A one-to-one function is also known as an injective function, and an onto function is also known as a surjective function. The main difference between these functions is that every co-domain is mapped with at least one domain, whereas in a one-to-one function, each element in the co-domain is mapped to a unique element in the domain.
If a function is both onto and one-to-one is called bijective. It means that each element in the domain is mapped to a unique element in the codomain. Each element in the codomain set is the image of some element from the domain set.
An onto function is one in which every element of the co-domain is the image of at least one element from the domain. In real life, we use the onto function in different fields like science, technology, cryptography, etc. Let’s learn them in detail.
Students often confuse different types of functions, as they have similarities, and this confusion can lead to mistakes. Here are common mistakes students made with the onto function and how to avoid them.
Verify whether the function is onto or not. Let f: R → R be defined as f(x) = 2x + 3.
The function f is onto
The function f: R → R is defined by f(x) = 2x + 3.
Where x and y are real numbers. Assume f(x) = y then,
2x + 3 = y
x = (y - 3)/2
As x ∈ R for every y ∈ R in x = (y -3)/2
So, f is an onto function
Check if g is an onto function from C → D, where C = {1, 2, 3} and D = {4, 5}, and let g = {(1, 4), (2, 5), (3, 5)}
The function g is onto
Given,
C = {1, 2, 3}
D = {4, 5}
g = {(1, 4), (2, 5), (3, 5)}
Here, all the elements in set D are mapped with g; the function g is an onto function.
Let f: R → R, f(x) = 2x and g: R → R, g(x) = x + 1. Is g∘f onto?
The function g∘f is onto.
Given,
f: R → R, f(x) = 2x
g: R → R, g(x) = x + 1
So, g∘f(x) =g(f(x)) = g(2x)
= 2x + 1
A function is said to be onto when each element of the co-domain is mapped to at least one element from the domain.
Checking if x ∈ R in g∘f(x) = y
That is, 2x + 1 = y
2x = y - 1
x = (y - 1)/2
So, the function g∘f is an onto function
If f: R → R, f(x) = 5x - 7, is f onto?
Yes, the function f is onto.
For any y ∈ R,
5x - 7 = y
5x = y - 7
x = (y - 7)/5
Therefore, every real y is associated with x, such that f(x) = y. So f is an onto function.
Consider the function h: {1, 2, 3, 4} → {5, 6, 7, 8} defined as follows: h(1) = 5, h(2) = 6, h(3) = 7, and h(4) = 8. Verify if the function is onto?
The function h is onto
Here,
h: {1, 2, 3, 4} → {5, 6, 7, 8}
D = {5, 6, 7, 8}
Where, h(1) = 5
h(2) = 6
h(3) = 7
h(4) = 8
The function is onto, as all the elements in D are mapped by h
Jaskaran Singh Saluja is a math wizard with nearly three years of experience as a math teacher. His expertise is in algebra, so he can make algebra classes interesting by turning tricky equations into simple puzzles.
: He loves to play the quiz with kids through algebra to make kids love it.