Skip to content

第 4 章 生成排列和组合(下) ​

IMPORTANT

下篇有仍有许多模棱两可、较为困难且待完善的 🚧 题目, 欢迎各位高手发表意见,提交补充。

EX31 ​

Generate the 3-permutations of {1, 2, 3, 4, 5}.

验证代码如下,结合生成 r 子集代码和求全排列代码。

验证代码
CPP
#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
void output(vector<int>& vi) {
    for(auto it = vi.begin(); it != vi.end(); ++ it) {
        printf("%d ", *it);
    }
    printf("\n");
}
void generatePermutation(vector<int> permList, int n) {
    vector<bool> state(n+1, false);
    while(true) {

        output(permList);

        int maxMovVal = -1;
        int maxMovIdx = -1;
        for(int i = 0; i < n; ++ i) {
            // printf("number: %d, state: %d\n", permList[i], (int)state[permList[i]]);
            if(!state[permList[i]] && i > 0) { //arrow to left
                if(permList[i] > permList[i-1] && permList[i] > maxMovVal) {
                    maxMovVal = permList[i];
                    maxMovIdx = i;
                }
            } else if (!!state[permList[i]] && i < n-1) { //arrow to right
                if(permList[i] > permList[i+1] && permList[i] > maxMovVal) {
                    maxMovVal = permList[i];
                    maxMovIdx = i;
                }
            }
        }

        if(maxMovIdx == -1) break; //no moveable variables

        if(!state[maxMovVal]) { //swap with left
            swap(permList[maxMovIdx], permList[maxMovIdx-1]);
        } else { //swap with right
            swap(permList[maxMovIdx], permList[maxMovIdx+1]);
        }
        //filp the state of number(s) which greater than selected number.
        for(int i = 0; i < n; ++ i) {
            if(permList[i] > maxMovVal) state[permList[i]] = !state[permList[i]];
        }
    }
}
void generateRSubset(vector<int>& vi, unordered_set<int>& st, int n, int r) {
    // output(vi);
    generatePermutation(vi, r);
    int k = r-1;
    for(; k >= 0; -- k) {
        if(vi[k] < n && st.find(vi[k]+1) == st.end()) {
            break;
        }
    }

    if(k < 0) return;
    int val = vi[k] + 1;
    for(int i = k; i < r; ++ i) {
        st.erase(vi[i]);
        vi[i] = val;
        st.insert(vi[i]);
        val ++;
    }
    generateRSubset(vi, st, n, r);
}
int main()
{
    int n, r;
    printf("Place input the Dictionary size(n) and the Subset size(r):\n");
    scanf("%d %d", &n, &r);
    vector<int> list;
    unordered_set<int> unord_st;
    for(int i = 1; i <= r; ++ i) {
        list.emplace_back(i);
        unord_st.insert(i);
    }
    generateRSubset(list, unord_st, n, r);
    return 0;
}

EX31PS ​

答案好像只给出了 1 开头的子集(课本定义的集合顺序)。

验证代码感觉有 Bug,但是本着能跑就行的原则,对比答案给出的部分没有差错。

EX32 👻 ​

Generate the 4-permutations of {1, 2, 3, 4, 5, 6}.

同上。

EX33 ​

In which position does the subset 2489 occur in the lexicographic order of the 4-subsets of {1, 2, 3, 4, 5, 6, 7, 8, 9}?

(94)−(9−24)−(9−43)−(9−82)−(9−91)=81

从所有排列中,依次减去 X X X X 型,2 X X X 型,2 4 X X 型和 2 4 8 X 型,确定 2489 所在位置。

EX33PS ​

带入公式,杨辉三角之外的数全为 0。

后来会知道这些是扩展牛顿二项式。

EX34 ​

Consider the r-subsets of {1, 2, ... , n} in lexicographic order.

(a) What are the first (n - r + 1) r-subsets?

(b) What are the last (r + 1) r-subsets?

