0% found this document useful (0 votes)
46 views

PIE1

The document discusses the inclusion-exclusion principle and its applications. It defines the principle and provides examples of using it to count combinations with repetition and derangements. The principle is used to find the number of objects with no given properties or at least one property.

Uploaded by

dhruvshivkanttab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

PIE1

The document discusses the inclusion-exclusion principle and its applications. It defines the principle and provides examples of using it to count combinations with repetition and derangements. The principle is used to find the number of objects with no given properties or at least one property.

Uploaded by

dhruvshivkanttab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Week 6-8: The Inclusion-Exclusion Principle

March 23, 2016

1 The Inclusion-Exclusion Principle

Let S be a finite set, and let A, B, C be subsets of S. Then


|A ∪ B| = |A| + |B| − |A ∩ B|,
|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|.
Let P1, P2, . . . , Pn be properties referring to the objects in S. Let Ai be the set
of all elements of S that have the property Pi, i.e.,
Ai = {x ∈ S : x has the property Pi}, 1 ≤ i ≤ n.
The elements of Ai may possibly have properties other than Pi. In many oc-
casions we need to find the number of objects having none of the properties
P1 , P 2 , . . . , P n .
Theorem 1.1. The number of objects of S which have none of the proper-
ties P1, P2, . . . , Pn is given by
X X X
|Ā1 ∩ Ā2 ∩ · · · ∩ Ān| = |S| − |Ai| + |Ai ∩ Aj | − |Ai ∩ Aj ∩ Ak |
i i<j i<j<k
n
+ · · · + (−1) |A1 ∩ A2 ∩ · · · ∩ An|. (1)
Proof. The left side of (1) counts the number of objects of S with none of the
properties. We establish the identity (1) by showing that an object with none
of the properties makes a net contribution of 1 to the right side of (1), and for
an object with at least one of the properties makes a net contribution of 0.

1
Let x be an object having none of the properties. Then the net contribution
of x to the right side of (1) is
1 − 0 + 0 − 0 + · · · + (−1)n0 = 1.
Let x be an object of S having exactly r properties of P1, P2, . . . , Pn. The net
contribution of x to the right side of (1) is
³r ´ ³r ´ ³r ´ ³r ´ ³ ´
r r
− + − + · · · + (−1) = (1 − 1)r = 0.
0 1 2 3 r

Corollary 1.2. The number of objects of S which have at least one of the
properties P1, P2, . . . , Pn is given by
X X X
|A1 ∪ A2 ∪ · · · ∪ An| = |Ai| − |Ai ∩ Aj | + |Ai ∩ Aj ∩ Ak |
i i<j i<j<k
n+1
− · · · + (−1) |A1 ∩ A2 ∩ · · · ∩ An|. (2)
Proof. Note that the set A1 ∪ A2 ∪ · · · ∪ An consists of all those objects in S
which possess at least one of the properties, and
|A1 ∪ A2 ∪ · · · ∪ An| = |S| − |A1 ∪ A2 ∪ · · · ∪ An|.
Then by the DeMorgan law we have
A1 ∪ A2 ∪ · · · ∪ An = Ā1 ∩ Ā2 ∩ · · · ∩ Ān.
Thus
|A1 ∪ A2 ∪ · · · ∪ An| = |S| − |Ā1 ∩ Ā2 ∩ · · · ∩ Ān|.
Putting this into the identity (1), the identity (2) follows immediately.

2 Combinations with Repetition

Let M be a multiset. Let x be an object of M and its repetition number is


larger than r. Let M 0 be the multiset whose objects have the same repetition
numbers as those objects in M , except that the repetition number of x in M 0 is
exactly r. Then
#{r-combinations of M } = #{r-combinations of M 0}.
2
Example 2.1. Determine the number of 10-combinations of the multiset
M = {3a, 4b, 5c}.
Let S be the set of 10-combinations of the multiset M 0 = {∞a, ∞b, ∞c}.
Let P1 be the property that a 10-combination of M 0 has more than 3 a’s, P2 be
the property that a 10-combination of M 0 has more than 4 b’s, and P3 be the
property that a 10-combination of M 0 has more than 5 c’s. Then the number
of 10-combinations of M is the number of 10-combinations of M 0 which have
none of the properties P1, P2, and P3. Let Ai denote the sets consisting of the
10-combinations of M 0 which have the property Pi, 1 ≤ i ≤ 3. Then by the
Inclusion-Exclusion Principle the number to be determined in the problem is
given by
¡ ¢ ¡
|Ā1 ∩ Ā2 ∩ Ā3| = |S| − |A1| + |A2| + |A3| + |A1 ∩ A2| + |A1 ∩ A3|
¢
+|A2 ∩ A3| − |A1 ∩ A2 ∩ A3|.
Note that ­3® ¡ 3+10−1 ¢ ¡ 12 ¢
|S| = 10 = 10 = 10 = 66,
­3® ¡ 3+6−1 ¢ ¡8¢
|A1| = 6 = 6 = 6 = 28,
­3® ¡ 3+5−1 ¢ ¡7¢
|A2| = 5 = 5 = 5 = 21,
­3® ¡ 3+4−1 ¢ ¡6¢
|A3| = 4 = 4 = 4 = 15,
­3® ¡ 3+1−1 ¢ ¡3¢
|A1 ∩ A2| = 1 = 1 = 1 = 3,
­3® ¡ 3+0−1 ¢ ¡2¢
|A1 ∩ A3| = 0 = 0 = 0 = 1,

|A2 ∩ A3| = 0,

|A1 ∩ A2 ∩ A3| = 0.
Putting all these results into the inclusion-exclusion formula, we have
|Ā1 ∩ Ā2 ∩ Ā3| = 66 − (28 + 21 + 15) + (3 + 1 + 0) − 0 = 6.
The six 10-combinations are listed as follows
{3a, 4b, 3c}, {3a, 3b, 4c}, {3a, 2b, 5c}, {2a, 4b, 4c}, {2a, 3b, 5c}, {a, 4b, 5c}.
3
Example 2.2. Find the number of integral solutions of the equation
x1 + x2 + x3 + x4 = 15
which satisfy the conditions
2 ≤ x1 ≤ 6, −2 ≤ x2 ≤ 1, 0 ≤ x3 ≤ 6, 3 ≤ x4 ≤ 8.
Let y1 = x1 − 2, y2 = x2 + 2, y3 = x3, and y4 = x4 − 3. Then the problem
becomes to find the number of nonnegative integral solutions of the equation
y1 + y2 + y3 + y4 = 12
subject to
0 ≤ y1 ≤ 4, 0 ≤ y2 ≤ 3, 0 ≤ y3 ≤ 6, 0 ≤ y4 ≤ 5.
Let S be the set of all nonnegative integral solutions of the equation y1 +
y2 + y3 + y4 = 12. Let P1 be the property that y1 ≥ 5, P2 the property that
y2 ≥ 4, P3 the property that y3 ≥ 7, and P4 the property that y4 ≥ 6. Let
Ai denote the subset of S consisting of the solutions satisfying the property Pi,
1 ≤ i ≤ 4. Then the problem is to find the cardinality |Ā1 ∩ Ā2 ∩ Ā3 ∩ Ā4| by
the inclusion-exclusion principle. In fact,
¿ À µ ¶ µ ¶
4 4 + 12 − 1 15
|S| = = = = 455.
12 12 12
Similarly,
¿ À µ ¶ µ ¶
4 4+7−1 10
|A1| = = = = 120,
7 7 7
¿ À µ ¶ µ ¶
4 4+8−1 11
|A2| = = = = 165,
8 8 8
¿ À µ ¶ µ ¶
4 4+5−1 8
|A3| = = = = 56,
5 5 5
¿ À µ ¶ µ ¶
4 4+6−1 9
|A4| = = = = 84.
6 6 6
For the intersections of two sets, we have
¿ À µ ¶ µ ¶
4 4+3−1 6
|A1 ∩ A2| = = = = 20,
3 3 3
4
|A1∩A3| = 1, |A1∩A4| = 4, |A2∩A3| = 4, |A2∩A4| = 10, |A3∩A4| = 0.
For the intersections of more sets,
|A1∩A2∩A3| = |A1∩A2∩A4| = |A1∩A3∩A4| = |A2∩A3∩A4| = |A1∩A2∩A3∩A4| =
Thus the number required is given by
|Ā1 ∩ Ā2 ∩ Ā3 ∩ Ā4| = 455 − (120 + 165 + 56 + 84) + (20 + 1 + 4 + 4 + 10) = 69.

3 Derangements

A permutation of {1, 2, . . . , n} is called a derangement if every integer i


(1 ≤ i ≤ n) is not placed at the ith position. We denote by Dn the number of
derangements of {1, 2, . . . , n}.
Let S be the set of all permutations of {1, 2, . . . , n}. Then |S| = n!. Let Pi
be the property that a permutation of {1, 2, . . . , n} has the integer i in its ith
position, and let Ai be the set of all permutations satisfying the property Pi,
where 1 ≤ i ≤ n. Then
Dn = |Ā1 ∩ Ā2 ∩ · · · ∩ Ān|.
For each (i1, i2, . . . , ik ) such that 1 ≤ i1 < i2 < · · · < ik ≤ n, a permutation of
{1, 2, . . . , n} with i1, i2, . . . , ik fixed at the i1th, i2th, . . ., ik th position respec-
tively can be identified as a permutation of the set {1, 2, . . . , n}−{i1, i2, . . . , ik }
of n − k objects. Thus
|Ai1 ∩ Ai2 ∩ · · · ∩ Aik | = (n − k)!.

5
By the inclusion-exclusion principle, we have
n
X X
k
|Ā1 ∩ Ā2 ∩ · · · ∩ Ān| = |S| + (−1) |Ai1 ∩ Ai2 ∩ · · · ∩ Aik |
k=1 i1 <i2 <···<ik
n
X X
k
= n! + (−1) (n − k)!
k=1 i1 <i2 <···<ik
n
X ³n´
k
= (−1) (n − k)!
k
k=0
n
X (−1)k n!
= n! ' (when n is large.)
k! e
k=0
Theorem 3.1. For n ≥ 1, the number Dn of derangements of {1, 2, . . . , n}
is µ ¶
1 1 1 1
Dn = n! 1 − + − + · · · + (−1)n . (3)
1! 2! 3! n!
Here are a few derangement numbers:
D0 ≡ 1, D1 = 0, D2 = 1, D3 = 2, D4 = 9, D5 = 44.
Corollary 3.2. The number of permutations of {1, 2, . . . , n} with exactly k
numbers displaced is ³n´
Dk .
k
Proposition 3.3. The derangement sequence Dn satisfies the recurrence
relation
Dn = (n − 1)(Dn−1 + Dn−2), n ≥ 3
with the initial condition D1 = 0, D2 = 1. The sequence Dn satisfies the
recurrence relation
Dn = nDn−1 + (−1)n, n ≥ 2.
Proof. The recurrence relations can be proved without using the formula (3).
Let Sk denote the set of derangements of {1, 2, . . . , n} having the pattern
ka2a3 · · · an, where k = 2, 3, . . . , n. The derangements of Sk can be partitioned
into two types:
ka2a3 · · · ak · · · an (ak 6= 1) and ka2a3 · · · ak−11ak+1 · · · an
6
The first type can be considered as permutations of k23 . . . (k − 1)1(k + 1) . . . n
such that the first member is fixed and no one is placed in its original place for
other members. The number of such permutations is Dn−1. The second type
can be considered as permutations of k23 . . . (k − 1)1(k + 1) . . . n such that the
first and the kth members are fixed, and no one is placed in its original place for
other members. The number of such permutations is Dn−2. We thus obtain the
recurrence relation
Dn = (n − 1)(Dn−1 + Dn−2), n ≥ 3.
Let us rewrite the recurrence relation as
¡ ¢
Dn − nDn−1 = − Dn−1 − (n − 1)Dn−2 , n ≥ 3.
Applying this recurrence formula continuously, we have
i
¡ ¢
Dn − nDn−1 = (−1) Dn−i − (n − i)Dn−i−1 , 1 ≤ i ≤ n − 2.
Thus Dn − nDn−1 = (−1)n−2(D2 − D1) = (−1)n. Hence Dn = nDn−1 +
(−1)n.

4 Surjective Functions

Let X be a set of m objects and Y a set of n objects. Then the number of


functions of X to Y is nm. The number of injective functions from X to Y is
³n´
m! = P (n, m).
m
Let C(m, n) denote the number of surjective functions from X to Y . What is
C(m, n)?
Theorem 4.1. The number C(m, n) of surjective functions from a set of
m objects to a set of n objects is given by
X n ³ ´
k n
C(m, n) = (−1) (n − k)m.
k
k=0

7
Proof. Let S be the set of all functions of X to Y . Write Y = {y1, y2, . . . , yn}.
Let Ai be the set of all functions f such that yi is not assigned to any element
of X by f , i.e., yi 6∈ f (X), where 1 ≤ i ≤ n. Then
C(m, n) = |Ā1 ∩ Ā2 ∩ · · · ∩ Ān|.
For each (i1, i2, . . . , ik ) such that 1 ≤ i1 < i2 < · · · < ik ≤ n, the intersection
A i1 ∩ A i 2 ∩ · · · ∩ A ik
can be identified to the set of functions f from X to the set Y r{yi1 , yi2 , . . . , yik }.
Thus
|Ai1 ∩ Ai2 ∩ · · · ∩ Aik | = (n − k)m.
By the Inclusion-Exclusion Principle, we have
n
X X
k
|Ā1 ∩ Ā2 ∩ · · · ∩ Ān| = |S| + (−1) |Ai1 ∩ Ai2 ∩ · · · ∩ Aik |
k=1 i1 <i2 <···<ik
Xn X
m k
= n + (−1) (n − k)m
k=1 i1 <i2 <···<ik
n
X ³n´
k
= (−1) (n − k)m.
k
k=0

Note that C(m, n) = 0 for m < n; we have


X n ³ ´
k n
(−1) (n − k)m = 0 if m < n.
k
k=0

Corollary 4.2. For integers m, n ≥ 1,


X µ m ¶ X n ³ ´
k n
= (−1) (n − k)m.
i +···+in =m
i1 , . . . , i n k
1 k=0
i1 ,...,in ≥1

Proof. The integer C(m, n) can be interpreted as the number of ways to place
objects of X into n distinct boxes so that no box is empty. Let the 1st box be
placed i1 objects, . . ., the nth box be placed in objects; then i1 + · · · + in = m.
8
The number of placements of X into n distinct boxes, such that the 1st box
m!
contains exactly i1 objects, . . ., the nth box contains exactly in objects, is i1!···i ,
³ ´ n!
m
which is the multinomial coefficient i1,...,i n
. We thus have
X µ m ¶
C(m, n) = .
i +···+in =m
i 1 , . . . , i n
1
i1 ,...,in ≥1

5 The Euler Phi Function

Let n be a positive integer. We denote by φ(n) the number of integers of [1, n]


which are coprime to n. For example,
φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2, φ(5) = 4, φ(6) = 2.
The integer-valued function φ is defined on the set of positive integers, called
the Euler Phi function.
Theorem 5.1. Let n be a positive integer factorized into the form
n = pe11 pe2r · · · perr ,
where p1, p2, . . . , pr are distinct primes and e1, e2, . . . , er ≥ 1. Then
Yr µ ¶
1
φ(n) = n 1− .
i=1
p i

Proof. Let S = {1, 2, . . . , n}. Let Pi be the property of integers in S having


