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) 2n
(B) 2n – 1
(C) 2n – 2
(D) 2(2n – 2)
Answer: (C)
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 (Source: http://en.wikipedia.org/wiki/Surjective_function)
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.
Recommended Posts:
- GATE | GATE CS 2012 | Question 65
- GATE | GATE CS 2012 | Question 34
- GATE | GATE CS 2012 | Question 65
- GATE | GATE CS 2012 | Question 1
- GATE | GATE CS 2012 | Question 2
- GATE | GATE CS 2012 | Question 3
- GATE | GATE CS 2012 | Question 4
- GATE | GATE CS 2012 | Question 5
- GATE | GATE CS 2012 | Question 65
- GATE | GATE CS 2012 | Question 36
- GATE | GATE CS 2012 | Question 65
- GATE | GATE CS 2012 | Question 42
- GATE | GATE CS 2012 | Question 41
- GATE | GATE CS 2012 | Question 40
- GATE | GATE CS 2012 | Question 39



