Question 7.
Consider two sets and . Let f be a function from A to B such that for every element in B, there is at least one element a in A such that . Then, the total number of such functions f is
Question Explanation
Set A={2,3,5,7,11,13} so |A|=6
Set B={1, 8, 27} so |B|=3
Without any restrictions, each element in A can map to any of the 3 elements in B. Thus, the total number of functions is:
Excluding Functions That Miss One Element in B: If a function does not map to an element in B, there are 2 elements in B left for mapping. The total number of such functions (for each specific element not mapped) is:
Since there are 3 elements in B, the total number of such functions is: 3x64=192
Adding Back Functions That Miss Two Elements in B: If a function misses two elements in B, there is only 1 element left for mapping. The total number of such functions is:
Since there are ways to choose which two elements are missed, the total number of such functions is: 3
Using the inclusion-exclusion principle, the number of functions where all elements of B are mapped by at least one element of A is:
729-192+3=540.



