Enumerate as . A function is specified by choosing the image of each of these elements independently, with possibilities each. The multiplication principle gives .
For an injective function, successive images must be distinct. If , there are choices for the first, for the second, and so on. If , the pigeonhole principle makes injectivity impossible. Thus the number of injective functions isThe product in the first case is a falling factorial.
For finite sets , the inclusion-exclusion principle statesIn a finite ambient set , its equivalent complement form iswhere the intersection for means . To see the counting mechanism, an element in exactly of the sets has coefficient , by the binomial theorem; an element in none has coefficient zero in the union formula.
Let be the set of all functions from the -element domain to the -element codomain, and let consist of the functions which omit codomain element . A function is surjective precisely when it lies outside .
For of size , the intersection consists of maps taking all their values in the remaining elements, so it has members. There are choices of . Applying the complement form of the inclusion-exclusion principle givesWhen , every fibre of a surjective function has at least one member, and the fibres partition an -element domain. Thus every fibre has exactly one member and the function is a bijection. The count of these bijections is by the successive distinct-image choices from part (a). Hence
Articles by others on the same topic
There are currently no matching articles.