factor pi, and let Ai be the set of integers in S that satisfy the property Pi,
where 1 ≤ i ≤ r. Then φ(n) is the number of integers satisfying none of the
properties P1, P2, . . . , Pr , i.e.,
φ(n) = |Ā1 ∩ Ā2 ∩ · · · ∩ Ār |.
Note that ½ µ ¶ ¾
n
Ai = 1pi, 2pi, . . . , pi , 1 ≤ i ≤ r.
pi
9
Likewise, for q = pi1 pi2 · · · pik with 1 ≤ i1 < i2 < · · · < ik ≤ r,
½ µ ¶ ¾
n
Ai1 ∩ Ai2 ∩ · · · ∩ Aik = 1q, 2q, . . . , q .
q
Thus
n n
|Ai1 ∩ Ai2 ∩ · · · ∩ Aik | = = .
q p i 1 p i 2 · · · p ik
By the Inclusion-Exclusion Principle, we have
Xr X
k
|Ā1 ∩ · · · ∩ Ār | = |S| + (−1) |Ai1 ∩ · · · ∩ Aik |
k=1 i1 <···<ik
r
X X
k n
= n+ (−1)
p p · · · p ik
i1 <i2 <···<ik i1 i2
k=1
· µ ¶
1 1
= n 1− + ··· +
p1 pr
µ ¶
1 1 1
+ + + ··· +
p1 p2 p1 p3 pr−1pr
µ ¶
1 1 1
− + + ··· +
p1 p2 p3 p1 p2 p4 pr−2pr−1pr
¸
1
+ · · · + (−1)r
p1 p2 · · · pr
Yr µ ¶
1
= n 1− .
i=1
p i

Example 5.1. For the integer 36 (= 2232), we have


µ ¶µ ¶
1 1
φ(36) = 36 1 − 1− = 12.
2 3
The following are the twelve specific integers of [1, 36] that are coprime to 36:
1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35.
Corollary 5.2. For any prime number p,
φ(pk ) = pk − pk−1.
10
Proof. The result can be directly proved without Theorem 5.1. The set [pk ] has
pk−1 integers 1p, 2p, . . . pk−1p not coprime to pk . Thus φ(pk ) = pk − pk−1.
Lemma 5.3. Let m = m1m2. If gcd(m1, m2) = 1, then we have
(i) The function f : [m] → [m1] × [m2] defined by f (a) = (r1, r2), where
a = q1m1 + r1 = q2m2 + r2 ∈ [m], 1 ≤ r1 ≤ m 1 , 1 ≤ r2 ≤ m 2 ,
is a bijection.
(ii) The restriction of f to {a ∈ [m] : gcd(a, m) = 1} is a map to the
product set
© ª © ª
a ∈ [m1] : gcd(a, m1) = 1 × a ∈ [m2] : gcd(a, m2) = 1 ,
and is also a bijection.
Proof. (i) It suffices to show that f is surjective. Since gcd(m1, m2) = 1, by the
Euclidean Algorithm there exist integers x and y such that xm1 + ym2 = 1.
For each (r1, r2) ∈ [m1]×[m2], the integer r := r2xm1 +r1ym2 can be written
as
r = (r2 − r1)xm1 + r1(xm1 + ym2) = (r1 − r2)ym2 + r2(xm1 + ym2).
Since xm1 + ym2 = 1, we have
r = (r2 − r1)xm1 + r1 = (r1 − r2)ym2 + r2.
We modify r by adding an appropriate multiple qm of m to obtain
a := qm + r such that 1 ≤ a ≤ m.
Then a = q1m1 +r1 = q2m2 +r2 ∈ [m] for some integers q1 and q2. We thus have
f (a) = (r1, r2). This shows that f is surjective. Since both [m] and [m1] × [m2]
have the same cardinality m1m2, it follows that f must be a bijection.
(ii) It follows from the fact that an integer a ∈ [m1m2] is coprime to m1m2
iff a is coprime to m1 and coprime to m2.
Theorem 5.4. For positive integers m and n such that gcd(m, n) = 1,
φ(mn) = φ(m)φ(n).
11
If n = pe11 · · · perr with e1, . . . , er ≥ 1, where p1, . . . , pr are distinct primes,
then r µ ¶
Y 1
φ(n) = n 1− .
i=1
p i

Proof. The first part follows from Lemma 5.3. Note that [pei i ] has pei i−1 integers
1pi, 2pi, . . . , pei i−1pi not coprime to pei i . So φ(pei ) = pei − pei−1. The second part
follows from the first part, i.e.,
Yr r ³ ´
¡ ei ¢ Y ei ei −1
φ(n) = φ pi = pi − pi
i=1 i=1
Yr µ ¶ r µ
Y ¶
1 1
= pei i 1− =n 1− .
i=1
pi i=1
pi

6 Permutations with Forbidden Positions

Let X1, X2, . . . , Xn be subsets (possibly empty) of {1, 2, . . . , n}. We denote by


P (X1, X2, . . . , Xn) the set of all permutations a1a2 · · · an of {1, 2, . . . , n} such
that
a1 6∈ X1, a2 6∈ X2, . . . , an 6∈ Xn.
In other words, a permutation of S belongs to P (X1, X2, . . . , Xn) provided that
no members of X1 occupy the first place, no members of X2 occupy the second
place, ..., and no members of Xn occupy the nth place. Let
p(X1, X2, . . . , Xn) = |P (X1, X2, . . . , Xn)|.
It is known that there is a one-to-one correspondence between permutations
of {1, 2, . . . , n} and the placement of n non-attacking indistinguishable rooks
on an n-by-n board. The permutation a1a2 · · · an of {1, 2, . . . , n} corresponds
to the placement of n rooks on the board in the squares with coordinates
(1, a1), (2, a2), ..., (n, an).

12
The permutations in P (X1, X2, . . . , Xn) corresponds to placements of n non-
attacking rooks on an n-by-n board in which certain squares are not allowed to
be put a rook.
Let S be the set of all placements of n non-attacking rooks on an n × n-board.
A rook placement in S is said to satisfy the property Pi provided that the rook
in the ith row having column index in Xi, where 1 ≤ i ≤ n. Let Ai be the set
of rook placements satisfying the property Pi. Then by the Inclusion-Exclusion
Principle,
p(X1, X2, . . . , Xn) = |Ā1 ∩ Ā2 ∩ · · · ∩ Ān|
X X
= |S| − |Ai| + |Ai ∩ Aj | − · · ·
i i<j
n
· · · + (−1) |A1 ∩ A2 ∩ · · · ∩ An|.
Proposition 6.1. Let rk (1 ≤ k ≤ n) denote the number of ways to place
k non-attacking rooks on an n × n-board where each of the k rooks is in a
forbidden position. Then
1 X
rk = |Ai ∩ Ai2 ∩ · · · ∩ Aik |. (4)
(n − k)! 1≤i <i <···<i ≤n 1
1 2 k

Proof. Fix (i1, i2, . . . , ik ) with 1 ≤ i1 < i2 < · · · < ik ≤ n. Let r(i1, i2, . . . , ik )
denote the number of ways to place k non-attacking rooks such that
• the rook on the i1th row has column index in Xi1 ,
• the rook on the i2th row has column index in Xi2 , . . ., and
• the rook on the ik th row has column index in Xik .
For each such k rook arrangement, delete the i1th row, i2th row, . . ., ik th row,
and delete the columns where the i1th, or i2th, . . ., or ik th position is arranged a
rook; the other n − k rooks cannot be arranged in the deleted rows and columns.
The leftover is an (n − k) × (n − k)-board, and the other n − k rooks can be
arranged in (n − k)! ways. So
|Ai1 ∩ Ai2 ∩ · · · ∩ Aik | = r(i1, i2, . . . , ik ) (n − k)!.

