Question
Quantitative Aptitude Question on Set Theory
Consider two sets A = {2, 3, 5, 7, 11, 13} and B = {1, 8, 27}. Let f be a function from A to B such that for every element b in B, there is at least one element a in A such that f(a) = b. Then, the total number of such functions f is
537
540
667
665
540
Solution
Each element of set B must be mapped to at least one element of set A, and we need to count how many such functions are possible.
We have 6 elements in set A and 3 elements in set B. The condition is that each element in B must have at least one pre-image in A, so we are looking for surjections (onto functions).
The total number of surjections from a set of size 6 to a set of size 3 can be calculated using the inclusion-exclusion principle.
The number of surjections from a set of size 6 to a set of size 3 is given by:
36−(13)26+(23)16=729−192+3=540
Thus, the total number of such functions is 540.