EX34Q(a) ​

显然第一个子集是123⋯r,由 EX26 中的算法,考虑只调整最后一位,其余位不变,则最后一个子集是12⋯n,恰好从 r 到 n 一共有 n-r+1 个数,因此前 n-r+1 个子集分别是,

123⋯r123⋯(r+1)⋯123⋯n

EX34Q(b) ​

容易验证最后一个子集是(n−r+1)(n−r+2)⋯n,它的前驱子集为(n−r)(n−r+2)⋯n, 再计算一次前驱子集(n−r)(n−r+1)(n−r+3)⋯n则可以发现规律, 那么倒数第 r+1 个子集为(n−r)(n−r+1)⋯(n−1),综上,

(n−r)(n−r+1)⋯(n−1)⋯(n−r)(n−r+1)(n−r+3)⋯n(n−r)(n−r+2)⋯n(n−r+1)(n−r+2)⋯n

EX35 ​

The complement A¯ of an r-subset A of {1, 2, ... , n} is the (n-r)-subset of {1, 2, ... , n}, consisting of all those elements that do not belong to A. Let M = (nr), the number of r-subsets and, at the same time, the number of (n-r)-subsets of {1, 2, ... , n}. Prove that, if

A1,A2,A3,⋯,AM

are the r-subsets in lexicographic order, then

AM¯,⋯,A3¯,A2¯,A1¯

are the (n-r)-subsets in lexicographic order.

任取两个不同的 r 子集 A 和 B,由集合字典序的定义(正文 p68)知, 如果(A∪B)∖(A∩B)中的最小元素如果在 A 侧, 则A<B,也即A∩B¯中的最小元素比B∩A¯中的最小元素更小, 此时对于补集有B¯<A¯。同理,当补集有B¯<A¯时, 也能推出最小元素在(A∪B)∖(A∩B)中的最小元素在 A 侧, 进而判断A<B。

由上可知,如果A1<A2,一定有补集A2¯<A1¯,其余同理。

EX36 ​

Let X be a set of n elements. How many different relations on X are there? How many of these relations are reflexive? Symmetric? Antisymmetric? Reflexive and symmetric? Reflexive and anti-symmetric?

有序对 (a,b) 一共有n2种选择方式,每个有序对有相关和不相关两种关系,因此共有2(n2)种关系(relation);

自反(reflexive)关系:自反关系必须包含所有的有序对 (a, a),对于剩余的有序对 (x, y)(其中x≠y,共n2−n个),可以选择是否加入到关系中,因此可以组成2n(n−1)种自反关系。

对称(symmetric)关系:(a, a) 可以任意出现;(x, y) 和 (y, x)(其中x≠y)必须成对出现,合计有n+(n2−n)/2可选项,因此一共有2n(n+1)2种关系。

反对称(Antisymmetric)关系: (a, a) 可以任意出现共有 n 个;(x, y) 和 (y, x)(其中x≠y)只能有一个出现,或者都不出现,有(n2)个,因此一共有2n⋅3n(n−1)2种关系。

自反且对称:(a, a) 必须都在;(x, y) 和 (y, x)(其中x≠y)必须成对出现,合计有(n2−n)/2可选项,因此一共有2n(n−1)2种关系。

自反且反对称:(a, a) 必须都在;(x, y) 和 (y, x)(其中x≠y)只能有一个出现,或者都不出现,因此一共有3n(n−1)2种关系。

提示

反对称和非对称是两个概念。

EX36 参考链接 ​

离散数学 N 元集合关系个数计算 - 百度文库 (baidu.com)

discrete mathematics and its applications seventh edition section 9.1 47

EX37 ​

Let R' and R" be two partial orders on a set X. Define a new relation R on X by xRy if and only if both xR'y and xR"y hold. Prove that R is also a partial order on X. (R is called the intersection of R' and R".)

证明 R 是 X 上的偏序关系,即证明 R 满足自反性、反对称性和传递性。