13
P
Since rk = 1≤i1 <i2 <···<ik ≤n r(i1 , i2 , . . . , ik ), it follows that
X
rk (n − k)! = |Ai1 ∩ Ai2 ∩ · · · ∩ Aik |.
1≤i1 <i2 <···<ik ≤n

Theorem 6.2. The number of ways to place n non-attacking rooks on an


n × n-board with forbidden positions is given by
n
X
p(X1, X2, . . . , Xn) = (−1)k rk (n − k)!,
k=0

where rk is the number of ways to place k non-attacking rooks on an n × n-


board where each of the k rooks is in a forbidden position.
Example 6.1. Let n = 5 and X1 = {1, 2}, X2 = {3, 4}, X3 = {1, 5},
X4 = {2, 3}, and X5 = {4, 5}.
× ×
× ×
× ×
× ×
× ×
Find the number of rook placements with the given forbidden positions.
Solution. Note that r0 = 1. It is easy to see that
r1 = 5 × 2 = 10.
1
P
Since r1 = 4! i |Ai |, we have
X
|Ai| = r14! = 10 · 4!. (This is not needed.)
i

Since
|A1 ∩ A2| = |A2 ∩ A3| = |A3 ∩ A4| = |A4 ∩ A5| = |A1 ∩ A5| = 4 · 3!,
|A1 ∩ A3| = |A1 ∩ A4| = |A2 ∩ A4| = |A2 ∩ A5| = |A3 ∩ A5| = 3 · 3!,

14
we see that
1X
r2 = |Ai ∩ Aj | = 5 × 4 + 5 × 3 = 35.
3! i<j
Using the symmetry between A1, A2, A3, A4, A5 and A5, A4, A3, A2, A1 respec-
tively, we see that
|A1 ∩ A2 ∩ A3| = |A1 ∩ A2 ∩ A5| = |A1 ∩ A4 ∩ A5|
= |A2 ∩ A3 ∩ A4| = |A3 ∩ A4 ∩ A5|
= 6 · 2!,
|A1 ∩ A2 ∩ A4| = |A1 ∩ A3 ∩ A4| = |A1 ∩ A3 ∩ A5|
= |A2 ∩ A3 ∩ A5| = |A2 ∩ A4 ∩ A5|
= 4 · 2!.
These can be obtained by considering the following six patterns:
× × × × × ×
× × × × × ×
× × × × × ×

× × × × × ×
× × × × × ×
× × × × × ×
We then have
r3 = 5 · 6 + 5 · 4 = 50.
Using the symmetric position again, we see that
|A1 ∩ A2 ∩ A3 ∩ A4| = |A1 ∩ A2 ∩ A3 ∩ A5| = |A1 ∩ A2 ∩ A4 ∩ A5|
= |A1 ∩ A3 ∩ A4 ∩ A5| = |A2 ∩ A3 ∩ A4 ∩ A4|
= 5 · 1!.
Thus
r4 = 5 × 5 = 25.
Finally,
r5 = |A1 ∩ A2 ∩ A3 ∩ A4 ∩ A5| = 2.

15
P5 k
The answer k=0 (−1) rk (5 − k)! is
5! − 10 × 4! + 35 × 3! − 50 × 2! + 25 × 1! − 2 = 13.
A permutation of {1, 2, . . . , n} is nonconsecutive if 12, 23, . . ., (n − 1)n
do not occur. We denote by Qn the number of nonconsecutive permutations of
{1, 2, . . . , n}. We have Q1 = 0, Q2 = 1, Q3 = 3, Q4 = 13.
Theorem 6.3. For n ≥ 1,
n−1
X µ ¶
n−1
Qn = (−1)k (n − k)!.
k
k=0

Proof. Let S be the set of permutations of {1, 2, . . . , n}. Let Pi be the property
that in a permutation the pattern i(i + 1) does occur, where 1 ≤ i ≤ n − 1.
Let Ai be the set of all permutations satisfying the property Pi. Then Qn is the
number of permutations satisfying none of the properties P1, . . . , Pn, i.e.,
Qn = |Ā1 ∩ Ā2 ∩ · · · ∩ Ān|.
Note that
|Ai| = (n − 1)!, 1 ≤ i ≤ n − 1.
Similarly,
|Ai ∩ Aj | = (n − 2)!, 1 ≤ i < j ≤ n − 1.
More generally,
|Ai1 ∩ · · · ∩ Aik | = (n − k)!, 1 ≤ i1 < · · · < ik ≤ n − 1.
Thus by the Inclusion-Exclusion Principle,
n−1
X X
k
Qn = |S| + (−1) |Ai1 ∩ · · · ∩ Aik |
k=1 1≤i1 <···<ik ≤n−1
n−1
X µ ¶
n−1
= (−1)k (n − k)!.
k
k=0

16
Example 6.2. Eight persons line up in one column in such a way that every
person except the first one has a person in front. What is the chance when the
eight persons reline up after a break so that everyone has a different person in
his/her front?
We assign numbers 1, 2, . . . , 8 to the eight persons so that the number i is
assigned to the ith person (counted from the front). The problem is then to find
the number of permutations of {1, 2, . . . , 8} in which the patterns 12, 23, . . ., 78
do not occur. For instance, 31542876 is an allowed permutation, while 83475126
is not. The answer is given by
7 µ ¶
Q8 X 7 (8 − k)!
P = = (−1)k ≈ 0.413864.
8! k 8!
k=0

Example 6.3. There are n persons seated at a round table. The n persons left
the table and reseat after a break. How many seating plans can be made in the
second time so that each person has a different person seating on his/her left
comparing to the person before the break?
This is equivalent to finding the number of circular nonconsecutive permuta-
tions of {1, 2, . . . , n}. A circular nonconsecutive permutation of {1, 2, . . . , n}
is a circular permutation of {1, 2, . . . , n} such that 12, 23, . . ., (n − 1)n, n1 do
not occur in the counterclockwise direction.
Let S be the set of all circular permutations of {1, 2, . . . , n}. Let Ai denote
the subset of all circular permutations of {1, 2, . . . , n} such that i(i + 1) does
not occur, 1 ≤ i ≤ n. We understand that An is the subset of all circular
permutations that n1 does not occur. The answer is
|Ā1 ∩ Ā1 ∩ · · · ∩ Ān|.
Note that |S| = (n − 1)!, and
|Ai| = (n − 1)!/(n − 1) = (n − 2)!.
More generally,
|Ai1 ∩ · · · ∩ Aik | = (n − k)!/(n − k) = (n − k − 1)!, 1 ≤ k ≤ n − 1;
|A1 ∩ A2 ∩ · · · ∩ An| = 1.
17
We thus have
n−1
X ³n´
k
|Ā1 ∩ · · · ∩ Ān| = (−1) (n − k − 1)! + (−1)n.
k
k=0

Theorem 6.4.
Qn = Dn + Dn−1, n ≥ 2.
Proof.
n
X n−1
X
(−1)k (−1)k
Dn + Dn−1 = n! + (n − 1)!
k! k!
k=0 k=0
à n n
!
X (−1)k X (−1)k−1
= (n − 1)! n + n +
k! (k − 1)!
k=1 k=1
n
X (−1)k
= n! + (n − 1)! (n − k)
k!
k=1
n−1
X µ ¶
n−1
= n! + (−1)k (n − k)!
k
k=1
n−1
X µ ¶
n − 1
= (−1)k (n − k)! = Qn.
k
k=0

7 Rook Polynomials

Definition 7.1. Let C be a board; each square of C is referred as a cell. Let


rk (C) denote the number of ways to arrange k rooks on the board C so that no
one can take another. We assume r0(C) = 1. The rook polynomial of C is

X
R(C, x) = rk (C)xk .
k=0

A k-rook arrangement on the board C is an arrangement of k rooks on C.

