Onto Function: Definition, Properties, Examples

Onto Function: Definition, Properties, Examples

Edited By Komal Miglani | Updated on Jul 02, 2025 08:00 PM IST

An onto function, also known as a surjective function, is a type of function where every element in the co-domain is mapped to at least one element in the domain. In other words, an onto function covers the entire codomain, ensuring that every possible output value is achieved by some input value.

In this article, we will explore the concept of onto functions, an important topic within the broader category of relations and functions, which is a crucial chapter in class 12 Mathematics. Understanding onto functions is essential not only for board exams but also for competitive exams such as the Joint Entrance Examination (JEE Main), SRMJEE, BITSAT, WBJEE, BCECE, and more. Over the past ten years (2013 to 2023) in the JEE Main exam, a total of five questions have been asked on this concept: one in 2013, one in 2015, one in 2019, one in 2022, and one in 2023.

Onto Function: Definition, Properties, Examples
Onto Function: Definition, Properties, Examples

Onto function

A function $f: X \rightarrow Y$ is said to be onto (or surjective), if every element of $Y$ is the image of some element of $X$ under $f$, i.e., for every $y \in Y$, there exists an element $x$ in $X$ such that $f(x)=y$

Hence, Range = co-domain for an onto function

Example: Consider, $\mathrm{X}=\left\{\mathrm{x}_1, \mathrm{x}_2, \mathrm{x}_3, \mathrm{x}_4\right\}$ and $\mathrm{Y}=\left\{\mathrm{y}_1, \mathrm{y}_2, \mathrm{y}_3\right\}$

$
f: X \rightarrow Y
$

Onto Function

As every element in $Y$ has a pre-image in $X$, so it is an onto function

Method to show onto or surjective

Find the range of $y=f(x)$ and show that range of $f(x)=\operatorname{co}$-domain of $f(x)$

Properties of Onto Functions

  1. Completeness: Every element of the codomain Y is the image of at least one element from the domain A.
  2. Range and Codomain: For a function to be onto, its range (the set of all outputs) must be equal to its codomain.
  3. Inverse Function: An onto function has a right inverse, meaning that there exists a function $g: Y \rightarrow X$ such that $f(g(y))=y$ for all $b \in Y$.

Number of Onto functions

If there is a function $f: A \rightarrow B_{\text {such that }} n(A)=m$ and $n(B)=n$, where $m \geq n$.
Then, the number of onto functions $=\displaystyle\sum_{r=1}^n(-1)^{n-r} n_{C_r} r^m$

If $A$ has $m$ elements and $B$ has $n$ elements, then the total number of onto functions can be calculated using the formula,
$n^m-\binom{n}{1}(n-1)^m+\binom{n}{2}(n-2)^m-\cdots+(-1)^{n-1}\binom{n}{n-1} 1^m$

We need to note that this formula will work only if $m ≥ n$. But if $m < n$, then the number of onto functions will be $0$ as it is not possible to use all the elements of $B$.
Therefore,

  • if $n < m$, number of onto functions $= 0$
  • if $n = m$, number of onto functions $= m!$

Example to Calculate Number of Onto Functions

If $A$ has $m$ elements and $B$ has $2$ elements, then the number of onto functions will be $2^{\mathrm{m}}-2$. This can be explained as:

  • From a set of $m$ elements in $A$ to the set of $2$ elements in $B$, the total number of functions will be $2^{\mathrm{m}}$.
  • And, out of these functions, $2$ functions are not onto, if all elements are mapped to the $1^{\text {st }}$ element of B or all elements are mapped to the $2^{\text {nd }}$ element of $B$.
  • Thus, the total number of onto functions is $2^{\mathrm{m}}-2$.
NEET Highest Scoring Chapters & Topics
This ebook serves as a valuable study guide for NEET exams, specifically designed to assist students in light of recent changes and the removal of certain topics from the NEET exam.
Download E-book

Relationship Between Onto Function and One-to-One Function

Surjective and Injective functions are the different names for onto and one-to-one functions, respectively. The primary difference is that onto functions hit all the output values, whereas one-to-one functions are the ones where each $x$ is connected to only one $y$.

A function that is both One to One and Onto is called the bijective function. Each value of the output set is connected to the input set, and each output value is connected to only one input value.

Important Notes on Onto Function

