This article may be too technical for most readers to understand.(March 2019) |
In combinatorics, the twelvefold way is a systematic classification of 12 related enumerative problems concerning two finite sets, which include the classical problems of counting permutations, combinations, multisets, and partitions either of a set or of a number. The idea of the classification is credited to Gian-Carlo Rota, and the name was suggested by Joel Spencer. [1]
Let N and X be finite sets. Let and be the cardinalities of the sets. Thus N is a set with n elements, and X is a set with x elements.
The general problem we consider is the enumeration of equivalence classes of functions .
The functions are subject to one of the three following restrictions:
(The condition "f is bijective" is only an option when ; but then it is equivalent to both "f is injective" and "f is surjective".)
There are four different equivalence relations which may be defined on the set of functions f from N to X:
The three conditions on the functions and the four equivalence relations can be paired in 3 × 4 = 12 ways.
The twelve problems of counting equivalence classes of functions do not involve the same difficulties, and there is not one systematic method for solving them. Two of the problems are trivial (the number of equivalence classes is 0 or 1), five problems have an answer in terms of a multiplicative formula of n and x, and the remaining five problems have an answer in terms of combinatorial functions (Stirling numbers and the partition function for a given number of parts).
The incorporation of classical enumeration problems into this setting is as follows.
The various problems in the twelvefold way may be considered from different points of view.
Traditionally many of the problems in the twelvefold way have been formulated in terms of placing balls in boxes (or some similar visualization) instead of defining functions. The set N can be identified with a set of balls, and X with a set of boxes; the function then describes a way to distribute the balls into the boxes, namely by putting each ball a into box . A function ascribes a unique image to each value in its domain; this property is reflected by the property that any ball can go into only one box (together with the requirement that no ball should remain outside of the boxes), whereas any box can accommodate an arbitrary number of balls. Requiring in addition to be injective means to forbid putting more than one ball in any one box, while requiring to be surjective means insisting that every box contain at least one ball.
Counting modulo permutations of N or X is reflected by calling the balls or the boxes, respectively, "indistinguishable". This is an imprecise formulation, intended to indicate that different configurations are not to be counted separately if one can be transformed into the other by some interchange of balls or of boxes. This possibility of transformation is formalized by the action by permutations.
Another way to think of some of the cases is in terms of sampling, in statistics. Imagine a population of X items (or people), of which we choose N. Two different schemes are normally described, known as "sampling with replacement" and "sampling without replacement". In the former case (sampling with replacement), once we've chosen an item, we put it back in the population, so that we might choose it again. The result is that each choice is independent of all the other choices, and the set of samples is technically referred to as independent identically distributed. In the latter case, however, once we have chosen an item, we put it aside so that we can not choose it again. This means that the act of choosing an item has an effect on all the following choices (the particular item can not be seen again), so our choices are dependent on one another.
A second distinction among sampling schemes is whether ordering matters. For example, if we have ten items, of which we choose two, then the choice (4, 7) is different from (7, 4) if ordering matters; on the other hand, if ordering does not matter, then the choices (4, 7) and (7, 4) are equivalent.
The first two rows and columns of the table below correspond to sampling with and without replacement, with and without consideration of order. The cases of sampling with replacement are found in the column labeled "Any ", while the cases of sampling without replacement are found in the column labeled "Injective ". The cases where ordering matters are found in the row labeled "Distinct," and the cases where ordering does not matter are found in the row labeled "Sn orbits". Each table entry indicates how many different sets of choices there are, in a particular sampling scheme. Three of these table entries also correspond to probability distributions. Sampling with replacement where ordering matters is comparable to describing the joint distribution of N separate random variables, each with an X-fold categorical distribution. Sampling with replacement where ordering does not matter, however, is comparable to describing a single multinomial distribution of N draws from an X-fold category, where only the number seen of each category matters. Sampling without replacement where ordering does not matter is comparable to a single multivariate hypergeometric distribution. Sampling without replacement where order does matter does not seem to correspond to a probability distribution. [2] In all the injective cases (sampling without replacement), the number of sets of choices is zero unless N ≤ X. ("Comparable" in the above cases means that each element of the sample space of the corresponding distribution corresponds to a separate set of choices, and hence the number in the appropriate box indicates the size of the sample space for the given distribution.)
From the perspective of sampling, the column labeled "Surjective " is somewhat strange: Essentially, we keep sampling with replacement until we have chosen each item at least once. Then, we count how many choices we have made, and if it is not equal to N, throw out the entire set and repeat. This is vaguely comparable to the coupon collector's problem, where the process involves "collecting" (by sampling with replacement) a set of X coupons until each coupon has been seen at least once. In all surjective cases, the number of sets of choices is zero unless N ≥ X.
A function can be considered from the perspective of X or of N. This leads to different views:
These points of view are not equally suited to all cases. The labelling and selection points of view are not well compatible with permutation of the elements of X, since this changes the labels or the selection; on the other hand the grouping point of view does not give complete information about the configuration unless the elements of X may be freely permuted. The labelling and selection points of view are more or less equivalent when N is not permuted, but when it is, the selection point of view is more suited. The selection can then be viewed as an unordered selection: a single choice of a (multi-)set of n elements from X is made.
When viewing as a labelling of the elements of N, the latter may be thought of as arranged in a sequence, and the labels from X as being successively assigned to them. A requirement that be injective means that no label can be used a second time; the result is a sequence of labels without repetition. In the absence of such a requirement, the terminology "sequences with repetition" is used, meaning that labels may be used more than once (although sequences that happen to be without repetition are also allowed).
When viewing as an unordered selection of the elements of X, the same kind of distinction applies. If must be injective, then the selection must involve n distinct elements of X, so it is a subset of X of size n, also called an n-combination. Without the requirement, one and the same element of X may occur multiple times in the selection, and the result is a multiset of size n of elements from X, also called an n-multicombination or n-combination with repetition.
The requirement that be surjective, from the viewpoint of labelling elements of N, means that every label is to be used at least once; from the viewpoint of selection from X, it means that every element of X must be included in the selection at least once. Labelling with surjection is equivalent to a grouping of elements of N followed by labeling each group by an element of X, and is accordingly somewhat more complicated to describe mathematically.
When viewing as a grouping of the elements of N (which assumes one identifies under permutations of X), requiring to be surjective means the number of groups must be exactly x. Without this requirement the number of groups can be at most x. The requirement of injective means each element of N must be a group in itself, which leaves at most one valid grouping and therefore gives a rather uninteresting counting problem.
When in addition one identifies under permutations of N, this amounts to forgetting the groups themselves but retaining only their sizes. These sizes moreover do not come in any definite order, while the same size may occur more than once; one may choose to arrange them into a weakly decreasing list of numbers, whose sum is the number n. This gives the combinatorial notion of a partition of the number n, into exactly x (for surjective ) or at most x (for arbitrary ) parts.
Formulas for the different cases of the twelvefold way are summarized in the following table; each table entry links to a subsection below explaining the formula.
-class | Any | Injective | Surjective |
---|---|---|---|
Distinct f | n-sequence in X | n-permutation of X | composition of N with X subsets |
Sn orbits f ∘ Sn | n-multisubset of X | n-subset of X | composition of n with x terms |
Sx orbits Sx ∘ f | partition of N into ≤ x subsets | partition of N into ≤ x elements | partition of N into x subsets |
Sn×Sx orbits Sx ∘ f ∘ Sn | partition of n into ≤ x parts | partition of n into ≤ x parts 1 | partition of n into x parts |
The particular notations used are:
This is a quick summary of what the different cases mean. The cases are described in detail below.
Think of a set of X numbered items (numbered from 1 to x), from which we choose n, yielding an ordered list of the items: e.g. if there are items of which we choose , the result might be the list (5, 2, 10). We then count how many different such lists exist, sometimes first transforming the lists in ways that reduce the number of distinct possibilities.
Then the columns mean:
And the rows mean:
The chart below is similar to the chart above, but instead of showing the formulas, it gives an intuitive understanding of their meaning using the familiar balls and boxes example. The rows represent the distinctness of the balls and boxes. The columns represent if multi-packs (more than one ball in one box), or empty boxes are allowed. The cells in the chart show the question that is answered by solving the formula given in the formula chart above.
The cases below are ordered in such a way as to group those cases for which the arguments used in counting are related, which is not the ordering in the table given.
This case is equivalent to counting sequences of n elements of X with no restriction: a function f : N → X is determined by the n images of the elements of N, which can each be independently chosen among the elements of x. This gives a total of xn possibilities.
Example:
This case is equivalent to counting sequences of ndistinct elements of X, also called n-permutations of X, or sequences without repetitions; again this sequence is formed by the n images of the elements of N. This case differs from the one of unrestricted sequences in that there is one choice fewer for the second element, two fewer for the third element, and so on. Therefore instead of by an ordinary power of x, the value is given by a falling factorial power of x, in which each successive factor is one fewer than the previous one. The formula is
Note that if n>x then one obtains a factor zero, so in this case there are no injective functions N → X at all; this is just a restatement of the pigeonhole principle.
Example:
This case is equivalent to counting subsets with n elements of X, also called n-combinations of X: among the sequences of n distinct elements of X, those that differ only in the order of their terms are identified by permutations of N. Since in all cases this groups together exactly n! different sequences, we can divide the number of such sequences by n! to get the number of n-combinations of X. This number is known as the binomial coefficient , which is therefore given by
Example:
This case is equivalent to counting multisets with n elements from X (also called n-multicombinations). The reason is that for each element of X it is determined how many elements of N are mapped to it by f, while two functions that give the same such "multiplicities" to each element of X can always be transformed into another by a permutation of N. The formula counting all functions N → X is not useful here, because the number of them grouped together by permutations of N varies from one function to another. Rather, as explained under combinations, the number of n-multicombinations from a set with x elements can be seen to be the same as the number of n-combinations from a set with x + n − 1 elements. This reduces the problem to another one in the twelvefold way, and gives as result
Example:
This case is equivalent to counting multisets with n elements from X, for which each element of X occurs at least once. This is also equivalent to counting the compositions of n with x (non-zero) terms, by listing the multiplicities of the elements of x in order. The correspondence between functions and multisets is the same as in the previous case, and the surjectivity requirement means that all multiplicities are at least one. By decreasing all multiplicities by 1, this reduces to the previous case; since the change decreases the value of n by x, the result is
Note that when n<x there are no surjective functions N → X at all (a kind of "empty pigeonhole" principle); this is taken into account in the formula, by the convention that binomial coefficients are always 0 if the lower index is negative. The same value is also given by the expression
except in the extreme case n = x = 0, where with the former expression correctly gives , while the latter incorrectly gives .
The form of the result suggests looking for a manner to associate a class of surjective functions N → X directly to a subset of n − x elements chosen from a total of n − 1, which can be done as follows. First choose a total ordering of the sets N and X, and note that by applying a suitable permutation of N, every surjective function N → X can be transformed into a unique weakly increasing (and of course still surjective) function. If one connects the elements of N in order by n − 1 arcs into a linear graph, then choosing any subset of n − x arcs and removing the rest, one obtains a graph with x connected components, and by sending these to the successive elements of X, one obtains a weakly increasing surjective function N → X; also the sizes of the connected components give a composition of n into x parts. This argument is basically the one given at stars and bars, except that there the complementary choice of x − 1 "separations" is made.
Example:
In this case we consider sequences of n distinct elements from X, but identify those obtained from one another by applying to each element a permutation of X. It is easy to see that two different such sequences can always be identified: the permutation must map term i of the first sequence to term i of the second sequence, and since no value occurs twice in either sequence these requirements do not contradict each other; it remains to map the elements not occurring in the first sequence bijectively to those not occurring in the second sequence in an arbitrary way. The only fact that makes the result depend on n and x at all is that the existence of any such sequences to begin with requires n ≤ x, by the pigeonhole principle. The number is therefore expressed as , using the Iverson bracket.
This case is reduced to the previous one: since all sequences of n distinct elements from X can already be transformed into each other by applying a permutation of X to each of their terms, also allowing reordering of the terms does not give any new identifications; the number remains .
This case is equivalent to counting partitions of N into x (non-empty) subsets, or counting equivalence relations on N with exactly x classes. Indeed, for any surjective function f : N → X, the relation of having the same image under f is such an equivalence relation, and it does not change when a permutation of X is subsequently applied; conversely one can turn such an equivalence relation into a surjective function by assigning the elements of X in some manner to the x equivalence classes. The number of such partitions or equivalence relations is by definition the Stirling number of the second kind S(n,x), also written . Its value can be described using a recursion relation or using generating functions, but unlike binomial coefficients there is no closed formula for these numbers that does not involve a summation.
For each surjective function f : N → X, its orbit under permutations of X has x! elements, since composition (on the left) with two distinct permutations of X never gives the same function on N (the permutations must differ at some element of X, which can always be written as for some i∈N, and the compositions will then differ at i). It follows that the number for this case is x! times the number for the previous case, that is
Example:
This case is like the corresponding one for surjective functions, but some elements of x might not correspond to any equivalence class at all (since one considers functions up to a permutation of X, it does not matter which elements are concerned, just how many). As a consequence one is counting equivalence relations on N with at most x classes, and the result is obtained from the mentioned case by summation over values up to x, giving . In case x ≥ n, the size of x poses no restriction at all, and one is counting all equivalence relations on a set of n elements (equivalently all partitions of such a set); therefore gives an expression for the Bell number Bn.
This case is equivalent to counting partitions of the number n into x non-zero parts. Compared to the case of counting surjective functions up to permutations of X only (), one only retains the sizes of the equivalence classes that the function partitions N into (including the multiplicity of each size), since two equivalence relations can be transformed into one another by a permutation of N if and only if the sizes of their classes match. This is precisely what distinguishes the notion of partition of n from that of partition of N, so as a result one gets by definition the number px(n) of partitions of n into x non-zero parts.
This case is equivalent to counting partitions of the number n into ≤ x parts. The association is the same as for the previous case, except that now some parts of the partition may be equal to 0. (Specifically, they correspond to elements of X not in the image of the function.) Each partition of n into at most x non-zero parts can be extended to such a partition by adding the required number of zeroes, and this accounts for all possibilities exactly once, so the result is given by . By adding 1 to each of the x parts, one obtains a partition of n + x into x nonzero parts, and this correspondence is bijective; hence the expression given can be simplified by writing it as .
The above formulas give the proper values for all finite sets N and X. In some cases there are alternative formulas which are almost equivalent, but which do not give the correct result in some extremal cases, such as when N or X are empty. The following considerations apply to such cases.
In particular in the case of counting multisets with n elements taken from X, the given expression is equivalent in most cases to , but the latter expression would give 0 for the case n = x = 0 (by the usual convention that binomial coefficients with a negative lower index are always 0). Similarly, for the case of counting compositions of n with x non-zero parts, the given expression is almost equivalent to the expression given by the stars and bars argument, but the latter gives incorrect values for n = 0 and all values of x. For the cases where the result involves a summation, namely those of counting partitions of N into at most x non-empty subsets or partitions of n into at most x non-zero parts, the summation index is taken to start at 0; although the corresponding term is zero whenever n> 0, it is the unique non-zero term when n = 0, and the result would be wrong for those cases if the summation were taken to start at 1.
We can generalize further by allowing other groups of permutations to act on N and X. If G is a group of permutations of N, and H is a group of permutations of X, then we count equivalence classes of functions . Two functions f and F are considered equivalent if, and only if, there exist so that . This extension leads to notions such as cyclic and dihedral permutations, as well as cyclic and dihedral partitions of numbers and sets.
Another generalization called the twentyfold way was developed by Kenneth P. Bogart in his book "Combinatorics Through Guided Discovery". In the problem of distributing objects to boxes both the objects and the boxes may be identical or distinct. Bogart identifies 20 cases. [3] Robert A. Proctor has constructed the thirtyfold way. [4]
№ | Objects | Condition of distribution | Recipients | |
---|---|---|---|---|
Distinct | Identical | |||
1 | Distinct | No restriction | n-sequence in X | partition of N into ≤ x subsets |
2 | At most one each | n-permutation of X | ||
3 | At least one each | composition of N with x subsets | partition of N into x subsets | |
4 | Exactly one each | permutations | ||
5 | Distinct, ordered | No restriction | ordered functions | broken permutations ( parts) Where is the Lah number |
6 | At least one each | ordered onto functions | broken permutations (x parts) Where is the Lah number | |
7 | Identical | No restriction | n-multisubset of X | number partitions ( parts) |
8 | At most one each | n-subset of X | ||
9 | At least one each | compositions (x parts) | partition of n into x parts | |
10 | Exactly one each |
In mathematics, a combination is a selection of items from a set that has distinct members, such that the order of selection does not matter. For example, given three fruits, say an apple, an orange and a pear, there are three combinations of two that can be drawn from this set: an apple and a pear; an apple and an orange; or a pear and an orange. More formally, a k-combination of a set S is a subset of k distinct elements of S. So, two combinations are identical if and only if each combination has the same members. If the set has n elements, the number of k-combinations, denoted by or , is equal to the binomial coefficient
In mathematics, a set is countable if either it is finite or it can be made in one to one correspondence with the set of natural numbers. Equivalently, a set is countable if there exists an injective function from it into the natural numbers; this means that each element in the set may be associated to a unique natural number, or that the elements of the set can be counted one at a time, although the counting may never finish due to an infinite number of elements.
In mathematics, one can often define a direct product of objects already known, giving a new one. This induces a structure on the Cartesian product of the underlying sets from that of the contributing objects. More abstractly, one talks about the product in category theory, which formalizes these notions.
In mathematics, an equivalence relation is a binary relation that is reflexive, symmetric and transitive. The equipollence relation between line segments in geometry is a common example of an equivalence relation. A simpler example is equality. Any number is equal to itself (reflexive). If , then (symmetric). If and , then (transitive).
In mathematics, when the elements of some set have a notion of equivalence, then one may naturally split the set into equivalence classes. These equivalence classes are constructed so that elements and belong to the same equivalence class if, and only if, they are equivalent.
In mathematics, the branch of real analysis studies the behavior of real numbers, sequences and series of real numbers, and real functions. Some particular properties of real-valued sequences and functions that real analysis studies include convergence, limits, continuity, smoothness, differentiability and integrability.
In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members. The number of elements is called the length of the sequence. Unlike a set, the same elements can appear multiple times at different positions in a sequence, and unlike a set, the order does matter. Formally, a sequence can be defined as a function from natural numbers to the elements at each position. The notion of a sequence can be generalized to an indexed family, defined as a function from an arbitrary index set.
In mathematics, a surjective function (also known as surjection, or onto function ) is a function f such that, for every element y of the function's codomain, there exists at least one element x in the function's domain such that f(x) = y. In other words, for a function f : X → Y, the codomain Y is the image of the function's domain X. It is not required that x be unique; the function f may map one or more elements of X to the same element of Y.
In combinatorial mathematics, the Bell numbers count the possible partitions of a set. These numbers have been studied by mathematicians since the 19th century, and their roots go back to medieval Japan. In an example of Stigler's law of eponymy, they are named after Eric Temple Bell, who wrote about them in the 1930s.
In information theory, the asymptotic equipartition property (AEP) is a general property of the output samples of a stochastic source. It is fundamental to the concept of typical set used in theories of data compression.
The ultraproduct is a mathematical construction that appears mainly in abstract algebra and mathematical logic, in particular in model theory and set theory. An ultraproduct is a quotient of the direct product of a family of structures. All factors need to have the same signature. The ultrapower is the special case of this construction in which all factors are equal.
In mathematics, a partition of a set is a grouping of its elements into non-empty subsets, in such a way that every element is included in exactly one subset.
In combinatorics, the inclusion–exclusion principle is a counting technique which generalizes the familiar method of obtaining the number of elements in the union of two finite sets; symbolically expressed as
In mathematics, especially order theory, a weak ordering is a mathematical formalization of the intuitive notion of a ranking of a set, some of whose members may be tied with each other. Weak orders are a generalization of totally ordered sets and are in turn generalized by (strictly) partially ordered sets and preorders.
In mathematics, a set A is Dedekind-infinite if some proper subset B of A is equinumerous to A. Explicitly, this means that there exists a bijective function from A onto some proper subset B of A. A set is Dedekind-finite if it is not Dedekind-infinite. Proposed by Dedekind in 1888, Dedekind-infiniteness was the first definition of "infinite" that did not rely on the definition of the natural numbers.
In mathematics, injections, surjections, and bijections are classes of functions distinguished by the manner in which arguments and images are related or mapped to each other.
In mathematics, particularly in combinatorics, a Stirling number of the second kind is the number of ways to partition a set of n objects into k non-empty subsets and is denoted by or . Stirling numbers of the second kind occur in the field of mathematics called combinatorics and the study of partitions. They are named after James Stirling.
In combinatorics, the Eulerian number is the number of permutations of the numbers 1 to in which exactly elements are greater than the previous element.
In number theory and enumerative combinatorics, the ordered Bell numbers or Fubini numbers count the weak orderings on a set of elements. Weak orderings arrange their elements into a sequence allowing ties, such as might arise as the outcome of a horse race.
In mathematics, Kingman's subadditive ergodic theorem is one of several ergodic theorems. It can be seen as a generalization of Birkhoff's ergodic theorem. Intuitively, the subadditive ergodic theorem is a kind of random variable version of Fekete's lemma. As a result, it can be rephrased in the language of probability, e.g. using a sequence of random variables and expected values. The theorem is named after John Kingman.