18
Proposition 7.2. Let C be a board. For each cell σ of C, let Cσ denote
the board obtained from C by deleting all cells on the row and column that
contains the cell σ, and let C − σ denote the board obtained from C by
deleting the cell σ. Then
rk (C) = rk (C − σ) + rk−1(Cσ ).
Equivalently,
R(C, x) = R(C − σ, x) + xR(Cσ , x).
Proof. The k-rook arrangements on the board C can be divided into two kinds:
the rook arrangements that the square σ is occupied and the rook arrangements
that the square is not occupied, i.e., the k-rook arrangements on the board
C − σ and the (k − 1)-rook arrangements on the board Cσ . We thus have
rk (C) = rk (C − σ) + rk−1(Cσ ).
Two boards C1 and C2 are said to be independent if they have no common
rows and common columns. Independent boards must be disjoint. If C1 and C2
are independent boards, we denote by C1 + C2 the board that consists of the
cells either in C1 or in C2, i.e., the union of cells.
Proposition 7.3. Let C1 and C2 be independent boards. Then
k
X
rk (C1 + C2) = ri(C1) rk−i(C2),
i=0

where C1 + C2 = C1 ∪ C2. Equivalently,


R(C1 + C2, x) = R(C1, x)R(C2, x).
Proof. Since C1 and C2 have disjoint rows and columns, each i-rook arrange-
ment of C1 and each j-rook arrangement of C2 will constitute a (i + j)-rook
arrangement of C1 + C2, and vice versa. Thus
X
rk (C1 + C2) = ri(C1)rj (C2).
i+j=k
i,j≥0

19
Example 7.1. The rook polynomial of an m-by-n board C with m ≤ n,
Xm ³ ´³ ´
m n
R(C, x) = k!xk .
k k
k=0

¤¤
Example 7.2. Find the rook polynomial of the board ¤¤¤ . We use ¡ (a
¤¤¤
square with a dot) to denote a selected square when applying the recurrence
formula of rook polynomial.

µ ¶ µ ¶ ³ ´
¤¡ ¡
R ¤¤¤ , x = R ¤¤¤ , x + xR ¤¤ ¤¤ , x
¤¤¤ ¤¤¤
h ³ ´ ³ ´i ³ ´
= R ¤¤¤ ¤¤
¤¤¤ , x + xR ¤¤ , x + xR ¤¤ , x
¤¤
¡ 2
¢ ¡ 2
¢
= 1 + 6x + 3 · 2x + 2x 1 + 4x + 2x
= 1 + 8x + 14x2 + 4x3.

8 Weighted Version of Inclusion-Exclusion Principle

Let X be a set, either finite or infinite. The characteristic function of a


subset A of X is a real-valued function 1A on X, defined by
½
1 if x ∈ A,
1A(x) =
0 if x 6∈ A.
For real-valued functions f , g, and a real number c, we define functions f + g,
cf , and f g on X as follows:
(f + g)(x) = f (x) + g(x),
(cf )(x) = cf (x),
(f g)(x) = f (x)g(x).
For subsets A, B ⊆ X and arbitrary function f on X, it is easy to verify the
following properties:
(i) 1A∩B = 1A1B ,
20
(ii) 1Ā = 1X − 1A,
(iii) 1A∪B = 1A + 1B − 1A∩B ,
(iv) 1X f = f .
The set of all real-valued functions on X is a vector space over R, and is further
a commutative algebra with identity 1X .
Given a function w : X → R, usually referred to a weight function on X,
such that w is nonzero at only finitely many elements of X; the value w(x) is
called the weight of x. For each subset A ⊆ X, the weight of A is
X
w(A) = w(x).
x∈A

If A = ∅, we assume w(∅) = 0. For each function f : X → R, the weight of


f is X
w(f ) = w(x)f (x) = hw, f i.
x∈X
Clearly, w(1A) = w(A). For functions fi and constants ci (1 ≤ i ≤ m), we have
à m ! m
X X
w cifi = ci w(fi).
i=1 i=1

This means that w is a linear functional on the vector space of all real-valued
functions on X.
Proposition 8.1. Let P1, . . . , Pn be some properties about the elements of
a set X. Let Ai denote the set of elements of X that satisfy the property Pi,
1 ≤ i ≤ n. Given a weight function w on X. Then the Inclusion-Exclusion
Principle can be stated as
n
X X
k
1Ā1∩Ā2∩···∩Ān = 1X + (−1) 1Ai1 ∩Ai2 ∩···∩Aik ; (5)
k=1 1≤i1 <i2 <···<ik ≤n
n
X X
¡ ¢ k
¡ ¢
w Ā1 ∩ · · · ∩ Ān = w(X) + (−1) w A i 1 ∩ · · · ∩ A ik . (6)
k=1 i1 <···<ik

21
Proof. Alying properties about characteristic functions,
1Ā1∩···∩Ān = 1Ā1 · · · 1Ān = (1X − 1A1 ) · · · (1X − 1An )
X
= f1 · · · fn (fi = 1X or fi = −1Ai , 1 ≤ i ≤ n)
Xn X
= 1|X ·{z
· · 1X} + |1X ·{z · · 1X}(−1Ai1 ) · · · (−1Aik )
n k=1 i1 <···<ik n−k
n
X X
k
= 1X + (−1) 1Ai1 ∩···∩Aik .
k=1 1≤i1 <···<ik ≤n

Applying a weight w to both sides, we obtain


n
X X
¡ ¢ k
¡ ¢
w Ā1 ∩ · · · ∩ Ān = w(X) + (−1) w A i 1 ∩ · · · ∩ A ik .
k=1 i1 <···<ik

Let X be a finite set and A1, . . . , An be subsets of X. Let [n] = {1, 2, . . . , n}.
We introduce two functions α and β on the power set P([n]) of [n] as follows:
For each subset I ⊆ [n],
½ ¡T ¢
w i∈I Ai if I 6= ∅,
α(I) =
0 if I = ∅;
½ ¡S ¢
w i∈I Ai if I 6= ∅,
β(I) =
0 if I = ∅.
By Inclusion-Exclusion,
n
X X X
k−1
1Sni=1 Ai
= (−1) 1Ai1 ∩···∩Aik = (−1)|I|−11Ti∈I Ai .
k=1 1≤i1 <···<ik ≤n I⊆[n], I6=∅

Taking weight w on both sides, we obtain


X X
|I|−1
β([n]) = (−1) α(I) = (−1)|I|+1α(I).
I⊆[n], I6=∅ I⊆[n]

22
If one replace Āi with Ai in (5), we have
n
X X
k
1Tni=1 Ai
= 1X + (−1) 1Āi ∩···∩Āik (Pnk=0(−1)k = 0)
1
k=1 i1 <···<ik
n
X X ³ ´
k+1
= (−1) 1X − 1Āi ∩···∩Āik
1
k=1 i1 <···<ik
Xn X
k+1
= (−1) 1Ai1 ∪···∪Aik
k=1 i1 <···<ik
X
= (−1)|I|+11Si∈I Ai .
I⊆[n], I6=∅

Taking the weight w on both sides, we obtain


X X
|I|+1
α([n]) = (−1) β(I) = (−1)|I|+1β(I).
I⊆[n], I6=∅ I⊆[n]

Theorem 8.2. We have the identities


X
β(J) = (−1)|I|+1α(I), ∀J ⊆ [n]; (7)
I⊆J
X
α(J) = (−1)|I|+1β(I), ∀J ⊆ [n]. (8)
I⊆J

9 Möbius Inversion

Let (X, ≤) be a locally finite poset, i.e., for each x ≤ y in X the interval
[x, y] = {z ∈ X : x ≤ z ≤ y} is a finite set. Let I(X) be the set of all functions
f : X × X → R such that
f (x, y) = 0 if x 6≤ y;
such functions are called incidence functions on the poset X. For an inci-
dence function f , we only specify the values f (x, y) for the pairs (x, y) such that
x ≤ y, since f (x, y) = 0 for all pairs (x, y) such that x 6≤ y.

