Math 2.0

Combinatorics Definition

Twelvefold way

Builds on FunctionInjective functionSurjective functionSymmetric groupStirling numbers of the second kindInteger partitionFalling factorial

Definition

Let NN and XX be finite sets with ∣N∣=n\abs{N} = n and ∣X∣=x\abs{X} = x. Consider the functions f ⁣:N→Xf \colon N \to X in one of three classes: all functions, injective functions, or surjective functions. Count them in one of four ways:

  1. as functions;
  2. up to permutations of NN, so ff and f∘σf \circ \sigma count as the same for every permutation σ\sigma of NN;
  3. up to permutations of XX, so ff and τ∘f\tau \circ f count as the same for every permutation τ\tau of XX;
  4. up to permutations of both, so ff and τ∘f∘σ\tau \circ f \circ \sigma count as the same for all such σ\sigma and τ\tau.

The twelvefold way is the list of these 3⋅4=123 \cdot 4 = 12 counting problems with their answers.

Remarks

Write xn‾x^{\underline{n}} for the falling factorial, S(n,k)S(n, k) for the Stirling numbers of the second kind, and pk(m)p_k(m) for the number of partitions of mm into exactly kk parts. Write [n≤x][n \le x] for 11 if n≤xn \le x and 00 otherwise. The answers, with nn balls NN and xx boxes XX, are as follows.

count all functions injective surjective
as functions xnx^n xn‾x^{\underline{n}} x! S(n,x)x!\, S(n, x)
up to permutations of NN (x+n−1n)\binom{x + n - 1}{n} (xn)\binom{x}{n} (n−1x−1)\binom{n - 1}{x - 1}
up to permutations of XX ∑k=0xS(n,k)\sum_{k=0}^{x} S(n, k) [n≤x][n \le x] S(n,x)S(n, x)
up to both ∑k=0xpk(n)\sum_{k=0}^{x} p_k(n) [n≤x][n \le x] px(n)p_x(n)

The entry (n−1x−1)\binom{n-1}{x-1} needs n≥1n \ge 1; for n=x=0n = x = 0 there is exactly one surjection, the empty map.

Example: take n=3n = 3 and x=2x = 2, counted up to permutations of NN. A class of functions is then fixed by how many balls go into each box, so the classes are (3,0)(3, 0), (2,1)(2, 1), (1,2)(1, 2) and (0,3)(0, 3). This gives 4=(43)4 = \binom{4}{3}, as in the table.

Non-example: counting functions up to a permutation of NN that is not arbitrary, for instance only up to cyclic rotations of NN, is not one of the twelve problems. It leads to necklace counting, which is handled by the Pólya enumeration theorem.

The second row is the theory of combinations with repetition. The first entry of the first row is the number of functions between finite sets, and the second is the number of injections.

Reading path

To understand this page from the ground up, read these 21 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Element definition
  2. Falling factorial definition
  3. Integer partition concept
  4. Proposition concept
  5. Stirling numbers of the second kind concept
  6. Symmetric group concept
  7. Set definition
  8. Implication definition
  9. Predicate definition
  10. Ordered pair definition
  11. Existential quantifier definition
  12. Universal quantifier definition
  13. Cartesian product definition
  14. Subset definition
  15. Uniqueness quantifier definition
  16. Binary relation definition
  17. Function definition
  18. Codomain definition
  19. Injective function definition
  20. Surjective function definition
  21. Twelvefold way definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Twelvefold_way
About this page
Tag3BBE4XY4E9
URIm2://3BBE4XY4E9
Kinddefinition
WritingW0 stub
MSC05A15, 05A18, 05A17
DefinesTwelvefold way
UsesFunction, Injective function, Surjective function, Symmetric group, Stirling numbers of the second kind, Integer partition, Falling factorial
Changed2 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.