Skip to content
Official PYQ · 2012

GATE CS 2012 Q37 — Sets, Relations and Functions

Explain with AI
How many onto (or surjective) functions are there from an nn-element (n≥2)(n ≥ 2) set to a 22-element set?

Choose one option
View worked solution

Answer: C

To find the number of onto (surjective) functions from a domain set AA with nn elements to a codomain set BB with 22 elements, we can use the principle of exclusion:

  1. Total number of functions: Each of the nn elements in AA has 22 choices in BB. Therefore, the total number of possible functions is: 2×2×⋯×2=2n2 \times 2 \times \dots \times 2 = 2^n
  2. Non-onto functions: A function is not onto if its range does not cover the entire codomain B={b1,b2}B = \{b_1, b_2\}. Since ∣B∣=2|B| = 2, the only non-onto functions are those where all elements of AA map to a single element in BB:
    • All elements map to b1b_1 (constant function 1)
    • All elements map to b2b_2 (constant function 2)
    Thus, there are exactly 22 non-onto functions.

Subtracting the non-onto functions from the total functions gives the number of onto functions:

Number of onto functions=2n−2\text{Number of onto functions} = 2^n - 2

Hence, the correct option is C.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Sets, Relations and Functions questions