组合数学 (Fall 2025)/Sieve methods
Principle of Inclusion-Exclusion
Let
.
For three sets
.
This is illustrated by the following figure.
Generally, the Principle of Inclusion-Exclusion states the rule for computing the union of
In combinatorial enumeration, the Principle of Inclusion-Exclusion is usually applied in its complement form.
Let
For an
with the convention that
Principle of Inclusion-Exclusion - Let
be a family of subsets of . Then the number of elements of which lie in none of the subsets is .
- Let
Let
Surjections
In the twelvefold way, we discuss the counting problems incurred by the mappings
Theorem - The number of surjective mappings from an
-set to an -set is given by .
- The number of surjective mappings from an
Proof. Let
be the set of mappings from to . Then .For
, let be the set of mappings that none of is mapped to , i.e. , thus .More generally, for
, contains the mappings . And .A mapping
is surjective if lies in none of . By the principle of inclusion-exclusion, the number of surjective is .
Let
. The theorem is proved.
Recall that, in the twelvefold way, we establish a relation between surjections and partitions.
- Surjection to ordered partition:
- For a surjective
, is an ordered partition of .
- Ordered partition to surjection:
- For an ordered
-partition of , we can define a function by letting if and only if . is surjective since as a partition, none of is empty.
Therefore, we have a one-to-one correspondence between surjective mappings from an
The Stirling number of the second kind
Proposition .
Derangements
We now count the number of bijections from a set to itself with no fixed points. This is the derangement problem.
For a permutation
Theorem - The number of derangements of
given by .
- The number of derangements of
Proof. Let
be the set of all permutations of . So .Let
be the set of permutations with fixed point ; so . More generally, for any , , and , since permutations in fix every point in and permute the remaining points arbitrarily. A permutation is a derangement if and only if it lies in none of the sets . So the number of derangements isBy Taylor's series,
.
It is not hard to see that
is the closest integer to .
Therefore, there are about
Permutations with restricted positions
We introduce a general theory of counting permutations with restricted positions. In the derangement problem, we count the number of permutations that
It is traditionally described using terminology from the game of chess. Let
For a permutation
This can also be viewed as a set of marked positions on a chess board. Each row and each column has only one marked position, because
For example, the following is the
Now define
Interpreted in chess game,
: a set of marked positions in an chess board. : the number of ways of placing non-attacking rooks on the chess board such that none of these rooks lie in . : number of ways of placing non-attacking rooks on .
Our goal is to count
Theorem .
Proof. For each
, let be the set of permutations whose -th position is in . is the number of permutations avoid all positions in . Thus, our goal is to count the number of permutations in none of for .For each
, let , which is the set of permutations such that for all . Due to the principle of inclusion-exclusion, .
The next observation is that
,
because we can count both sides by first placing
non-attacking rooks on and placing additional non-attacking rooks on in ways.Therefore,
.
Derangement problem
We use the above general method to solve the derange problem again.
Take
Clearly, the number of ways of placing
By the above theorem
Problème des ménages
Suppose that in a banquet, we want to seat
- Men and women are in alternate places.
- No one sits next to his/her spouse.
In how many ways can this be done?
(For convenience, we assume that every seat at the table marked differently so that rotating the seats clockwise or anti-clockwise will end up with a different solution.)
First, let the
After sitting the wives, we label the remaining
It is easy to see that
Take
We need to compute
We first see how to do this in a line.
Lemma - The number of ways of choosing
non-consecutive objects from a collection of objects arranged in a line, is .
- The number of ways of choosing
Proof. We draw a line of
black points, and then insert red points into the spaces between the black points (including the beginning and end).This gives us a line of
points, and the red points specifies the chosen objects, which are non-consecutive. The mapping is 1-1 correspondence. There are ways of placing red points into spaces.
The problem of choosing non-consecutive objects in a circle can be reduced to the case that the objects are in a line.
Lemma - The number of ways of choosing
non-consecutive objects from a collection of objects arranged in a circle, is .
- The number of ways of choosing
Proof. Let
be the desired number; and let be the number of ways of choosing non-consecutive points from points arranged in a circle, next coloring the points red, and then coloring one of the uncolored point blue.Clearly,
.But we can also compute
as follows:- Choose one of the
points and color it blue. This gives us ways. - Cut the circle to make a line of
points by removing the blue point. - Choose
non-consecutive points from the line of points and color them red. This gives ways due to the previous lemma.
Thus,
. Therefore we have the desired number .- Choose one of the
By the above lemma, we have that
This gives the number of ways of seating the
Inversion
Posets
A partially ordered set or poset for short is a set
- (reflexivity) For all
. - (antisymmetry) If
and , then . - (transitivity) If
and , then .
We say two elements
- Notation
means . means and . means .
The Möbius function
Let
- Incidence algebra of poset
- Let
- be the class of
such that is non-zero only for .
- Treating
as matrix, it is trivial to see that is closed under addition and scalar multiplication, that is,- if
then ; - if
then for any ;
- if
- where
are treated as matrices.
- With this spirit, it is natural to define the matrix multiplication in
. For , .
- The second equation is due to that for
, for all other than , is zero. - By the transitivity of relation
, it is also easy to prove that is closed under matrix multiplication (the detailed proof is left as an exercise). Therefore, is closed under addition, scalar multiplication and matrix multiplication, so we have an algebra , called incidence algebra, over functions on .
- Zeta function and Möbius function
- A special function in
is the so-called zeta function , defined as - As a matrix (or more accurately, as an element of the incidence algebra),
is invertible and its inversion, denoted by , is called the Möbius function. More precisely, is also in the incidence algebra , and where is the identity matrix (the identity of the incidence algebra ).
There is an equivalent explicit definition of Möbius function.
Definition (Möbius function)
To see the equivalence between this definition and the inversion of zeta function, we may have the following proposition, which is proved by directly evaluating
Proposition - For any
,
- For any
Proof. It holds that
.
On the other hand,
, i.e.The proposition follows.
Note that
Computing Möbius functions
We consider the simple poset
Usually for general posets, it is difficult to directly compute the Möbius function from its definition. We introduce a rule helping us compute the Möbius function by decomposing the poset into posets with simple structures.
Theorem (the product rule) - Let
and be two finite posets, and be the poset resulted from Cartesian product of and , where for all , if and only if and . Then .
- Let
Proof. We use the recursive definition
to prove the equation in the theorem.
If
, then and . It is easy to see that both sides of the equation are 1. If , then either or . It is also easy to see that both sides are 0.The only remaining case is that
, in which case either or .where the last two equations are due to the proposition for
. Thus .
By induction, assume that the equation
is true for all . Thenwhich complete the proof.
- Poset of subsets
- Consider the poset defined by all subsets of a finite universe
, that is , and for , if and only if .
Möbius function for subsets - The Möbius function for the above defined poset
is that for ,
- The Möbius function for the above defined poset
Proof. We can equivalently represent each
by a boolean string , where if and only if .For each element
, we can define a poset with . By definition of Möbius function, the Möbius function of this elementary poset is given by , and .The poset
of all subsets of is the Cartesian product of all , . By the product rule,
- Note that the poset
is actually the Boolean algebra of rank . The proof relies only on that the fact that the poset is a Boolean algebra, thus the theorem holds for Boolean algebra posets.
- Posets of divisors
- Consider the poset defined by all devisors of a positive integer
, that is , and for , if and only if .
Möbius function for divisors - The Möbius function for the above defined poset
is that for that and ,
- The Möbius function for the above defined poset
Proof. Denote
. Represent by a tuple . Every corresponds in this way to a tuple with for all .Let
be the poset with being the total order. The poset of divisors of is thus isomorphic to the poset constructed by the Cartesian product of all , . Then
Principle of Möbius inversion
We now introduce the the famous Möbius inversion formula.
Möbius inversion formula - Let
be a finite poset and its Möbius function. Let . Then ,
- if and only if
.
- Let
The functions
,
and
.
The Möbius inversion formula is nothing but the following statement
,
which is trivially true due to
The following dual form of the inversion formula is also useful.
Möbius inversion formula, dual form - Let
be a finite poset and its Möbius function. Let . Then ,
- if and only if
.
- Let
To prove the dual form, we only need to evaluate the matrix multiplications on left:
.
- Principle of Inclusion-Exclusion
- Let
. For any ,- let
be the number of elements that belongs to exactly the sets and to no others, i.e.
;
- let
.
- let
- For any
, the following relation holds for the above defined and : .
- Applying the dual form of the Möbius inversion formula, we have that for any
, ,
- where the Möbius function is for the poset of all subsets of
, ordered by , thus it holds that for . Therefore, .
- We have a formula for the number of elements with exactly those properties
for any . For the special case that , is the number of elements satisfying no property of , and - which gives precisely the Principle of Inclusion-Exclusion.
- Möbius inversion formula for number theory
- The number-theoretical Möbius inversion formula is stated as such: Let
be a positive integer, for all
- if and only if
for all ,
- where
is the number-theoretical Möbius function, defined as - The number-theoretical Möbius inversion formula is just a special case of the Möbius inversion formula for posets, when the poset is the set of divisors of
, and for any , if .
Sieve Method in Number Theory
The Euler totient function
Two integers
We now derive a formula for this function by using the principle of inclusion-exclusion.
Theorem (The Euler totient function) Suppose
is divisible by precisely different primes, denoted . Then .
Proof. Let
be the universe. The number of positive integers from which is divisible by some , is . is the number of integers from which is not divisible by any . By principle of inclusion-exclusion,
Reference
- Stanley, Enumerative Combinatorics, Volume 1, Chapter 2.
- van Lin and Wilson, A course in combinatorics, Chapter 10, 25.