§ Rota's twelvefold way
- Count functions from I→O.
- See that any such function is a subset of OI.
- We can write such a function as (o1,o2,…,o∣I∣)∈OI
- if we have SI∘f, this means that we can permute images.
- If we have f∘SO, this means that we can permute fibers.
§ f any function
§ f injective
- We count O(I)=O(O−1)…(O−I+1) as given by the falling factorial.
§ f surjective, with equivalence SI∘f.
- For each element o∈O, pick some subset Io⊆I. We need the subsets Io to be disjoint, and all Io to be non-empty.
- We can permute the fibers Io, so we can place them by weakly decreasing order of size.
- Then this is the same as counting partitions of I into O subsets, given by S(n,x)/ {mn} (stirling numbers of the second kind).
§ f surjective
- For each element o∈O, pick some subset Io⊆I. We need the subsets Io to be disjoint, and all Io to be non-empty.
- We get partway there by counting compositions of I: the number of ways to split ∣I∣ into (a1,a2,…,ak) such that each (ai>0) and ∑iai=∣I∣. Note that ordering matters here, since we write a tuple (a1,a2,…ak).
- For example, the compositions of 3 are (1,1,1), (1,2) and (2,1). See that we have both (1,2) and (2,1).
- Contrast this with partitions, which I write in weakly decreasing: (1,1,1), (2,1).
- This can be counted by the stars and bars method:
1 _ 2 _ 3 _ 4 _ ... _ |I|
- We want to fill the ∣I∣−1 blanks (
_
) with k bars if we want a k-composition (remember that compositions can't have zeros). So we can count this by (k∣I∣−1).
§ f surjective, with equivalence SI∘f∘SO: