---
tag: 1J16RVRHYS
kind: concept
name: Twelvefold way
msc: [05A15, 05A18, 05A17]
specializes: [EX382NQTGP]
sources:
  - url: https://en.wikipedia.org/wiki/Twelvefold_way
same_as:
  wikidata: Q7857666
  wikipedia: Twelvefold way
---

## Summary

The twelvefold way is a table of twelve basic counting problems, see the [[definition|3BBE4XY4E9]].
Each problem counts maps from a finite set $N$ to a finite set $X$.
The maps may be arbitrary, injective or surjective.
They may be counted as they are, or up to permutations of $N$, of $X$, or of both.
The twelve answers bring together powers, [[falling factorials|0SJNCJCCQG]], [[binomial coefficients|0GBZM0MT0F]], [[Stirling numbers of the second kind|0JCQGPY8Z4]] and [[integer partitions|0JV30XN73Z]].

## Explanations

### L1 human

Think of $n$ balls that you put into $x$ boxes.
The balls may be labelled or identical, and the boxes may be labelled or identical.
You may also require at most one ball per box, or at least one ball per box.
Each choice gives one counting problem, and there are $2 \cdot 2 \cdot 3 = 12$ of them.
For example, $3$ labelled balls go into $2$ labelled boxes in $2^3 = 8$ ways, but $3$ identical balls go into $2$ labelled boxes in only $4$ ways.
