Test of Mathematics Solution Subjective 46 - Number of Onto Functions

Join Trial or Access Free Resources

Test of Mathematics at the 10+2 Level

This is a Test of Mathematics Solution Subjective 46 (from ISI Entrance). The book, Test of Mathematics at 10+2 Level is Published by East West Press. This problem book is indispensable for the preparation of I.S.I. B.Stat and B.Math Entrance.


Also visit: I.S.I. & C.M.I. Entrance Course of Cheenta

Problem

A function \(f\) from set \(A\) into set \(B\) is a rule which assigns each element \(x\) in \(A\), a unique (one and only one) element (denoted by \(f(x)\) in \(B\). A function of set from \(A\) into \(B\) is called an onto function, if for each element \(y\) in \(B\) there is some element \(x\) in \(A\), such that \(f(x)=y\). Now suppose that \(A =\) {\(1,2,\cdots,n\)} and \(B=\){\(1,2,3\)}. Determine the total number of onto functions of \(A\) into \(B\).

Sequential Hints


(How to use this discussion: Do not read the entire solution at one go. First, read more on the Key Idea, then give the problem a try. Next, look into Step 1 and give it another try and so on.)

Key Idea

This is the generic use case of Inclusion-Exclusion Principle. Read on this from Wikipedia

Step 1

1 may map to 1, 2, or 3 (3 choices). For each of these three choices, may map to 1, 2, or 3 (again three choices. Hence 3 choices again. How many functions are possible in total? Can you delete the functions which are not onto from the total number of functions?

Try the problem with this hint before looking into step 2. Remember, no one learnt mathematics by looking at solutions.

The total number of functions is \( 3^n \) since there are 3 output choices for each of the n input choices. Now let us count the functions which are not onto.

How many functions are there such that \( 1 \in B \) has no preimage? (that is nothing is going to 1). There are \( 2^n \) such functions as each of the n elements of A has 2 choices. Similarly, count the cases where nothing goes to 2 (\(2^n \) more cases) and nothing goes to 3 (\( 2^n \) more cases).

Delete these 'not onto' cases ( \( 3 \times 2^n \)) from total number of cases ( \( 3^n \) ).

But we have double deleted the case where nothing goes to 1 'and' nothing goes to 2. This is the case where everything goes to 3. Only one such function is there: f(x) = 3.

Similarly, we have double deleted the case where nothing goes to 2 'and' nothing goes to 3. This is the case where everything goes to 1. Only one such function is there: f(x) = 1.

Similarly, we have double deleted the case where nothing goes to 1 'and' nothing goes to 3.

This is the case where everything goes to 2. Only one such function is there: f(x) = 2. Since we do not want to double delete something, we add back these three cases.

Thus the final answer is: \( 3^n - 3 \times 2^n + 3 \)

More Posts
ISI M.Stat Entrance Success Story 2026

ISI M.Stat Entrance Success Story 2026

June 27, 2026

In 2026, the following Cheenta students have been successful for Indian Statistical Institute's M.Stat Entrance. They ranked within the first 50 in the entire country in these entrances. I.S.I. M.Stat Entrance

Read More
ISI B.Stat-B.Math and CMI BSc. Math Entrance Success Story 2026

ISI B.Stat-B.Math and CMI BSc. Math Entrance Success Story 2026

In 2026, the following Cheenta students have been successful for Indian Statistical Institute's B.Stat Entrance and Chennai Mathematical Institute's B.Sc. Math Entrance. They ranked within the first 200 in the entire country in these entrances. Most of these students attended the problem solving workshops regularly, which happen 5 days every week. CMI B.Sc. Math Entrance […]

Read More
8 Cheenta students cracked the Regional Math Olympiad 2025 

8 Cheenta students cracked the Regional Math Olympiad 2025 

December 26, 2025

In 2025, 8 students from Cheenta Academy cracked the prestigious Regional Math Olympiad. In this post, we will share some of their success stories and learning strategies. The Regional Mathematics Olympiad (RMO) and the Indian National Mathematics Olympiad (INMO) are two most important mathematics contests in India.These two contests are for the students who are […]

Read More
Cheenta Students Shine at IOQM 2025

Cheenta Students Shine at IOQM 2025

October 26, 2025

Cheenta Academy proudly celebrates the success of 27 current and former students who qualified for the Indian Olympiad Qualifier in Mathematics (IOQM) 2025, advancing to the next stage — RMO. This accomplishment highlights their perseverance and Cheenta’s ongoing mission to nurture mathematical excellence and research-oriented learning.

Read More
© 2010 - 2025, Cheenta Academy. All rights reserved.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram