GATE / CS ARCHIVE

GATE CSE 2015 SET 2 / QUESTION 58

GATE CSE 2015 Set 2 Q58

Discrete Mathematics · Sets, Relations & Functions · Full GATE CSE 2015 Set 2 paper

GATE 2015 Set 2, Q58 2 marks · NAT
Report issue

Sets, Relations & Functions

Question 58, GATE 2015: How many onto functions exist from a four-element set to a three-element set?
Tap to enlarge
Answer & solution

Official answer: 36

There are 34 total functions. Exclude functions omitting at least one codomain value by inclusion-exclusion: 34−C(3, 1)24+C(3, 2)14=81−48+3=36. Equivalently choose the repeated pair of domain elements in 6 ways, its image in 3 ways and assign the other two images in 2 ways.

There are 3⁴=81 functions in total. For each of the three codomain elements, 2⁴=16 functions omit it. Subtract 3·16, then restore the three intersections where only one codomain element is used. The result is 81−48+3=36. Equivalently, an onto function must have fiber sizes 2, 1, 1: choose the repeated pair in C(4, 2)=6 ways, its image in 3 ways and assign the remaining two images in 2 ways. Both counts give 36.

Original paper, page 48 · Answer key