Concept:The number of onto functions from a set
A with
m elements to a set
B with
n elements (
m≥n) is given by the inclusion-exclusion principle:
nm−(1n)(n−1)m+(2n)(n−2)m−⋯+(−1)n−1(n−1n)1m.
Explanation:Here
A={1,2,3,4,5} so
m=5, and
B={6,7} so
n=2.
An onto function requires every element of
B to have at least one preimage in
A.
Total possible functions from
A to
B are
25=32.
From these, subtract the functions that are not onto, i.e., those that miss at least one element of
B.
Number of functions that miss a specific element (say 6) is
(2−1)5=15=1 (all elements of
A map to the other element).
There are
(12)=2 ways to choose which element is missing.
Thus, number of onto functions =
32−2×1=30.
So the correct answer is
30.
Answer:30 (Option C)