自反性:对任意的x∈X,都有 xR'x 和 xR''y,由 R 的定义知,一定有 xRx 成立。

反对称性:对于不同的x,y∈X,满足 xR'y,则由 R‘的反对称性yR̸′x;同理有 xR''y 和yR̸″x,也能推出yR̸x。

传递性:x,y,z∈X,xR'y 且 yR'z,由 R‘的传递性有xR′z;同理有 xR''z,因此有 xRz。

提示

逻辑推理若 p 则 q,若非 q 则非 p, 那由德摩根律,非 q 是指 yR̸′x或yR̸″x, 只需要有一个就可以证明yR̸x。

EX38 ​

Let (X1,≤1) and (X2,≤2) be partially ordered sets. Define a relation T on the set

X1×X2={(x1,x2):x1in X1,x2in X2}

by

(x1,x2)T(x1′,x2′) if and only if x1≤1x1′ and x2≤2x2′

Prove that (X1×X2,T) is a partially ordered set. (X1×X2,T) is called the direct product of (X1,≤1) and (X2,≤2) and is also denoted by (X1,≤1)×(X2,≤2). More generally, prove that the direct product (X1,≤1)×(X2,≤2)×⋯×(XM,≤m) of partially ordered sets is also a partially ordered set.

自反性:取x=(x1,x2)∈X1×X2,x1∈X1, x1满足偏序关系有x1≤1x1,同理,x2≤2x2,所以得出 T 满足自反性。

反对称性:取x=(x1,x2),x′=(x1′,x2′)∈X1×X2, 并且设x1≤1x1′,x2≤2x2′, 由偏序关系知,如果x1′≤1x1,x2′≤2x2, 那么一定有x1=x1′,x2=x2′,所以 T 满足反对称性。

传递性:取x=(x1,x2),x′=(x1′,x2′),x″=(x1″,x2″)∈X1×X2, 由偏序关系知,x1≤1x1′,x1′≤1x1″, 所以x1≤1x1″,同理x2≤2x2″,所以 T 有传递性。

综上,T 满足偏序关系且(X1×X2,T)是偏序集。

显然我们可以取x=(x1,x2,⋯,xm)等采用上述方式证明(X1,≤1)×(X2,≤2)×⋯×(XM,≤m)也是偏序集。

EX39 🚧 ​

Let (J,≤) be the partially ordered set with J = {0, 1} and with 0 < 1. By identifying the subsets of a set X of n elements with the n-tuples of 0s and 1s, prove that the partially ordered set (X,⊆) can be identified with the n-fold direct product

(J,≤)×(J,≤)×⋯×(J,≤) (n factors).

令Jn=J×J×⋯×J(n 项),所以Jn是每一项为 0 或者 1 的 n 元组,设 x=(x1,x2,⋯,xn),y=(y1,y2,⋯,yn)∈Jn,并且 x 和 y 满足偏序关系 x≤y 时,对所有的 i 都有 xi≤yi。

定义 X={1,2,⋯,n}上的子集集合P(X), 函数 f:Jn→P(X) 满足,

f(x)={i∈X|xi=1},x∈Jn

即f(x)是 x 元组中所有为 1 项的下标组成的集合, 显然f(x)既是单射又是满射, 即Jn与P(X)满足一一映射(双射)关系。

所以满足偏序关系x≤y当且仅当f(x)⊆f(y), 因此偏序集(X,⊆) 可以用 n 重直积Jn表示。

并且有如下等价命题,

  1. 偏序关系x≤y
  2. 项的关系xi≤yi,1≤i≤n
  3. 如果项xi=1,那么一定有yi=1,1≤i≤n
  4. 如果下标i∈f(x),那么一定有i∈f(y),1≤i≤n
  5. 集合关系f(x)⊆f(y)

EX39PS ​

其实答案每一句话都能看懂,就是连在一起感觉没有逻辑。