23
The convolution product of two incidence functions f, g ∈ I(X) is an
incidence function f ∗ g : X × X → R, defined by
X
(f ∗ g)(x, y) = f (x, z)g(z, y).
z∈X

In fact, (f ∗ g)(x, y) = 0 if x 6≤ y and


X
(f ∗ g)(x, y) = f (x, z)g(z, y) if x ≤ y.
x≤z≤y

The convolution product satisfies the associative law:


f ∗ (g ∗ h) = (f ∗ g) ∗ h,
where f, g, h ∈ I(X). Indeed, for x ≤ y, we have
X
(f ∗ (g ∗ h))(x, y) = f (x, z1)(g ∗ h)(z1, y)
x≤z1 ≤y
X X
= f (x, z1) g(z1, z2)h(z2, , y)
x≤z1 ≤y z1 ≤z2 ≤y
X
= f (x, z1)g(z1, z2)h(z2, y).
x≤z1 ≤z2 ≤y

Likewise, for x ≤ y, we have


X
((f ∗ g) ∗ h))(x, y) = f (x, z1)g(z1, z2)h(z2, y).
x≤z1 ≤z2 ≤y

For x 6≤ y, we automatically have (f ∗ (g ∗ h))(x, y) = ((f ∗ g) ∗ h))(x, y) = 0.


The vector space I(X) together with the convolution ∗ is called the incidence
algebra of X.
Example 9.1. Let [n] = {1, 2, . . . , n} be the poset with the natrual order of
natural numbers. An incidence function f : [n] × [n] → R can be viewed as a
upper triangular n × n matrix A = [aij ] given by aij = f (i, j). The convolution
is just the multiplication of upper triangular matrices.
There is a special function δ ∈ I(X), called the delta function of the poset
(X, ≤), defined by ½
1 if x = y,
δ(x, y) =
0 if x 6= y.
24
The delta function δ is the identity of the algebra I(X), i.e., for all f ∈ I(X),
δ ∗ f = f = f ∗ δ.
Indeed, for x ≤ y,
X
(δ ∗ f )(x, y) = δ(x, z)f (z, y) = f (x, y);
x≤z≤y
X
(f ∗ δ)(x, y) = f (x, z)δ(z, y) = f (x, y).
x≤z≤y

Given an incidence function f ∈ I(X). A left inverse of f is a function


g ∈ I(X) such that
g ∗ f = δ.
A right inverse of f is a function h ∈ I(X) such that
f ∗ h = δ.
If f has a left inverse g and a right inverse h, then g = h. In fact,
g = g ∗ δ = g ∗ (f ∗ h) = (g ∗ f ) ∗ h = δ ∗ h = h.
If f has both a left and right inverse, we say that f is invertible; the left
inverse and right inverse of f must be same and unique, and it is just called the
inverse of f .
Note that
X
g∗f =δ ⇔ g(x, z)f (z, y) = δ(x, y), ∀ x ≤ y.
x≤z≤y
1
When x = y, we have g(x, x)f (x, x) = 1, i.e., g(x, x) = f (x,x) ; so f (x, x) 6= 0.
We can obtain g ∈ I(X) inductively as follows:
1
g(x, x) = , ∀ x ∈ X, (9)
f (x, x)
−1 X
g(x, y) = g(x, z)f (z, y), ∀ x < y. (10)
f (y, y) x≤z<y

This means that f is invertible iff f (x, x) 6= 0 for all x ∈ X.

25
Likewise,
X
f ∗g =δ ⇔ f (x, z)g(z, y) = δ(x, y), ∀ x ≤ y.
x≤z≤y

We can obtain g ∈ I(X) inductively as follows:


1
g(x, x) = , ∀ x ∈ X, (11)
f (x, x)
−1 X
g(x, y) = f (x, z)g(z, y), ∀ x < y. (12)
f (x, x) x<z≤y
The zeta function ζ of the poset (X, ≤) is an incidence function such that
ζ(x, y) = 1 for all (x, y) with x ≤ y. Clearly, ζ is invertible. The Möbius
function µ of the poset (X, ≤) is the inverse of the zeta function ζ in the
incidence algebra I(X), i.e.,
µ = ζ −1.
The Möbius function µ can be inductively defined by
µ(x, x) = 1,∀x ∈ X, (13)
X X
µ(x, y) = − µ(x, z) = − µ(z, y), ∀ x < y. (14)
x≤z<y x<z≤y

