Exercise 1629Combinatorics › Counting principlesL1Added 3 Nov 2026
Counting surjections
#surjections#inclusion-exclusion#Stirling
Statement
Count surjective functions from an -element set to an -element set (with ).
Hint
Use inclusion-exclusion on which elements are missed.
Show solutionHide solution
Solution
Total. functions.
Inclusion-exclusion. Subtract those missing at least one element:
where is the Stirling number of the second kind.
Conclusion. Number of surjections .
Example. : surjections = .