Defence PYQWritten Exam 2024MathematicsSets, Relations and Functions

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?

  1. 10

  2. 20

  3. 30

  4. 32

Show answer & explanationShow explanation

Answer: (C) 30

Explanation

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.