Here is a list of a few points that should be remembered while studying onto function.

  • A function is onto when its range and codomain are equal.
  • Any function can be decomposed into an onto function or a surjection and an injection.

Recommended Video Based on Onto Functions


Solved Examples Based On the Onto Functions

Example 1: In the case of an onto function, which of the following is true?

1) Codomain = Range
2) Codomain $\subseteq$ Range
3) Range $\subseteq$ Codomain
4) None of these

Solution:

By the definition of onto function, we know that:

Co-domain = Range

Hence, the answer is the option (1).

Example 2: The number of functions f from {1,2,3,........,20} onto {1,2,3,........,20} such that f(k) is a multiple of 3, whenever k is a multiple of 4, is:

Solution:

Onto function -

If $f: A \rightarrow B$ is such that each \& every element in $B$ is the $f$ image of at least one element in $A$. Then it is the Onto function.
wherein
The range of $f$ is equal to Co - domain of $f$.

$
f(k)=3,6,9,12,15,18
$

for $\mathrm{k}=4,8,12,16,20$

$
\text { ways }=6 \times 5 \times 4 \times 3 \times 2 \times 1=6!
$
For remaining numbers $=(20-5)!=15$ !
Total ways $=15!\times 6$ !

Example 3: Let $A=\left\{x_1, x_2, x_3 \ldots . ., x_7\right\}$ and $B=\left\{y_1, y_2, y_3\right\}$ be two sets containing seven and three distinct elements respectively. Then the total number of functions $f: \mathrm{A} \rightarrow \mathrm{B}$ that are onto, if there exist exactly three elements x in A such that $f(\mathrm{x})=\mathrm{y}_2$, is equal to :

Solution:

As we learned in

Number of Onto functions -


$f: A \rightarrow B$


Such that $n(A)=m$
and $n(B)=n$

$m \geqslant n$


Number of onto functions

$=\displaystyle\sum_{r=1}^n(-1)^{n-r} n_{C_r} r^m$


No. of onto functions.
Since if there exist exactly three elements $x$ in $A$ which give a single image $y_2$. If this means four elements of $A$ will give an image of $y_1$ and $y_3$. So that $\left(2^4-2\right)$ of ${ }^7 C_3$

$=(16-2)^7 C_3=14 .^7 C_3$


Hence, the answer is $14 \cdot{ }^7 C_3$.

Example 4: If $n(A)=5$ and $n(B)=3$. Find the number of onto functions $A$ to $B$.

Solution:

$\begin{aligned}
& \sum_{r=1}^3(-1)^{3-r} C_r^3 \cdot r^5 \\
& =C_1^3-C_2^3\left(2^5\right)+C_3^3\left(3^5\right) \\
& =3-96+243 \\
& =150
\end{aligned}$

Hence, the answer is 150.

Example 5: If $n(A)=3$ and $n(B)=5$. Find the number of onto functions from $A$ to $B$.
Solution:
As we have learned
Number of Onto functions-
$f: A \rightarrow B$ such that $\mathrm{n}(\mathrm{A})=\mathrm{m}$ and $\mathrm{n}(\mathrm{B})=\mathrm{n}$, where:


$m \geqslant n$
Number of onto functions

$=\sum_{r=1}^n(-1)^{n-r} n_{C_r} r^m$
For onto function n(A)$>$ n(B). Otherwise, it will always be a into function.

Hence, there are zero onto functions.

Hence, the answer is 0.

Frequently Asked Questions(FAQ)-

1. What is the onto function?

Ans: An onto function is such that for every element in the codomain there exists an element in domain which maps to it.

2. How do you know if a function is onto?

Ans: $A$ function $f: A \rightarrow B$ is onto if, for every element $b \in B$, there exists an element $a \in A$ such that $f(a)=b$. To show that $f$ is an onto function, set $y=f(x)$, and solve for $x$, or show that we can always express $x$ in terms of $y$ for any $y \in B$.

3. What is the difference between into and onto function?

Ans: A function is called an Into function if there exists at least one element in the codomain of the function, which does not have a pre-image in the domain of the function. In an Onto function, no elements in the range are left unmapped. Each element in the range is associated with at least one element in the domain.

4. What is one example of an onto function?

Ans: For example, the function $f(x) = x + 1$ is a one-to-one function because it produces a different answer for every input.

5. Why is a function not onto?

Ans: When is a function not onto? If there is an element $y$ in the co-domain for which there is no x value in the domain such that $f(x) = y$.

