组合数学 (Fall 2024)/Basic enumeration
Basic Enumeration
The three basic rules for enumeration are:
- The sum rule: for any disjoint finite sets
and , the cardinality of the union . - The product rule: for any finite sets
and , the cardinality of the Cartesian product . - The bijection rule: if there exists a bijection between finite sets
and , then .
Now we apply these rules to solve some basic enumeration problems.
Tuples
We count the number of
It is not very hard to see that this number is
To prove this rigorously, we use "the product rule".
- The product rule: for any finite sets
and , the cardinality of the Cartesian product .
To count the size of
Functions
Consider the problem of counting the number of functions mapping from
We claim that this is the same as counting the number of
Now we summon the "the bijection rule".
- The bijection rule: if there exists a bijection between finite sets
and , then .
Applying this rule, we have that the number of functions from
Subsets
We count the number of subsets of a set.
Let
We give a combinatorial proof that
The map
Since there is a bijection between
There are two elements of the proof:
- Find a 1-1 correspondence between subsets of an
-set and -bit vectors.
- An application of this in Computer Science is that we can use bit-array as a data structure for sets: any set defined over a universe
can be represented by an array of bits.
- The bijection rule: if there is a 1-1 correspondence between two sets, then their cardinalities are the same.
Many counting problems are solved by establishing a bijection between the set to be counted and some easy-to-count set. This kind of proofs are usually called (non-rigorously) combinatorial proofs.
We give an alternative proof that
- The sum rule: for any disjoint finite sets
and , the cardinality of the union .
Define the function
Lemma .
Proof. Fix an element
, let be the set of subsets of that contain and let be the set of subsets of that do not contain . It is obvious that and are disjoint (i.e. ) and , because any subset of either contains or does not contain but not both.Applying the sum rule,
.
The next observation is that
, because is exactly the , and is the set resulting from adding to every member of . Therefore, .
The elementary case
Subsets of fixed size
We then count the number of subsets of fixed size of a set. Again, let
We denote that
Theorem .
Proof. The number of ordered
-subsets of an -set is . Every -subset has ways to order it.
- Some notations
, read " factorial", is defined as that , with the convention that . is usually denoted as , read " lower factorial ".
Binomial coefficient
The quantity
Proposition ; .
Proof. 1. We give two proofs for the first equation:
- (1) (numerical proof)
.
- (2) (combinatorial proof)
- Choosing
elements from an -set is equivalent to choosing the elements to leave out. Formally, every -subset is uniquely specified by its complement , and the same holds for -subsets, thus we have a bijection between and .
- Choosing
2. The second equation can also be proved in different ways, but the combinatorial proof is much easier. For an
-element set , it is obvious that we can enumerate all subsets of by enumerating -subsets for every possible size , i.e. it holds thatFor different
, are obviously disjoint. By the sum rule, .
- (1) (numerical proof)
Theorem (Binomial theorem) .
Proof. Write
as the product of factors .
The term
is obtained by choosing from factors and 1 from the rest factors. There are ways of choosing these factors, so the coefficient of is .
The following proposition has an easy proof due to the binomial theorem.
Proposition - For
, the numbers of subsets of an -set of even and of odd cardinality are equal.
- For
Proof. Set
in the binomial theorem.therefore
For counting problems, what we care about are numbers. In the binomial theorem, a formal variable
Compositions of an integer
A composition of
Formally, a
Suppose we have
So the number of
which is equal to the number of ways of choosing
This graphic argument can be expressed as a formal proof. We construct a bijection between the set of
Let
The number of
Formally, a weak
Given a weak
i.e.,
We now count the number of solutions to
Let
Multisets
A
- Example
. All -combination without repetitions are .
- Allowing repetitions, we also include the following 3-combinations:
Combinations with repetitions can be formally defined as multisets. A multiset is a set with repeated elements. Formally, a multiset
A
The set of all
Believe it or not: we have already evaluated the number
There is a direct combinatorial proof that
Given a
Multinomial coefficients
The binomial coefficient
This suggests a generalization allowing more than two groups. Let
The binomial coefficient is just the case when there are two groups, and
The multinomial coefficient can also be interpreted as the number of permutations of multisets. A permutation
- a bijection
; - a tuple
such that all are distinct.
There are
A permutation of a multiset
- Example
- We want to enumerate all the ways of reordering the word "multinomial". Note that in this word, the letter "m", "l" and "i" each appears twice. So the problem is to enumerate the permutations of the multiset
.
Let
Therefore,
Theorem
Proof. There are
permutations of objects. Assume that these objects are the elements of an multiset of distinct elements with and multiplicities . Since permutations of object do not change the permutation of the multiset , every permutations of these objects correspond to the same permutation of the multiset . Thus, the number of permutations of is .
We also have the Multinomial Theorem.
Theorem is the coefficient of in .
Proof. Write
.
Each of the
factors corresponds to a distinct ball, and correspond to groups. The coefficient of equals the number of ways to put distinct balls to distinct groups so that group receives balls, which is exactly our first definition of .
Partitions of a set
A partition of finite set
for every ; if (also called that blocks are pairwise disjoint); .
Each
Define
The number
- Stirling number
- Stirling numbers are named after James Stirling.There are two kinds of Stirling numbers. Stirling number of the first kind is related to the number of permutations with fixed number of disjoint cycles. And Stirling number of the second kind counts the number of ways of partitioning a set into fixed number of disjoint blocks. Both numbers arise from important combinatorial problems and have various applications in combinatorics and other branches of Mathematics.
Unlike previous identities, it is very difficult to give a determinant for
Theorem .
Proof. To partition
into blocks,- we can partition
into blocks and place into one of the blocks, which gives us ways to do so; - or we can partition
into blocks and let be a block by itself, which gives us ways to do so.
The partitions constructed by these two methods are different, since by the first method,
is always in a block of cardinality , and by the second method, is always a block. So the cases are disjoint. And any -partition of an -set must be constructible by one of the two methods, thus by the sum rule, .
- we can partition
Let
Partitions of a number
We count the ways of partitioning
A
We define
For example, number 7 has the following partitions:
Equivalently, we can also define that A
; .
Let
We now try to determine
Proposition .
Proof. Suppose that
is a -partition of . Note that it must hold that .
There are two cases:
or .- Case 1.
- If
, then is a distinct -partition of . And every -partition of can be obtained in this way. Thus the number of -partitions of in this case is . - Case 2.
- If
, then is a distinct -partition of . And every -partition of can be obtained in this way. Thus the number of -partitions of in this case is .
In conclusion, the number of
-partitions of is , i.e. .
Use the above recurrence, we can compute the
If we are not restricted ourselves to the precise estimation of
Theorem For any fixed
, ,
as
.
Proof. Suppose that
is a -partition of . Then and .The
permutations of yield at most many -compositions (the ordered sum of positive integers). There are many -compositions of , every one of which can be yielded in this way by permuting a partition. Thus, .
Let
. That is, . Then, it holds that ; and .
Each permutation of
yields a distinct -composition of , because all are distinct. Thus, .
Combining the two inequalities, we have
.
The theorem follows.
Ferrers diagram
A partition of a number
Let
- Conjugate partition
The partition we get by reading the Ferrers diagram by column instead of rows is called the conjugate of the original partition.
Clearly,
- different partitions cannot have the same conjugate, and
- every partition of
is the conjugate of some partition of ,
so the conjugation mapping is a permutation on the set of partitions of
Some theorems of partitions can be easily proved by representing partitions in Ferrers diagrams.
Proposition - The number of partitions of
which have largest summand , is . - The number of
into parts equals the number of partitions of into at most parts. Formally,
.
- The number of partitions of
Proof. - For every
-partition, the conjugate partition has largest part . And vice versa. - For a
-partition of , remove the leftmost cell of every row of the Ferrers diagram. Totally cells are removed and the remaining diagram is a partition of into at most parts. And for a partition of into at most parts, add a cell to each of the rows (including the empty ones). This will give us a -partition of . It is easy to see the above mappings are 1-1 correspondences. Thus, the number of into parts equals the number of partitions of into at most parts.
- For every
The twelvfold way
We now introduce a general framework for counting problems, called the twelvefold way. This framework is introduced by the great mathematician and also a great teacher, Gian-Carlo Rota.
Let
is an arbitrary function; is an injection (one-to-one); is a surjection (onto).
The elements of
Three restrictions on the functions, with two restrictions on each of the domain and the range, together give us twelve counting problems, called the Twelvefold Way.
The following table gives the solutions to the counting problems.
Elements of |
Elements of |
Any |
Injective (1-1) |
Surjective (on-to) |
---|---|---|---|---|
distinguishable | distinguishable | |||
indistinguishable | distinguishable | |||
distinguishable | indistinguishable | |||
indistinguishable | indistinguishable |
In the Volume 4A of Don Knuth's TAOCP, the twelvefold way is presented as the problems of counting the ways of assigning
balls per bin | unrestricted | ≤ 1 | ≥ 1 |
---|---|---|---|
of |
of |
partition of into | |
with repetitions |
without repetitions |
of | |
partitions of into |
into |
partitions of into | |
partitions of into |
into |
partitions of into |
Reference
- Stanley, Enumerative Combinatorics, Volume 1, Chapter 1.