BrightChamps Logo
Login

Summarize this article:

Live Math Learners Count Icon103 Learners

Last updated on October 16, 2025

Surjective Function

Professor Greenline Explaining Math Concepts

A surjective function is one in which every element of set B is associated with at least one element of set A. In a surjective function, the range is the same as the codomain. In this article, we will learn more about surjective functions, their properties, and formulas.

Surjective Function for US Students
Professor Greenline from BrightChamps

What is a Surjective Function?

The surjective function ensures that every element in set B is matched with at least one element in set A. It means that each item in set B gets mapped to at least one element in set A. 
Example:
If A = {1, 2, 3} and B = {a, b}, and the function is f = {(1, a), (2, b), (3, b)}. Here, both a and b are used. No element in the set B is unmapped, so this is a surjective function. 
Look at the given image to understand how a surjective function works visually. 
 

Professor Greenline from BrightChamps

Difference Between Injective and Surjective Functions

Functions can be classified into different types based on how elements from one set are mapped to elements of another set. The two main types of functions are: injective functions and surjective functions. The difference between injective and surjective functions is given below:
 

Category

Injective Function

Surjective Function

Nature of Mapping

Every element from the domain set maps to a different unique element in the codomain set. 

Every element in the codomain set is connected to at least one element from the domain. 

Collisions

Two different elements in the domain never map to the same element in the codomain.

Two or more elements from the same domain map to the same element in the codomain.

Inverse Function

A function has an inverse only if the function is surjective and injective

A surjective function may not have an inverse unless it is also injective.

Range and codomain

Range can be equal to or smaller than the codomain.

Range and codomain are always equal.

Symbolic Notation

f: A → B

g: A → B

Example

f(x) = x2

g(x) = ex

 

Professor Greenline from BrightChamps

What are the Properties of Surjective Function?

A function is said to be a surjective function only when the range is equal to the codomain. Given are some of the properties of a surjective function:

  • In a surjective function, every element of the codomain is mapped by at least one element from the domain. 
  • A single codomain element can be the image of more than one domain element.
  • The range of a surjective function is equal to its codomain. A function f: A → B is a surjective or onto function if its range is the same as the codomain. 
  • Every surjective function has a right inverse, and any function that has a right inverse is surjective. 
     
Professor Greenline from BrightChamps

What is the formula for Surjective functions?

For finding the number of onto functions from a set A with n elements to a set B with m elements: 
Total number of functions from A to B = mn
Number of surjective functions = Total number of functions - Number of functions that are not surjective.
The number of surjective functions can be calculated by using a special formula.
The formula to find the total number of functions that are not surjective:
1mm - 1n +  2mm - 2n - 3mm - 3n + … - m - 1m1n 
The number of surjective functions that can be found using the formula:
mn - 1mm - 1n + 2mm - 2n - 3mm - 3n + … - m - 1m1n
When n < m, the number of surjective functions = 0
n = m, the number of surjective functions = m!

Professor Greenline from BrightChamps

Real Life Applications of Surjective Function

In real life, we sometimes need to match items from one group to another so that nothing in the second group is left out. This idea is similar to a surjective function. Such functions are useful in many areas, like computer science, business, and daily activities. Some examples include: 

  • Assigning Students to Classrooms: A surjective function ensures that no classroom is left empty. When each classroom must have at least one student, we can represent students as the domain and classrooms as the codomain. 
  • Distributing Jobs to Employees: In companies, each job or task needs at least one employee to handle it. Employees (domain) are assigned to jobs (codomain). A surjective function ensures all jobs are covered and nothing is left undone.
  • Ticket Allocation for Events: When tickets are assigned to seats in a hall for an event, each seat must be booked. In this case, tickets are mapped to seats, and a surjective function ensures that no seat is left empty.
  • Website User Access: When designing websites, certain roles or permissions must be assigned to all user groups. Surjective mapping ensures every role is assigned to at least one user.
  • Course Assignments in Universities: Each course must have at least one student enrolled for it to be active. Students are mapped to courses, ensuring all courses have participants. 
     
Max Pointing Out Common Math Mistakes

Common Mistakes and How to Avoid Them in Surjective Function

When learning about surjective functions, students often make mistakes, such as misunderstanding the difference between the range and codomain or confusing surjective with one-to-one functions. Identifying and rectifying these mistakes can help them understand it more clearly.

Mistake 1

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Confusing an injective and a surjective function
 

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

Students sometimes think that a surjective function means both sets should have a unique pairing, which is injective. A surjective function only covers all the elements in B, even if some elements of A map to the same element in B. 

Mistake 2

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Applying onto function rules when n < m
 

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

A function can't be onto if A has fewer elements than B, because some elements in B will be left out. Check the sizes of sets A and B first. If n < m, then mapping is impossible.
 

Mistake 3

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Ignoring the codomain
 

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

 Students sometimes only look at the range and forget the codomain. A function is said to be surjective when the range and codomain are the same. Always compare the range with the codomain to confirm surjectivity.
 

Mistake 4

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

 Believing that every element in B has exactly one element in A
 

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

Some students believe that every element from set B should have a unique element from set A, which is wrong. In a surjective function, elements of B can have one or more elements from A pointing to them. Remember that surjective means every element in B is mapped, not necessarily by a unique element in A.
 

