Question
The number of onto functions (surjective functions) from set to set is _____.
Official answer and solution
- Official answer
- 36
- From
- Official GATE 2015 answer key
Solution
Apply the Principle of Inclusion-Exclusion to count surjective functions from a 4-element set to a 3-element set.
We need the number of onto functions from set () to set ().
By the Principle of Inclusion-Exclusion, the number of onto functions is given by:
where and .
Calculating each term:
- :
- :
- :
- :
Total number of onto functions:
Alternatively, partitioning 4 distinct elements into 3 non-empty subsets must be of sizes . The number of ways to partition is , and the number of ways to assign the 3 subsets to the 3 target elements is . Total onto functions = .
36
Computing total functions without subtracting non-surjective functions.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 2
- Question
- 50 of 65, printed as CS Q.40
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.