还有另一种参考,我也是大为震惊(因为看不懂)。

EX40 🚧 ​

Generalize Exercise 39 to the multiset of all combinations of the multiset X = {n1⋅a1,n2⋅a2,⋯,nm⋅am}. (Part of this exercise is to determine the "natural" partial order of these multisets.)

对于任意非负整数 r,定义由{0,1,⋯,r},0<1<⋯<r构成的偏序集[r],P(X)是所有多重集合 X 的子集构成的集合,有x∈P(X),

x={x1⋅a1,x2⋅a2,⋯,xm⋅am},0≤xj≤nj(1≤j≤m)

对于x,y∈P(X)如下命题等价,

  1. x⊆y
  2. xj≤yj,1≤j≤m
  3. 在偏序集[n1]×[n2]×⋯×[nm]中(x1,x2,⋯,xm)≤(y1,y2,⋯,ym)

所以偏序集(P(X),⊆)能用直积[n1]×[n2]×⋯×[nm]表示。

EX41 🚧 ​

Show that a partial order on a finite set is uniquely determined by its cover relation.

有限集 X 上的偏序关系≤由覆盖关系唯一确定需要证明如下引理。

引理:对于不同的x,y∈X,下列两个命题等价

  1. x<y
  2. 存在整数r≥2,并且取自 X 的序列 (x1,x2,⋯,xr)
  3. 满足x1=x,xr=y并且xi覆盖 xi−1,2≤i≤r

先由 1 证 2,考虑取自 X 的序列 (x1,x2,⋯,xr) 所构成的集合 S, 要求 S 中的元素满足 x1=x,xr=y,xi−1<xi,因为 X 是有限集, 那么 S 也是有限集,并且 S 至少包含序列 (x, y),所以 S 非空。

因此,我们可以从 S 中选择出大小为 r 的序列,使之满足覆盖条件xi覆盖xi−1,2≤i≤r。

再由 2 证 1,因为xi能覆盖xi−1,并且由传递性可得x<y。

综上,有限集上的偏序关系由覆盖关系唯一确定。

EX42 🚧 ​

Describe the cover relation for the partial order ⊆ on the collection P(X) of an subsets of a set X.

记 n = |X|,所有子集分布在 n 阶立方体上。

EX43 ​

Let X = {a, b, c, d, e, f} and let the relation R on X be defined by aRb, bRc, cRd, aRe, eRf, fRd. Verify that R is the cover relation of a partially ordered set, and determine all the linear extensions of this partial order.

就是写出所有的拓扑排序。

abecfd, abefcd, aebcfd, aebfcd, abcefd, aefbcd.

EX44 ​

Let A1,A2,⋯,As be a partition of a set X. Define a relation R on X by xRy if and only if x and y belong to the same part of the partition. Prove that R is an equivalence relation.

自反性:对于任意x∈X,x 和 x 属于划分的同一个部分。

对称性:对于x,y∈X,若 x 和 y 属于划分的同一个部分,则 y 和 x 属于划分的同一部分。

传递性:对于x,y,z∈X,若 x 和 y 属于划分的同一个部分,y 和 z 属于划分的同一个部分,那么 x 和 z 也属于划分的同一个部分。

综上,R 是等价关系。

EX44PS ​

区分等价关系(自反、对称、传递)和偏序关系(自反、反对称、传递)。

EX45 ​

Define a relation R on the set Z of all integers by aRb if and only if a = ±b. Is R an equivalence relation on Z? If so, what are the equivalence classes?

R 是等价关系,证明如下。

自反性:任意x∈Z,都有 x=x。

对称性:任意x,y∈Z,如果x=±y,则一定有y=±x。

传递性:任意x,y,z∈Z,如果x=±y,y=±z,则一定有x=±z。

两个等价类,一个等价类只有 0,另一个等价类是正数和它的相反数。

EX46 ​

