Open In App

GATE | GATE CS 2012 | Question 35

How many onto (or surjective) functions are there from an n-element (n >= 2) set to a 2-element set?
 

(A)



2(2n – 2)
 

(B)



2n – 2
 

(C)

2n – 1
 

(D)

2n
 


Answer: (B)
Explanation:

Total possible number of functions is 2n

In mathematics, a function f from a set X to a set Y is surjective (or onto), or a surjection, if every element y in Y has a corresponding element x in X such that f(x) = y

There are total 2 functions out of 2n that are NOT onto: one that maps to all 1s and other that maps to all 2s. 

Therefore total number of onto functions is 2n – 2. 

Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :