GATE 2012 CS (CS1) – Question 47
How many surjections exist from an n-element set (n≥2) to a two-element set?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) $2^n-2$
Explanation
Each of n domain elements independently chooses one of two images, giving 2ⁿ functions. Exactly two fail to hit both targets: the constant function to the first and the constant function to the second. Subtracting gives 2ⁿ−2, C.