The number of functions , which are not onto, is :
The set in the domain has elements and the set in the co-domain has elements.
Step 1: Count all possible functions.
For every element of the domain we may choose any of the images independently, so the total number of functions is
Step 2: Subtract the onto (surjective) functions.
A function is onto if each of actually appears as an image.
We count surjective functions by the Principle of Inclusion-Exclusion (PIE).
• Start with all functions: .
• Subtract those that miss at least one specific element of the co-domain.
Choosing which one is missed: ways.
If that element is excluded, only images remain, giving functions.
Hence this term is .
• Add back the functions that miss two specific elements (they were subtracted twice).
Choosing the two missed: ways.
If two are excluded, only image remains, giving function.
Hence this term is .
Therefore, the number of onto functions is
Step 3: Count the non-onto functions.
Non-onto functions = Total functions − Onto functions:
Thus, the required number of functions that are not onto is .
Option B which is:
Tagged One-one, onto functions and counting functions. Machine-assigned, so read it as a strong shortlist rather than a verdict.