Frequently Asked Questions (FAQs)

1. What is a function?

Functions are one of the basic concepts in mathematics that have numerous applications in the real world.

2. What is onto function?

An onto function, also known as a surjective function, is a type of function where every element in the co-domain is mapped to at least one element in the domain.

3. What is the relation between range and codomain in onto function?

For onto function, range =codomain

4. What is the domain of a function?

All possible values of x for f(x) is defined (f(x) is a real number) is known as a domain.

5. What is the co-domain of a function?

If a function is defined from A to B i.e. f: A⇾B, then set B is called the Co-domain of the function.

6. What is an onto function?
An onto function, also called a surjective function, is a function where every element in the codomain is mapped to by at least one element in the domain. In simpler terms, the function "covers" the entire codomain.
7. How is an onto function different from a one-to-one function?
An onto function ensures that every element in the codomain has at least one corresponding element in the domain, while a one-to-one (injective) function ensures that each element in the codomain is mapped to by at most one element in the domain. A function can be onto, one-to-one, both, or neither.
8. Can a function be both onto and one-to-one?
Yes, a function can be both onto and one-to-one. Such a function is called a bijective function or a one-to-one correspondence. It ensures that every element in the codomain is paired with exactly one element in the domain.
9. What is the relationship between the domain and codomain in an onto function?
In an onto function, the size of the codomain must be less than or equal to the size of the domain. This is because every element in the codomain must be "reached" by at least one element from the domain.
10. How can you determine if a function is onto by looking at its graph?
A function is onto if every horizontal line drawn through the codomain intersects the graph of the function at least once. This visual representation ensures that every y-value in the codomain is "hit" by the function.
11. What is the importance of onto functions in mathematics?
Onto functions are crucial in many areas of mathematics. They ensure that a function covers its entire codomain, which is important in solving equations, proving theorems, and establishing relationships between sets. They also play a key role in defining inverse functions and isomorphisms between mathematical structures.
12. Can a constant function be onto?
A constant function can be onto only if its codomain consists of a single element - the constant value of the function. In most cases, constant functions are not onto because they map all elements of the domain to a single element in the codomain, leaving other codomain elements unmapped.
13. What is the difference between the range and codomain of an onto function?
For an onto function, the range and codomain are identical. The range is the set of all actual output values of a function, while the codomain is the set of all possible output values. In an onto function, every element in the codomain is actually reached, making the range equal to the codomain.
14. How does the concept of onto functions relate to solving equations?
Onto functions guarantee that for every element in the codomain, there exists at least one solution in the domain. This property is crucial when solving equations, as it ensures that a solution exists for every possible right-hand side of the equation.
15. Can a function with a finite domain be onto an infinite codomain?
No, a function with a finite domain cannot be onto an infinite codomain. Since an onto function requires every element in the codomain to be mapped to by at least one element in the domain, a finite domain cannot "reach" all elements of an infinite codomain.
16. What is the composition of two onto functions?
The composition of two onto functions is also an onto function. If f: A → B and g: B → C are both onto functions, then their composition (g ∘ f): A → C is also onto. This property is useful in proving surjectivity in complex function compositions.
17. How does the concept of onto functions apply in computer science?
In computer science, onto functions are important in areas such as data compression, hashing, and cryptography. They ensure that all possible outputs are achievable, which is crucial for creating efficient and secure algorithms.
18. What is the inverse of an onto function?
An onto function may have a left inverse, but it doesn't necessarily have a unique inverse. For an onto function to have a unique inverse, it must also be one-to-one (injective). If a function is both onto and one-to-one (bijective), its inverse is also bijective.
19. How do onto functions relate to the concept of function surjectivity?
"Onto" and "surjective" are synonymous terms. A function is called onto if and only if it is surjective. Both terms describe the property that every element in the codomain is mapped to by at least one element in the domain.
20. Can a linear function be onto?
Yes, a linear function can be onto. For example, f(x) = 2x is onto from R to R (where R is the set of real numbers). However, not all linear functions are onto. For instance, f(x) = 2x + 1 is not onto from Z to Z (where Z is the set of integers).
21. What is the relationship between onto functions and function invertibility?
For a function to be invertible, it must be both onto (surjective) and one-to-one (injective). The onto property ensures that every element in the codomain has a preimage, which is necessary for defining an inverse function on the entire codomain.
22. How can the pigeonhole principle be used to prove that a function is not onto?
The pigeonhole principle can be used to show that a function is not onto if the size of the domain is smaller than the size of the codomain. If there are fewer "pigeons" (elements in the domain) than "pigeonholes" (elements in the codomain), then some "pigeonholes" must be empty, meaning the function is not onto.
23. What is the role of onto functions in set theory?
In set theory, onto functions are used to compare the sizes of sets. If there exists an onto function from set A to set B, then the cardinality of B is less than or equal to the cardinality of A. This concept is crucial in understanding relationships between infinite sets.
24. How does the concept of onto functions apply to probability theory?
In probability theory, onto functions are important when considering transformations of random variables. If a function is onto, it ensures that all possible outcomes in the codomain can be realized, which is crucial for correctly calculating probabilities and expectations.
25. Can a polynomial function be onto?
Yes, a polynomial function can be onto, depending on its degree and the domain and codomain. For example, any odd-degree polynomial function from R to R is onto. However, even-degree polynomials from R to R are not onto as they have a minimum or maximum value.
26. What is the connection between onto functions and function epimorphisms in abstract algebra?
In abstract algebra, onto functions are equivalent to epimorphisms in the category of sets. An epimorphism is a morphism that is right-cancellative, which in the context of functions, corresponds to the onto property.
27. How do onto functions relate to the concept of function image?
For an onto function, the image of the function is equal to its codomain. The image is the set of all output values actually produced by the function, while the codomain is the set of all possible output values. In an onto function, these two sets are identical.
28. Can a piecewise function be onto?
Yes, a piecewise function can be onto. The onto property depends on how the pieces are defined and how they cover the codomain. For example, the function f(x) = x if x ≥ 0, and f(x) = -x if x < 0, is onto from R to R.
29. What is the significance of onto functions in linear algebra?
In linear algebra, onto functions (or surjective linear transformations) are important in understanding concepts like rank, nullity, and dimension. A linear transformation is onto if its range space is equal to its codomain, which has implications for solving systems of linear equations.
30. How does the concept of onto functions apply to group theory?
In group theory, onto functions (or surjective homomorphisms) are used to define quotient groups and to understand relationships between different groups. The First Isomorphism Theorem, a fundamental result in group theory, involves onto homomorphisms.
31. What is the relationship between onto functions and function kernels?
For a function to be onto, its kernel (the set of elements that map to the identity element in the codomain) must be as small as possible. In the case of linear transformations, a transformation is onto if and only if the dimension of its kernel plus the dimension of its image equals the dimension of the domain.
32. Can a trigonometric function be onto?
Some trigonometric functions can be onto for certain domains and codomains. For example, the sine function is onto from [-π/2, π/2] to [-1, 1], but it's not onto from R to R. The tangent function is onto from (-π/2, π/2) to R.
33. How do onto functions relate to the concept of function cardinality?
Onto functions are used to compare the cardinalities of sets. If there exists an onto function from set A to set B, then the cardinality of B is less than or equal to the cardinality of A. This concept is particularly important when dealing with infinite sets.
34. What is the role of onto functions in category theory?
In category theory, onto functions correspond to epimorphisms in the category of sets. This generalization allows the concept of "onto" to be extended to other mathematical structures beyond just functions between sets.
35. How can the concept of onto functions be visualized using Venn diagrams?
In a Venn diagram representation of an onto function, every element in the codomain (represented by one circle) would have at least one arrow pointing to it from an element in the domain (represented by another circle). There would be no elements in the codomain circle without an incoming arrow.
36. What is the connection between onto functions and function restrictions?
A function that is not onto can sometimes be made onto by restricting its codomain to its range. This process creates a new function with the same rule but a smaller codomain, ensuring that every element in the new codomain is "reached" by the function.
37. How do onto functions relate to the concept of function decomposition?
In function decomposition, if a composite function (g ∘ f) is onto, then g must be onto. However, f is not necessarily onto. This property is useful in analyzing and constructing complex functions from simpler ones.
38. Can a rational function be onto?
Yes, a rational function can be onto, depending on its domain and codomain. For example, f(x) = x / (x + 1) is onto from R \ {-1} to R \ {1}. However, not all rational functions are onto for all domains and codomains.
39. What is the significance of onto functions in topology?
In topology, onto functions (or surjective continuous maps) are important in defining quotient spaces and in understanding relationships between topological spaces. They preserve certain topological properties and are crucial in the study of homeomorphisms and homotopy equivalences.
40. How does the concept of onto functions apply to vector spaces?
In the context of vector spaces, onto linear transformations (surjective linear maps) are important in understanding concepts like basis, dimension, and isomorphism. An onto linear transformation from one vector space to another implies that the dimension of the codomain is less than or equal to the dimension of the domain.
41. What is the relationship between onto functions and function graphs?
The graph of an onto function must "cover" the entire range of y-values in the codomain. Visually, this means that any horizontal line drawn through the codomain will intersect the function's graph at least once.
42. How do onto functions relate to the concept of function continuity?
While continuity and the onto property are independent concepts, they often interact in interesting ways. For example, the Intermediate Value Theorem states that a continuous function on a closed interval is onto its range. This theorem is crucial in proving the existence of solutions to certain equations.
43. Can a logarithmic function be onto?
Yes, a logarithmic function can be onto for certain domains and codomains. For example, the natural logarithm function ln(x) is onto from (0, ∞) to R. However, logarithmic functions are not onto from R to R due to their domain restrictions.
44. What is the importance of onto functions in coding theory?
In coding theory, onto functions are crucial for creating efficient codes. They ensure that all possible messages can be encoded, which is essential for lossless data compression and error-correcting codes.
45. How do onto functions relate to the concept of function optimization?
In optimization problems, onto functions ensure that all possible values in the codomain (which often represents the set of possible solutions) are achievable. This property is important when searching for global optima, as it guarantees that the optimal solution is within the range of the function.
46. What is the connection between onto functions and function periodicity?
Periodic functions, such as sine and cosine, are onto their range but not necessarily onto their codomain. The onto property for periodic functions is often achieved by restricting the domain to one period and the codomain to the range of the function over that period.
47. How can the concept of onto functions be applied in real-world scenarios?
Onto functions have many real-world applications. In manufacturing, an onto function might represent a process that can produce all possible product specifications. In economics, an onto function could model a pricing strategy that covers all possible market prices. In biology, it could represent a gene that can express all possible phenotypes in a given range.
48. What is the role of onto functions in functional analysis?
In functional analysis, onto linear operators (surjective continuous linear maps between normed vector spaces) play a crucial role. The open mapping theorem, a fundamental result in functional analysis, states that a bounded linear operator between Banach spaces is onto if and only if it is an open map.
49. How do onto functions relate to the concept of function injectivity?
Onto (surjective) and one-to-one (injective) are independent properties of functions. A function can be onto without being one-to-one, one-to-one without being onto, both (bijective), or neither. Understanding the relationship between these properties is crucial for analyzing function behavior and invertibility.
50. Can an exponential function be onto?
An exponential function can be onto for certain domains and codomains. For example, the exponential function f(x) = e^x is onto from R to (0, ∞). However, exponential functions are not onto from R to R due to their range restrictions.
51. What is the significance of onto functions in number theory?
In number theory, onto functions are used in various contexts, such as in the study of modular arithmetic and in defining homomorphisms between number-theoretic structures. They are also crucial in understanding concepts like divisibility and congruence relations.
52. How do onto functions relate to the concept of function composition?
In function composition, if g ∘ f is onto, then g must be onto. However, f is not necessarily onto. This property is useful in analyzing complex functions and in proving surjectivity in multi-step processes.
53. What is the role of onto functions in mathematical logic?
In mathematical logic, onto functions are important in model theory and in defining semantic interpretations. They ensure that all elements in the codomain (which might represent truth values or elements of a model) are "reachable" by the interpretation function.
54. How can the concept of onto functions be extended to multivariable functions?
For multivariable functions, the onto property still means that every element in the codomain is reached by at least one element in the domain. However, the domain now consists of ordered pairs, triples, or n-tuples, depending on the number of variables. The visualization and analysis of onto properties become more complex in higher dimensions.
55. What is the importance of onto functions in the study of infinite sets?
Onto functions play a crucial role in comparing the sizes of infinite sets. Cantor's theorem, a fundamental result in set theory, uses the concept of onto functions to prove that the power set of a set always has a strictly larger cardinality than the original set. This leads to the hierarchy of infinite cardinal numbers and deepens our understanding of the nature of infinity.

Articles

Back to top