Let m be a positive integer and define a relation R on the set X of all nonnegative integers by aRb if and only if a and b have the same remainder when divided by m. Prove that R is an equivalence relation on X. How many different equivalence classes does this equivalence relation have?

自反性:对于任意的x∈X, x 和 x 显然除以 m 余数相同。 对称性:对于x,y∈X, 如果 x 和 y 除以 m 余数相同,那么 y 和 x 除以 m 余数相同。 传递性:对于x,y,z∈X,如果 x 和 y 除以 m 余数相同,y 和 z 除以 m 余数相同,那么 x 和 z 除以 m 余数相同。

因此 R 是等价关系。等价类根据余数划分,一共有 m 个等价类。

[0],[1],⋯,[m−1],[r]={r+im|i∈Z},0≤r≤m−1

EX47 🔑 ​

Let Πn denote the set of all partitions of the set {1, 2, ... ,n} into nonempty sets. Given two partitions π and σ in Πn, define π≤σ, provided that each part of π is contained in a part of σ. Thus, the partition π can be obtained by partitioning the parts of σ. This relation is usually expressed by saying that π is a refinement of σ.

(a) Prove that the relation of refinement is a partial order on Πm.

(b) By Theorem 4.5.3, we know that there is a one-to-one correspondence between Πm and the set Λn of all equivalence relations on {1, 2, ... ,n}. What is the partial order on Λn that corresponds to this partial order on Πm?

(c) Construct the diagram of (Πm,≤) for n = 1,2,3, and 4.

EX47Q(a) ​

自反性:对任意π⊆Πn,显然π⊆π,满足自反性。

反对称性:对于π,σ⊆Πn,如果π⊆σ且σ⊆π,则π=σ,满足反对称性。

传递性:对于π,ρ,σ⊆Πn,如果π⊆ρ,ρ⊆σ,则π⊆σ,满足传递性。

因此加细关系是Πn上的一个偏序关系。

EX47Q(b) 🚧 ​

EX47Q(c) ​

Hasse 图如下所示。

EX48 ​

Consider the partial order ≤ on the set X of positive integers given by "is a divisor of." Let a and b be two integers. Let c be the largest integer such that c ≤ a and c ≤ b, and let d be the smallest integer such that a ≤ d and b ≤ d. What are c and d?

a=2a13a25a3⋯,b=2b13b25b3⋯c=2c13c25c3⋯,d=2d13d25d3⋯

并且由偏序关系,可知ci=min{ai,bi},di=max{ai,bi},因此 c 是 a 和 b 的最大公因数,d 是 a 和 b 的最小公倍数。

EX49 ​

Prove that the intersection R∩S of two equivalence relations Rand S on a set X is also an equivalence relation on X. Is the union of two equivalence relations on X always an equivalence relation?

自反性:取x∈X,在关系 R 和关系 S 上均有自反性,即xRx,xSx,所以有xRx∩xSx,x(R∩S)x,满足自反性;

对称性:取(x,y)∈R∩S,x(R∩S)y,有xRy∩xSy,即xRy,xSy,由 R 和 S 的对称性有yRx,ySx,即y(R∩S)x,满足对称性;

传递性:取(x,y),(y,z)∈R∩S,x(R∩S)y,y(R∩S)z,由 R 和 S 的传递性,有xRz,xSz,所以x(R∩S)z,满足传递性;

综上,R∩S是等价关系。下面我们举例证明两个等价关系的并并不满足等价关系。

X={1,2,3};R={(1,1),(2,2),(3,3),(1,2),(2,1)};S={(1,1),(2,2),(3,3),(2,3),(3,2)}

可以验证 R 和 S 都是 X 上的等价关系,而

R∪S={(1,1),(2,2),(3,3),(1,2),(2,1),(2,3),(3,2)}

不满足等价关系,因为存在(1,2),(2,3)∈R∪S但(1,3)∉R∪S,所以R∪S不是等价关系。

EX49PS ​

两个等价关系的并集不满足等价关系,需要从传递性方面反证,因为等价关系的并集自反性和对称性都是满足的。

EX50 ​

Consider the partially ordered set (X,⊆) of subsets of the set X = {a, b, c} of three elements. How many linear extensions are there?

技术问题,图画了个大概,方框内是集合,与顺序无关。题目需要求拓扑排序的数目。

从空集出发,必须先选择 2 个单元素集(不妨假设选了{a},{b}),(所有双元素集都依赖两个单元素集),并且与顺序无关,因此有P(3,2)=6种选法。

第二步则可以考虑选择剩余的单元素集({c}),之后双元素集合选取不受顺序限制P(3,3)=6种选法,最后选择全集。

或者优先选择双元素集合({a,b}),之后只能选择剩余的单元素集({c}),其余同上,有P(2,2)=2种选法。

综上,一共有6×(6+2)=48种选法。

参考链接 ​

Combinatorics and Linear Extensions - Mathematics Stack Exchange

EX51 🚧 🔑 ​

Let n be a positive integer, and let Xn be the set of n! permutations of {1, 2, ... ,n} Let π and σ be two permutations in Xn, and define π≤σ a provided that the set of inversions of π is a subset of the set of inversions of σ. Verify that this defines a partial order on Xn , called the inversion poset. Describe the cover relation for this partial order and then draw the diagram for the inversion poset (H4,≤).

描述覆盖关系:π逆序列的集合真含于σ逆序列的集合,则称σ覆盖π。

不知所言的参考答案 💊 ​

定义Inv(π)为排列π的逆序列集合,我们通过如下两个命题等价来验证当Inv(π)⊆Inv(σ)时,π≤σ。

  1. σ覆盖π
  2. 可以从π中翻转 ab 到 ba(a<b)来获得σ

先由 1 证 2:我们假设π<σ,因此有Inv(π)⊆Inv(σ), 之后我们可以从σ中选择一个逆序 ba(a<b,a 是所有 b 逆序中最小的数) 这个逆序不存在π中,即有

π=⋯a⋯b⋯σ=⋯b⋯a⋯

下证,b 与 a 相邻,假设σ=⋯b⋯c⋯a⋯, 因此 bc 和 ca 是两对逆序,那么 c 在π中 a 的左侧,b 的右侧,但这是不可能的, 所以σ=⋯ba⋯,进行翻转后, 可以得到p=⋯ab⋯,π≤p<σ。 由σ覆盖π,所以π=p,即可以从π中翻转 ab 到 ba(a<b)来获得σ。

再由 2 证 1:同上,我们有

π=⋯ab⋯σ=⋯ba⋯

除 a 和 b 的坐标外,其余坐标均相同, 显然|Inv(π)|+1=|Inv(σ)|, 并且Inv(π)⊆Inv(σ),π≤σ。 π,σ之间不存在其他元素,所以σ 覆盖π。

画H4图 🔑 ​

时间关系,H4的图略。

EX51PS ​

对比 EX30,求的是字典序的逆序列,与本题所定义的偏序不同。

可以参考一下,Student (jade-cheng.com)。

EX52 ​

Verify that a binary n-tuple an−1⋯a1a0 is in place k in the Gray code order list where k is determined as follows: For i = 0,1, ... ,n-1, let

bi={0, if an−1+⋯+ai is even, and 1, if an−1+⋯+ai is odd 

Then

k=bn−1×2n−1+⋯b1×2+b0×20

Thus, an−1⋯a1a0 is in the same place in the Gray code order list of binary n-tuples as bn−1⋯b1b0 is in the lexicographic order list of binary n-tuples.

由题意,bn−1⋯b1b0就是 k 的二进制串, 下面采用数学归纳法证明an−1⋯a1a0位于 Gray 表中的第 k 个位置(从 0 开始), 其中 k 为bn−1⋯b1b0所对应的数。

显然,当 k=0 时,bi=0,0≤i≤n−1,且ai=0符合反射 Gray 码的第 0 项。

假设当 k=m 时成立,如果∑i=0n−1ai为偶数,那么b0=0,(m 形如bn−1⋯b2b10), 并且由 Problem G 知下一个反射 Gray 码是通过翻转a0得到,其余位不变, 那只翻转b0,使b0=1,此时bn−1⋯b1b0所对应的 k 为 m+1,(m+1 形如bn−1⋯b2b11);

如果如果 ∑i=0n−1ai 为奇数,那么 b0=1, 并且可以知道下一个反射 Gray 码通过翻转最右边的 1 左侧一位 as,(as−1=1,as−2,⋯a1,a0=0) 得到, 其余位不变,(m 形如bn−1⋯01⋯1),由于aj=0,0≤j≤s−2, 可以推出 ∑i=jn−1ai 为奇数,即 bj=1,0≤j≤s−1,bs=0, 此时翻转bi,0≤i≤s,得到 bj=0,0≤j≤s−1,bs=1, 此时 bn−1⋯b1b0 所对应的 k 为 m+1,(m+1 形如bn−1⋯10⋯0)。

EX52PS ​

Problem B 介绍了二进制的加法(自增 +1)和减法(自减 -1)求法;Problem G 介绍了反射 Gray 码的前驱和后继求法(联系 EX23 和 EX24)。

EX53 🚧 ​

Continuing with Exercise 52, show that an−1⋯a1a0 can be recovered from $b_{n-1}\cdots b_1 b_0 $, by an−1=bn−1 and for i = 0,1, ... , n-1,

ai={0, if bi+bi+1 is even, and 1, if bi+bi+1 is odd 

太迷惑了,以至于没整理。

仍旧采用数学归纳法证明,与上一题类似,

显然,当 k=0 时,bi=0,0≤i≤n−1,且ai=0符合反射 Gray 码的第 0 项。

假设当 k=m 时成立,m 所对应的反射 Gray 码为an−1⋯a1a0,当b0=0时,有∑i=0n−1ai为偶数,m+1 通过翻转b0得到,即翻转a0;

当b0=1时,有∑i=0n−1ai为奇数,存在 s 满足as=0,aj=1,0≤j≤s−1,由aj=0,推出bj,0≤j≤s同奇偶,

UNFINISHED

又是感觉答案和题目毫无关系。

EX54 ​

Let (X,≤) be a finite partially ordered set. By Theorem 4.5.2 we know that (X,≤) has a linear extension. Let a and b be incomparable elements of X. Modify the proof of Theorem 4.5.2 to obtain a linear extension of (X,≤) such that a<b. (Hint: First find a partial order ≤′ on X such that whenever x≤y, then x≤′y and, in addition, a≤′b.)

对于不可比元素 a 和 b,我们可以通过定义 b 覆盖 a(比如线性顺序列出),来找到 X 上的偏序关系≤′ 使得a≤′b,并且由定理 4.5.2 可知,这样的偏序关系对有限集一定存在。因此,我们可以得到偏序集(X,≤′)。

(X,≤′)由(X,≤)添加关系得到,该线性扩展也保留了原来所有的可比关系, 也一定是原偏序集的一个线性扩展。同时,因为a≤′b,所以a<b。

综上,我们可以找到一种线性扩展,使偏序集(X,≤)中不可比的元素 a 和 b, 有a<b。

EX54 参考链接 ​

Student (jade-cheng.com)

EX55 ​

Use Exercise 54 to prove that a finite partially ordered set is the intersection of all its linear extensions.(see Exercise 37).

由 EX54 的结论可知,对于不可比元素 a 和 b,总能找到一个线性扩展使得a<b,满足关系 R, 同理,我们也能找到一个线性扩展使得b<a,满足关系 S。

因为(a,b)∉R,(b,a)∉S,所以(a,b),(b,a)∉R∩S, 所以 (a, b) 和 (b, a) 都不在这两个线性扩展的交集之中。 同理,所有不可比关系都会排除在线性扩展交集之外, 因此所有线性扩展的交集只有原来包含的关系,即交集是(X,≤)。

EX55 参考链接 ​

Student (jade-cheng.com)

EX56 ​

The dimension of a finite partially ordered set (X,≤) is the smallest number of its linear extensions whose intersection is (X,≤). By Exercise 55, every partially ordered set has a dimension. Those that have dimension 1 are the linear orders. Let n be a positive integer and let i1,i2,⋯,in be a permutation σ of {1, 2, ... ,n} that is different from 1, 2, ... ,n. Let X = {(1,i1),(2,i2),⋯,(n,in)}. Now define a relation R on X by (k,ik)R(l,il) if and only if k≤l (ordinary integer inequality) and ik≤il(again ordinary inequality); that is, (ik,il) is not an inversion of σ. Thus, for instance, if n = 3 and σ = 2,3,1, then X = {(1, 2), (2, 3), (3, 1)}, and (1,2)R(2, 3), but (1,2)R̸(3,1). Prove that R is a partial order on X and that the dimension of the partially ordered set (X, R) is 2, provided that i1,i2,⋯,in is not the identity permutation 1,2, ..., n.

易证 R 是 X 上的偏序关系,

自反性:

反对称性:

传递性:

定义 X 上的偏序关系≤1,只要a≤c,就满足偏序关系(a,b)≤1(c,d);再定义 X 上的偏序关系≤2,只要b≤d,就满足偏序关系(a,b)≤2(c,d)。

显然≤1,≤2都是 R 的线性扩展,R 是线性扩展的交集。因此 R 的维度不超过 2,因为i1,i2,⋯,in不同于恒等排列1,2,⋯,n,所以 R 的维度至少为 2,综上,R 的维度为 2。

EX57 🚧 ​

Consider the set of all permutations i1,i2,⋯,in of 1,2, ... ,n such that ik≠k for k = 1,2, ... ,n. (Such permutations are called derangements and are discussed in Chapter 6.) Describe an algorithm for generating a random derangement (modify the algorithm given in Section 4.1 for generating a random permutation).

EX58 🚧 ​

Consider the complete graph Kn defined in Chapter 2, in which each edge is colored either red or blue. Define a relation on the n points of Kn by saying that one point is related to another point provided that the edge joining them is colored red. Determine when this relation is an equivalence relation, and, when it is, determine the equivalence classes.

R 被定义在完全图的点集V(Kn)={1,2,⋯,n}上,E(Kn)则是完全图的边集。

R 可以定义为:xRy,对于任意的x,y∈V(Kn),xy∈E(Kn)是一条红边(不是蓝边)。

自反性:对于x∈V(Kn),xx∈E(Kn)是一条平凡的边,R 满足自反性。

对称性:对于x,y∈V(Kn),xy∈E(Kn)是一条红边,yx∈E(Kn)是同一条红边。

传递性:

当Ki(2≤i≤n)子图包含Kn所有的红边时,形成等价关系。

等价类时所有的完全图{K2,K3⋯,Kn}。

WARNING

传递性证明没能完成

EX59 ​

Let n≥2 be an integer. Prove that the total number of inversions of all n! permutations of 1,2, ... ,n equals

12n!(n2)=n!n(n−1)4

(Hint: Pair up the permutations so that the number of inversions in each pair is n(n - 1)/2.)

第一步,计算逆序可能出现的组合数量:因为逆序是两两配对,逆序组合不超过(n2)=n(n−1)2个;(这一点可以参考 EX8) 第二步,给选出的逆序安排位置,(n2)种方式; 第三步,排列其余 n-2 项,(n-2)! 种方式。

因此,所有排列中的逆序总数为

(n2)⋅(n2)⋅(n−2)!=n(n−1)2×n(n−1)2×(n−2)!=n!n(n−1)4