NDA · Question 35
Let A = {1, 2, 3, 4, 5} and B = {6, 7}. What is the number of onto functions from A to B?
Show answer & explanationShow explanation
Answer: (C) 30
Here n(A) = m = 5 and n(B) = n = 2. The total number of functions from A to B is nᵐ = 2⁵ = 32. A function from A to B fails to be onto only if all 5 elements map to 6 or all map to 7 (2 constant functions). Using inclusion-exclusion, the number of onto functions is 2⁵ - ²C₁(1)⁵ = 32 - 2 = 30.