Consider two sets and . Let be a function from to such that for every element in , there is at least one element in such that . Then, the total number of such functions is
Consider two sets and . Let be a function from to such that for every element in , there is at least one element in such that . Then, the total number of such functions is
Solution
We need to find functions where every element in gets mapped to by at least one element from . This is called an onto function.
, so
, so
We'll use the Inclusion-Exclusion Principle: count all functions, then subtract the bad ones (those that miss elements).
Each of the elements in can map to any of the elements in .
Total functions
Functions that miss element :
Elements in can only map to
Count
Functions that miss element :
Elements in can only map to
Count
Functions that miss element :
Elements in can only map to
Count
Functions missing at least one element
We overcounted functions that miss two elements, so we add them back.
Functions that miss both and :
Elements in can only map to
Count
Functions that miss both and :
Elements in can only map to
Count
Functions that miss both and :
Elements in can only map to
Count
Functions missing exactly two elements
Functions missing all three elements (impossible)
Using Inclusion-Exclusion:
Onto functions
Therefore, the total number of onto functions from to is .
Related questions:
CAT 2019 Slot 1
CAT 2021 Slot 3
CAT 2018 Slot 1
CAT 2019 Slot 2