Mistake 5

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Confusing some other function with surjective
 

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

 Thinking that if all the elements are mapped, the function is automatically onto. This is wrong because the onto function depends on the elements of the codomain set.  
 

arrow-right
Max from BrightChamps Saying "Hey"
Hey!

Solved Examples of Surjective Function

Ray, the Character from BrightChamps Explaining Math Concepts
Max, the Girl Character from BrightChamps

Problem 1

Let A = {1, 2, 3} and B = {a, b}. Is the function f = {(1, a), (2, b), (3, b)} surjective?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"
Okay, lets begin

Yes, the given function is surjective.
 

Explanation

The codomain (B) is {a, b}
The range of f is {a, b}
Since the range and the codomain are the same, this function is surjective.
 

Max from BrightChamps Praising Clear Math Explanations
Well explained 👍
Max, the Girl Character from BrightChamps

Problem 2

Let A = {x, y, z} and B = {1, 2, 3}. Is the function g = {(x, 1), (y, 1), (z, 2)} surjective?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"
Okay, lets begin

No, the function is not surjective.
 

Explanation

codomain of the given expressions is B = {1, 2, 3}
The range of g is {1, 2}
Since, range and codomain are not equal so the function g is not surjective.
 

Max from BrightChamps Praising Clear Math Explanations
Well explained 👍
Max, the Girl Character from BrightChamps

Problem 3

Consider the function f: R → R defined by f(x) = x + 2. Is the function surjective?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"
Okay, lets begin

Yes, the function is surjective.

Explanation

 The codomain is all the real numbers(R)
For any real number y, we can find an x such that f(x) = y.
Given f(x) = x + 2, 
Solving x + 2 = y, which gives x = y - 2
Since x exists for every y ∈ R, the function is surjective.
 

Max from BrightChamps Praising Clear Math Explanations
Well explained 👍
Max, the Girl Character from BrightChamps

Problem 4

Let A = {1, 2, 3, 4} and B = {a, b, c}. Is the function h = {(1, a), (2, b), (3, b), (4, c)} surjective?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"
Okay, lets begin

Yes, the function is surjective
 

Explanation

codomain B = {a, b, c}
The range of h is {a, b, c}, because all elements of B are covered.
Since the range and codomain are the same, the function is surjective.
 

Max from BrightChamps Praising Clear Math Explanations
Well explained 👍
Max, the Girl Character from BrightChamps

Problem 5

Is the function f: R → R defined by f(x) = x2 surjective?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"
Okay, lets begin

No, the function is not surjective
 

Explanation

The codomain is all real numbers
The range of f(x) = x2 is [0, ∞), which includes only non-negative numbers.
Since negative numbers in R are not covered, f is not surjective.
 

Max from BrightChamps Praising Clear Math Explanations
Well explained 👍
Ray Thinking Deeply About Math Problems

FAQs on Surjective Function

1.What is a surjective function?

A function where every element of the codomain is matched with at least one element from the domain is known as a surjective function.
 

Math FAQ Answers Dropdown Arrow

2. Is the identity function surjective?

Yes, the identity function f(x) = x is surjective because every element in the codomain is paired with the same element in the domain.

Math FAQ Answers Dropdown Arrow

3.Can a function be both injective and surjective?

Yes, if a function is both injective and surjective, it is called a bijective function.
 

Math FAQ Answers Dropdown Arrow

4.Does surjective mapping depend on the size?

Yes, the size of the sets matters. If the domain has fewer elements than the codomain (n < m), the function cannot be surjective.

Math FAQ Answers Dropdown Arrow

5.Is a constant function surjective?

No, a constant function is not surjective because it gives the same output for every input, so many elements in the codomain are never used.
 

Math FAQ Answers Dropdown Arrow
Math Teacher Background Image
Math Teacher Image

Jaskaran Singh Saluja

About the Author

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.

Max, the Girl Character from BrightChamps

Fun Fact

: He loves to play the quiz with kids through algebra to make kids love it.

INDONESIA - Axa Tower 45th floor, JL prof. Dr Satrio Kav. 18, Kel. Karet Kuningan, Kec. Setiabudi, Kota Adm. Jakarta Selatan, Prov. DKI Jakarta
INDIA - H.No. 8-2-699/1, SyNo. 346, Rd No. 12, Banjara Hills, Hyderabad, Telangana - 500034
SINGAPORE - 60 Paya Lebar Road #05-16, Paya Lebar Square, Singapore (409051)
USA - 251, Little Falls Drive, Wilmington, Delaware 19808
VIETNAM (Office 1) - Hung Vuong Building, 670 Ba Thang Hai, ward 14, district 10, Ho Chi Minh City
VIETNAM (Office 2) - 143 Nguyễn Thị Thập, Khu đô thị Him Lam, Quận 7, Thành phố Hồ Chí Minh 700000, Vietnam
UAE - BrightChamps, 8W building 5th Floor, DAFZ, Dubai, United Arab Emirates
UK - Ground floor, Redwood House, Brotherswood Court, Almondsbury Business Park, Bristol, BS32 4QW, United Kingdom