Example 9.2. Let X = {1, 2, . . . , n}. The Möbius function of the poset
(P(X), ⊆) is given by
µ(A, B) = (−1)|B−A|, where A ⊆ B.
This can be proved by induction on |B − A|. For |B − A| = 0, i.e., A = B, it
is obviously true. Assume that it is true when |B − A| < m. Consider the case
of |B − A| = m. In fact,
X
µ(A, B) = − µ(A, C)
A⊆C(B
X
= − (−1)|C−A|
A⊆C(B
m−1
X ³p´
k
= − (−1)
k
k=0
= (−1) = (−1)|B−A|.
m

26
Example 9.3. Let X = {1, 2, . . . , n} and consider the linearly ordered set
(X, ≤), where 1 < 2 < · · · < n. Then for (k, l) ∈ X × X with k ≤ l, the
Möbius function is given by

 1 if l = k,
µ(k, l) = −1 if l = k + 1,

0 otherwise.
It is easy to see that µ(k, k) = 1 and µ(k, k + 1) = −1. It follows that µ(k, k +
2) = 0 and subsequently, µ(k, k + i) = 0 for all i ≥ 2.
Given a finite poset (X, ≤). For each function f : X → R, we can multiply
an incidence function α ∈ I(X) to the left of f and to the right as follows to
obtain two functions α ∗ f and f ∗ α on X, defined by
X
(α ∗ f )(x) = α(x, y)f (y), ∀x ∈ X; (15)
x≤y
X
(f ∗ α)(y) = f (x)α(x, y), ∀y ∈ X. (16)
x≤y

Theorem 9.1. Let (X, ≤) be a finite poset. Given invertible α ∈ I(X),


f, g ∈ F (X). Then g = α ∗ f iff f = α−1 ∗ g, i.e.,
X X
g(x) = α(x, y)f (y), ∀ x ∈ X ⇔ f (x) = α−1(x, y)g(y), ∀ x ∈ X.
x≤y x≤y

Likewise, g = f ∗ α iff f = g ∗ α−1, i.e.,


X X
g(y) = f (x)α(x, y), ∀ y ∈ X ⇔ f (y) = g(x)α−1(x, y), ∀ y ∈ X.
x≤y x≤y
(17)
Proof. It follows from the fact g = α ∗ f iff α−1 ∗ g = α−1 ∗ (α ∗ f ), and the fact
α−1 ∗ (α ∗ f ) = (α−1 ∗ α) ∗ f = δ ∗ f = f.
Likewise, g = f ∗ α ⇔ g ∗ α−1 = f ∗ α ∗ α−1 = f ∗ δ = f .

27
Theorem 9.2. Let (X, ≤) be a finite poset. Let f, g be real-valued functions
on X. Then
X X
g(x) = f (y), ∀ x ∈ X ⇔ f (x) = µ(x, y)g(y), ∀ x ∈ X;
x≤y x≤y
X X
g(y) = f (x), ∀ y ∈ X ⇔ f (y) = g(x)µ(x, y), ∀ y ∈ X. (18)
x≤y x≤y

Proof. The first inversion formula follows from the fact that g = ζ ∗ f ⇔
f = ζ −1 ∗ g = µ ∗ g. The second inversion formula follows from the fact that
g = f ∗ ζ ⇔ f = g ∗ ζ −1 = g ∗ µ.
Writing in summations, for each fixed y ∈ X, we have
X XX
g(x)µ(x, y) = f (u)µ(x, y)
x≤y x≤y u≤x
XX
= f (u)ζ(u, x)µ(x, y)
x≤y u≤x
X X
= f (u) ζ(u, x)µ(x, y)
u≤y u≤x≤y
X
= f (u)δ(u, y)
u≤y
= f (y).

Corollary 9.3. Let [n] = {1, 2, . . . , n}. Let f, g : P([n]) → R be functions


such that X
g(I) = f (J), I ⊆ [n].
J⊆I
Then X
f (I) = (−1)|I−J|g(J), I ⊆ [n].
J⊆I

Permanent. Fix a positive integer n. Let Sn denote the symmetric group of


[n] = {1, 2, . . . , n}, i.e., the set of all permutations of [n]. Let A be an n × n

28
real matrix. The permanent of A is defined as the number
n
XY
per(A) = ai,σ(i).
σ∈Sn i=1

For the chessboard C in Example 6.1, we associate a 0-1 matrix A = [aij ] as


follows:  
× × 0 0 1 1 1
× ×  1 0 0 1
1 
 
C= × × , A=0 1 1 1 0 .
 
× × 1 0 0 1 1
× × 1 1 1 0 0
Then the number of ways to put 5 non-attacking indistinguishable rooks on C
is the permanent per(A).
Fix an n-by-n matrix A. For each subset I ⊆ [n], let AI denote the submatrix
of A, whose rows are those rows of A indexed by members of I. Let F (I) be the
set of all functions σ : [n] → I, and let G(I) be the set of all surjective functions
from [n] onto I. Then G
F (I) = G(J).
J⊆I
We introduce a real-valued function f on the power set P([n]) of [n], defined by
f (∅) = 0,
n
X Y
f (I) = ai,σ(i), ∀I ⊆ [n], I 6= ∅.
σ∈G(I) i=1

Note that f ([n]) = per(A). Let g : P([n]) → R be defined by


X
g(I) = f (J), ∀I ⊆ [n].
J⊆I

29
Then
n
X X Y
g(I) = ai,σ(i)
J⊆I σ∈G(J) i=1
X Y n
= ai,σ(i),
σ∈F (I) i=1
 
n
Y X
=  aij  , ∀I ⊆ [n].
i=1 j∈I

Thus by the Möbius inversion, we have


X
f (I) = (−1)|I−J|g(J), I ⊆ [n].
J⊆I

In particular, X
f ([n]) = (−1)n−|I|g(I).
I⊆[n]

Since f ([n]) = per(A), it follows that


X n µX
Y ¶
per(A) = (−1)n−|I| aij . (19)
I⊆[n] i=1 j∈I

However this formula is not much useful because there are 2n terms in the
summation.
Definition 9.4. Let (Xi, ≤i) (i = 1, 2) be two posets. The product poset
(X1 × X2, ≤) is given by
(x1, x2) ≤ (y1, y2) iff x1 ≤1 y1, x2 ≤2 y2.
For the convenience, we write ≤1 and ≤2 simply as ≤. Then (X1 × X2, ≤) is a
poset.
Theorem 9.5. Let µi be the Möbius functions of posets (Xi, ≤i), i = 1, 2.
Then the Möbius function µ of X1 × X2 for (x1, x2) ≤ (y1, y2) is given by
µ((x1, x2), (y1, y2)) = µ1(x1, y1) µ2(x2, y2).
30
Proof. We proceed by induction on `((x1, x2), (y1, y2)), the length of the longest
chains in the interval [(x1, x2), (y1, y2)]. It is obviously true when ` = 0. For
` ≥ 1, by inductive definition of µ,
X
µ((x1, x2), (y1, y2)) = − µ((x1, x2), (z1, z2))
(x1 ,x2 )≤(z1 ,z2 )<(y1 ,y2 )
X
= − µ1(x1, z1) µ2(x2, z2) (by IH)
(x1 ,x2 )≤(z1 ,z2 )<(y1 ,y2 )
X X
= µ1(x1, y1) µ2(x2, y2) − µ1(x1, z1) µ2(x2, z2)
x1 ≤z1 ≤y1 x2 ≤z2 ≤y2
= µ1(x1, y1) µ2(x2, y2) − δ1(x1, y1) δ2(x2, y2)
= µ1(x1, y1) µ2(x2, y2).

Example 9.4. The set Z+ = {1, 2, . . .} of positive integers is a poset with the
partial order of divisibility. Let n ∈ Z+ be factored as
e
n = pe11 pe22 · · · pkk ,
where pi are distinct primes and ei are positive integers. Since µ(m, m) = 1 for
all m ∈ Z+ and µ(1, n) is inductively given by
X
µ(1, n) = − µ(1, m)
m∈Z+ , m|n, m6=n

We only need to to consider the subposet (D(n), divisibility), where


D(n) = {d ∈ [n] : d | n}.
For r, s ∈ D(n), they can be written as
a b
r = pa11 pa22 · · · pkk , s = pb11 pb22 · · · pkk ,
where 0 ≤ ai, bi ≤ ei. Then r | s iff ai ≤ bi. This means that the poset D(n) is
isomorphic to the product poset
k
© ª Y
Q = (a1, . . . , ak ) : ai ∈ [0, ei] = [0, ei],
i=1

31
where [0, ei] = {0, 1, . . . , ei}. Thus µ(1, n) = µQ((0, . . . , 0), (e1, . . . , ek )), where
k
Y
µQ((0, . . . , 0), (e1, . . . , ek )) = µ[0,ei](0, ei).
i=1

Note that

1 if ei = 0,
 ½
(−1)ei if ei ≤ 1,
µ[0,ei](0, ei) = −1 if ei = 1, =
 0 if ei ≥ 2.
0 if ei ≥ 2.
It follows that
½
(−1)e1+···+ek if all ei ≤ 1,
µ(1, n) =
0 otherwise.

 1 if n = 1,
= (−1)j if n is a product of j distinct primes,

0 otherwise.
Now for arbitrary m, n ∈ Z+ such that m | n, the bijection
n no u

{u ∈ Z+ : m | u, u | n} → v ∈ Z+ : v | , u 7→
m m
is an isomorphism of posets for the partial order of divisibility. We thus have
³ n´
µ(m, n) = µ 1, .
m
In number theory, we write µ(1, n) as µ(n).
Theorem 9.6. Let f, g : Z+ → C be two functions. Then
X
g(n) = f (d), ∀ n ∈ Z+
d|n

is equivalent to X ³n´
f (n) = g(d)µ , ∀ n ∈ Z+.
d
d|n

Example 9.5. Let Φn = {k ∈ [n] : gcd(k, n) = 1}. Then φ(n) = |Φn|. Let
X
g(n) = φ(d), ∀ n ∈ Z+.
d|n

32
Let Φn,d = {k ∈ [n] : gcd(k, n) = d} for factors d of n; for instance Φn,1 = Φn.
There is a bijection
Φn,d → Φn/d, k 7→ k/d.
Then φ(n/d) = |Φn,d|. For each integer k ∈ [n], there is a unique integer d ∈ [n]
F
such that gcd(k, n) = d. Clearly, [n] = d|n Φn,d. Thus
X X ³n´ X X
n= |Φn,d| = φ = φ(k) = φ(d).
d
d|n d|n k|n d|n

By the Möbius inversion,


X X ³n´ X X n
φ(n) = kµ(k, n) = kµ = kµ(d) = µ(d) · . (20)
k d
k|n k|n dk=n d|n

Let n ≥ 2 and let p1, p2, . . . , pr be distinct primes dividing n. Then


©Q ª
{d ∈ [n] : d | n, µ(d) 6= 0} = i∈I pi : I ⊆ [r] ,
Q
where i∈∅ pi = 1. Since µ(1) = 1, µ(d) = (−1)k if d = pi1 · · · pik is a product
of k distinct primes, and µ(d) = 0 otherwise, we see that (20) becomes
µ ¶ µ ¶
n n n n
φ(n) = n − + + ··· + + + ··· − ···
p1 p2 p1 p2 p1 p3
n
+ · · · + (−1)r
p1 p2 · · · pr
Y r µ ¶ Y µ ¶
1 1
= n 1− =n 1− .
i=1
p i p
p|n, primes

Example 9.6. Let S = {a1, . . . , ak } be a set and M = {∞ · a1, . . . , ∞ · ak }


a multiset over S. A circular n-permutation of M is an arrangement of
n elements of M around a circle. Each circular n-permutation of M may be
considered as a periodic double-infinite string
(xi) = (xi)i∈Z = · · · x−2x−1x0x1x2 · · ·
of period n, i.e., xi+n = xi for all i ∈ Z. The minimal period of a circular
permutation (xi) of M is the smallest positive integer among all periods. It is
easy to see form below that the minimal period of a double-infinite sequence
divides all periods of the sequence.
33
Let Ln(M ) denote the set of all n-permutations of M , i.e., the set of all words
of length n over the set S. Let L(M ) be the set of all words over S. Then
S
L(M ) = n≥0 Ln(M ). Consider the map
σ : L(M ) → L(M ), σ(x1x2 · · · xn) = x2 · · · xnx1, σ(λ) = λ.
A word w of length n is said to be primitive if the words
w, σ(w), σ 2(w), ..., σ n−1(w)
are distinct. A period of an n-word w is a positive integer m such that σ m(w) =
w. Every n-word has a trivial period n. The smallest number of all periods of
a word w is called the minimal period of w, and it is a common factor of all
periods of w. In fact, for a period m of a word w which has minimal period d,
write m = qd + r, where 0 ≤ r < d. Suppose r > 0. Then
σ r (w) = σ r σ d
· · σ}d(w) = σ qd+r (w) = σ m(w) = w.
| ·{z
q

This means that r is a period of w, and is smaller than d, which is a contradiction.


Let L0n(M ) denote the set of all primitive n-words over S. Let Ln,d be the
subset of Ln(M ), whose n-words have minimal period d, where d | n. Notice
that
|Ln,d(M )| = |L0d(M )|.
Let L∞(M ) denote the set of double-infinite sequences over S. Let L∞,n(M )
be the subset of L∞(M ), whose members have period n. Let L0∞,n(M ) be the
subset of L∞,n(M ), whose members have minimal period n. Clearly,
G
L∞,n(M ) = L0∞,d(M ).
d|n

Let Cn(M ) denote the set of all circular n-permutations of M , which can be
identified as the set L∞,n(M ). Let L0∞,n(M ) be the subset of L∞,n(M ), whose
members have minimal period n. Then
X
|Cn(M )| = |L0∞,m(M )|.
m|n

Now we consider the map


F : L0m(M ) → L0∞, m(M ), w = s1s2 · · · sd 7→ (xi) = · · · www · · · ,
34
which is clearly surjective and each one member of L0∞, m(M ) receives exactly
m objects of L0m(M ). So |L0∞, m(M )| = |L0m(M )|/n. Thus
X X
0
|Cn(M )| = |L∞,m(M )| = |L0m(M )|/m.
m|n m|n
F 0
Since Ln(M ) = d|n Ln,d (M ),
we have
X X
0
|Ln(M )| = |Ln,d(M )| = |L0d(M )|.
d|n d|n

By the Möbius inversion,


X X ³n´
0
|Ln(M )| = |Ld(M )| µ(d, n) = |Ld(M )| µ .
d
d|n d|n

It follows that
X 1 X ³m´
|Cn(M )| = |La(M )| µ
m a
m|n a|m
X 1 ³m´
= |La(M )| µ .
m a
a|m, m|n

Let b = m/a, that is, m = ab. Then a | m and d | m are equivalent to a | n


and b | (n/a). Thus
X X µ(b)
|Cn(M )| = |La(M )| .
ab
a|n b|(n/a)
P
Since φ(n) = d|n µ(d) · n/d by (20), we see that
X µ(b) 1 X n/a 1 ³ n ´
= µ(b) · = φ .
ab n b n a
b|(n/a) b|(n/a)

35
We finally have
1X ³n´
|Cn(M )| = |La(M )| φ (since |La(M )| = k a|)
n a
a|n
1 X a ³n´
= k φ (set d = n/a)
n a
a|n
1 X n/d
= k φ(d).
n
d|n
Theorem 9.7. The number of circular n-permutations by using some ob-
jects of a k-set with repetition allowed is
1 X n/d
k φ(d)
n
d|n

Example 9.7. Let M = {n1 ·a1, . . . , nk ·ak } be a multiset of type (n1, . . . , nk )


and n = n1 + · · · + nk . Let m = gcd(n1, . . . , nk ). Note that if a is a period of
a permutation of M , then a | m. Let
Md = {(dn1/m) · a1, . . . , (dnk /m) · ak }, d ≥ 1.
Clearly, gcd{dn1/m, . . . , dnk /m} = d and Mm = M .
Let L(Md) denote the set of all permutations of Md, L0a(Md) the set of all
permutations of Md with minimal period a, and L0(Md) the set of all primitive
permutations of Md, i.e., permutations whose minimal period is the cardinality
dn/m of Md. For each w ∈ L(Md), let a be the minimum period of w. Then
w=w | 1w1{z· · · w}1 with a primitive word w1. Thus w1 is a word of type
b
µ ¶
dn1/m dnk /m
,..., .
b b
Since b | (dni/m) for all i, it follows that b | gcd{dn1/m, . . . , dnk /m}, i.e.,
0
Pk
b | d. So w ∈ La(Md) with a = i=1(d/b)(ni/m) = (d/b)(n/m). Note that
gcd {(d/b)(n1/m), . . . , (d/b)(nk /m)} = d/b.
We see that G
L(Md) = L0(d/b)(n/m)(Md), and
b|d

36
L0(d/b)(n/m)(Md) ' L0(Md/b) if b | d.
We then have
X X
0
|L(Md)| = |L (Md/b)| = |L0(Ma)|.
b|d a|d

By the Möbius inversion,


X µ ¶
d
|L0(Md)| = |L(Ma)| µ .
a
a|d

Let C(Md) denote the set of all circular permutations of Md, Ca0(Md) the set of
all circular permutations of Md with minimal period a, and C 0(Md) the set of
all primitive circular permutations of Md. Likewise,
G
C(Md) = Ca0(Md),
a|d

|Ca0(Md)| = |C 0(Ma)| if a | d.
Note that |Ma| = an/m and |L0(Ma)| = |C 0(Ma)| · an/m. We have
X X 1
0
|C(Md)| = |C (Ma)| = |L0(Ma)| ·
an/m
a|d a|d
XmX ³a´
= |L(Mb)| µ .
an b
a|d b|a

Set c = a/b, i.e., a = bc, then a | d and b | a are equivalent to b | d and


c | (d/b). Thus
1Xm X d/b
|C(Md)| = |L(Mb)| µ(c)
n d d
c
b|d c| b
1Xm ³d´
= |L(Mb)| φ (set a = d/b)
n d b
b|d
1Xm
= |L(Md/a)| φ(a).
n d
a|d

37
³ ´
bn/m
Let d = m, we have M = Mm. Recall |L(Mb)| = bn1 /m,...,bnk /m
, therefore
1X
|C(M )| = |C(Mm)| = φ(a) |L(Mm/a)|
n
a|m
X µ ¶
1 n/a
= φ(a) .
n n1/a, . . . , nk /a
a|m

For instance, for the multiset M = {12a1, 24a2, 18a3}. We have


gcd(12, 24, 18) = 6.
The factors of 6 are 1, 2, 3, 6. Recall
φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(6) = 2.
We see that the number of circular permutations of M is
· µ ¶ µ ¶ µ ¶ µ ¶¸
1 54 27 18 9
φ(1) + φ(2) + φ(3) + φ(6)
54 12, 24, 18 6, 12, 9 4, 8, 6 2, 4, 3

38

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy