2.1 Inclusion-Exclusion

Roughly speaking, a "sieve method" in enumerative combinatorics is a method for determining the cardinality of a set $S$ that begins with a larger set and somehow subtracts off or cancels out unwanted elements. Sieve methods have two basic variations: (1) We can first approximate our answer with an overcount, and then subtract off an overcounted approximation of our original error, and so on, until after finitely many steps we have "converged" to the correct answer. This method is the combinatorial essence of the Principle of Inclusion-Exclusion, to which this section and the next four are devoted. (2) The elements of the larger set can be weighted in a natural combinatorial way so that the unwanted elements cancel out, leaving only the original set $S$. We discuss this technique in Sections 2.6 and 2.7.

The Principle of Inclusion-Exclusion is one of the fundamental tools of enumerative combinatorics. Abstractly, the Principle of Inclusion-Exclusion amounts to nothing more than computing the inverse of a certain matrix. As such, it is simply a minor result in linear algebra. The beauty of the principle lies not in the result itself, but rather in its wide applicability. We will give several examples of problems that can be solved by Inclusion-Exclusion, some in a rather subtle way. First, we state the principle in its purest form.

2.1.1 Theorem. Let $S$ be an $n$-set. Let $V$ be the $2^n$-dimensional vector space (over some filed $K$) of all functions $f\colon 2^S\to K$. Let $\phi\colon V\to V$ be the linear transformation defined by
\begin{equation}
\phi f(T) = \sum_{Y\supseteq T} f(Y), \text{ for all $T\subseteq S$.}
\end{equation}
Then $\phi^{-1}$ exists and is given by
\begin{equation}
\phi^{-1}f(T) = \sum_{Y\supseteq T} (-1)^{\#(Y-T)}f(Y), \text{ for all $T\subseteq S$.}
\end{equation}

Proof. Define $\psi\colon V\to V$ by $\psi f(T) = \sum_{Y\supseteq T}(-1)^{\#(Y-T)}f(Y)$. Then (composing functions right to left)
\begin{aligned}
\phi\psi f(T) &= \sum_{Y\supseteq T}(-1)^{\#(Y-T)}\phi f(Y) \\
&= \sum_{Y\supseteq T} (-1)^{\#(Y-T)}\sum_{Z\supseteq Y} f(Z)\\
&= \sum_{Z\supseteq T} \left(\sum_{Z\supseteq Y\supseteq T} (-1)^{\#(Y-T)}\right) f(Z).
\end{aligned}

注:"composing functions right to left" 的意思应当是:$\phi\psi f(T)$ 的操作顺序是 $\phi$ 先作用于 $f$,$\psi$ 再作用于 $\phi f$ 。这里采用的顺序跟通常函数复合的操作顺序不同,有点奇怪。

Setting $m = \# (Z- T)$, we have
\begin{equation*}
\sum_{\substack{Z\supseteq Y \supseteq T\\ (Z,T\ \mathrm{fixed})}} (-1)^{\#(Y-T)} = \sum_{i = 0}^{m} (-1)^{i}\binom{m}{i} = \delta_{0m},
\end{equation*}
so $\phi\psi\, f(T) = f(T)$. Hence, $\phi\psi f = f$, so $\psi = \phi^{-1}$.

注: 从证明过程可以看出,将 $\supseteq$ 换成任意偏序关系 $\le$,上述定理都成立。

The following is the usual combinatorial situation involving Theorem 2.1.1. We think of $S$ as being a set of properties that the elements of some given set $A$ of objects may or may not have. For any subset $T$ of $S$, let $f_=(T)$ be the number of objects in $A$ that have exactly the properties in $T$ (so they fail to have the properties in $\overline T = S - T$). More generally, if $w\colon A\to K$ is any weight function on $A$ with values in a field (or abelian group) $K$, then one could set $f_=(T) = \sum_x w(x)$, where $x$ ranges over all objects in $A$ having exactly the properties in $T$. Let $f_\ge(T)$ be the number of objects in $A$ that have at least the properties in $T$. Clearly then,
\begin{equation}
f_\ge(T) = \sum_{Y\supseteq T} f_=(Y). \label{E:f_\ge(T)}
\end{equation}

Hence by Theorem 2.1.1,
\begin{equation}
f_=(T) = \sum_{Y\supseteq T}(-1)^{\#(Y-T)}f_\ge(Y). \label{E:4}
\end{equation}
In particular, the number of objects having none of the properties in $S$ is given by
\begin{equation}
f_=(\emptyset) = \sum_{Y}(-1)^{\#Y}f_\ge(Y), \label{E:5}
\end{equation}
where $Y$ ranges over all subsets of $S$. In typical applications of the Principle of Inclusion-Exclusion, it will be relatively easy to compute $f_\ge(Y)$ for $Y\subseteq S$, so equation \eqref{E:4} will yield a formula for $f_=(T)$.

In equation \eqref{E:4} one thinks of $f_\ge(T)$ (the term indexed by $Y = T$) as being a first approximation to $f_=(T)$. We then subtract
\begin{equation*}
\sum_{\substack{Y\supseteq T\\ \#(Y-T) = 1}} f_\ge(Y),
\end{equation*}
to get a better approximation. Next we add back in
\begin{equation*}
\sum_{\substack{Y\supseteq T\\ \#(Y-T) = 2}} f_{\ge}(Y),
\end{equation*}
and so on, until finally reaching the explicit formula \eqref{E:4}. This reasoning explains the terminology "Inclusion-Exclusion."

Perhaps the most standard formulation of the Principle of Inclusion-Exclusion is one that dispenses with the set $S$ of properties per se, and just considers subsets of $A$. Thus, let $A_1, \dots, A_n$ be subsets of a finite set $A$. For each subset $T$ of $[n]$, let
\begin{equation*}
A_T = \bigcap_{i\in T} A_i
\end{equation*}
(with $A_\emptyset = A$), and for $0\le k\le n$ set
\begin{equation}
S_k = \sum_{\#T = k} \# A_T, \label{E:S_k}
\end{equation}
the sum of the cardinalities, or more generally the weighted cardinalities
\begin{equation*}
w(A_T) = \sum_{x\in A_T} w(x),
\end{equation*}
of all $k$-tuple intersections of the $A_i$'s. Think of $A_i$ as defining a property $P_i$ by the condition that $x\in A$ satisfites $P_i$ if and only if $x\in A_i$. Then $A_T$ is just the set of objects in $A$ that have at least the properties in $T$, so by \eqref{E:5} the number $\#(\overline{A_1} \cap \dots \cap\overline{A_n})$ of elements of $A$ lying in none of the $A_i$'s is given by
\begin{equation}
\#(\overline{A_1} \cap \dots \cap\overline{A_n}) = S_0 - S_1 + S_2 - \dots + (-1)^{n}S_n, \label{E:7}
\end{equation}
where $S_0 = \#A_{\emptyset} = \#A$.

The Principle of Inclusion-Exclusion and its various reformulations can be dualized by interchanging $\cap$ and $\cup$, $\subseteq$ and $\supseteq$, and so on, throughout. The dual form of Theorem 2.1.1 states that if
\[
\widetilde{\phi} f(T) = \sum_{Y\subseteq T} f(Y), \quad \text{for all $T\subseteq S$},
\]
then $\widetilde{\phi}^{-1} f(T)$ exists and is given by
\begin{equation*}
\widetilde{\phi}^{-1} f(T) = \sum_{Y\subseteq T} (-1)^{\#(T-Y)} f(Y), \quad\text{for all $T \subseteq S$}.
\end{equation*}
Similarly, if we let $f_\le(T)$ be the (weighted) number of objects of $A$ having at most the properties in $T$, then
\begin{equation}
\begin{aligned}
f_\le(T) &= \sum_{Y\subseteq T}f_=(Y), \\
f_=(T) &= \sum_{Y\subseteq T} (-1)^{\#(T-Y)} f_\le(Y).
\end{aligned}\label{E:8}
\end{equation}

A common special case of the Principle of Inclusion-Exclusion occurs when the function $f_=$ satisfies $f_=(T) = f_=(T')$ whenever $\#T = \#T'$. Thus also $f_\ge(T)$ depends only on $\#T$, and we set $a(n-i) = f_=(T)$ and $b(n-i) = f_\ge(T)$ whenever $\#T= i$. (Caveat. In many problems the set $A$ of objects and $S$ of properties will depend on a parameter $p$, and the functions $a(i)$ and $b(i)$ may depend on $p$. Thus, for example, $a(0)$ and $b(0)$ are the number of objects having all the properties, and this number may certainly depend on $p$. Proposition 2.2.2 is devoted to the situation when $a(i)$ and $b(i)$ are independent of $p$.) We thus obtain from equation \eqref{E:f_\ge(T)} and \eqref{E:4} the equivalence of the formulas

\begin{align}
b(m) &= \sum_{i= 0}^m \binom{m}{i} a(i), \quad 0\le m\le n, \label{E:9} \\
a(m) &= \sum_{i=0}^m \binom{m}{i} (-1)^{m-i} b(i), \quad 0\le m \le n. \label{E:10}
\end{align}

In other words, the inverse of the $(n+1)\times(n+1)$ matrix whose $(i,j)$-entry $(0\le i, j\le n)$ is $\binom{j}{i}$ has $(i,j)$-entry $(-1)^{j-i}\binom{j}{i}$. For instance,
\[
\begin{bmatrix}
1 & 1 & 1 & 1\\
0 & 1 & 2 & 3\\
0 & 0 & 1 & 3 \\
0 & 0 & 0 & 1
\end{bmatrix}^{-1} = \begin{bmatrix}
1 & -1 & 1 & -1 \\
0 & 1 & -2 & 3 \\
0 & 0 & 1 & -3 \\
0 & 0 & 0 & 1
\end{bmatrix} .
\]
Of course, we may let $n$ approach $\infty$ so that \eqref{E:9} and \eqref{E:10} are equivalent for $n = \infty$.

Note that in language of the calculus of finite differences, \eqref{E:10} can be rewritten as
\[
a(m) = \Delta^m b(0), \quad 0 \le m \le n.
\]

抄书 Richard P. Stanley Enumerative Combinatorics Chapter 2 Sieve Methods的更多相关文章

  1. Chapter 7:Statistical-Model-Based Methods

    作者:桂. 时间:2017-05-25  10:14:21 主要是<Speech enhancement: theory and practice>的读书笔记,全部内容可以点击这里. 书中 ...

  2. 卡特兰数 Catalan数 ( ACM 数论 组合 )

    卡特兰数 Catalan数 ( ACM 数论 组合 ) Posted on 2010-08-07 21:51 MiYu 阅读(13170) 评论(1)  编辑 收藏 引用 所属分类: ACM ( 数论 ...

  3. 卡特兰数(Catalan)简介

    Catalan序列是一个整数序列,其通项公式是 h(n)=C(2n,n)/(n+1) (n=0,1,2,...) 其前几项为 : 1, 1, 2, 5, 14, 42, 132, 429, 1430, ...

  4. 【集训笔记】【大数模板】特殊的数 【Catalan数】【HDOJ1133【HDOJ1134【HDOJ1130

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3324 http://blog.csdn.net/xymscau/artic ...

  5. Awesome Reinforcement Learning

    Awesome Reinforcement Learning A curated list of resources dedicated to reinforcement learning. We h ...

  6. mit课程ocw-mathematics

    https://ocw.mit.edu/courses/find-by-topic/#cat=mathematics Course # Course Title Level 1.010 Uncerta ...

  7. Introduction to Machine Learning

    Chapter 1 Introduction 1.1 What Is Machine Learning? To solve a problem on a computer, we need an al ...

  8. ESL翻译:Linear Methods for Regression

    chapter 3: Linear Methods for Regression 第3章:回归的线性方法 3.1 Introduction A linear regression model assu ...

  9. 游戏人工智能 读书笔记 (四) AI算法简介——Ad-Hoc 行为编程

    本文内容包含以下章节: Chapter 2 AI Methods Chapter 2.1 General Notes 本书英文版: Artificial Intelligence and Games ...

随机推荐

  1. git 修改commit 的注释

    git 修改commit 的注释 一:最新的一次提交 当你不小心,写错了提交的注视/信息,该如何处理呢.理论上,SCM是不应该修改历史的信息的,提交的注释也是.    不过在git中,其commit提 ...

  2. 第十六篇、OC_按比例适配

    // 屏幕高度 #define XMGHeight [UIScreen mainScreen].bounds.size.height // 屏幕宽度 #define XMGWidth [UIScree ...

  3. C++ 学习笔记 (八)重载 重写 重定义以及名字覆盖

    学习C++必定会遇到重载.重写.重定义.概念的东西多也是学习C++蛋疼之处,但是还是得弄懂,学懂了也就不觉得多了. 概念,特点: 重载: 直白点说就是函数名字相同,传参的个数,类型不一样.判断标准在于 ...

  4. 项目十八-Hadoop+Hbase分布式集群架构“完全篇”

    本文收录在Linux运维企业架构实战系列 前言:本篇博客是博主踩过无数坑,反复查阅资料,一步步搭建,操作完成后整理的个人心得,分享给大家~~~ 1.认识Hadoop和Hbase 1.1 hadoop简 ...

  5. 三、Linux 系统目录结构

    Linux 系统目录结构 登录系统后,在当前命令窗口下输入命令:  ls /  你会看到如下图所示: 树状目录结构: 以下是对这些目录的解释: /bin:bin是Binary的缩写, 这个目录存放着最 ...

  6. Cluster - 基本概念

    1.1 什么是集群 简单的说,集群(cluster)就是一组计算机,它们作为一个整体向用户提供一组网络资源.这些单个的计算机系统就是集群的节点(node).一个理想的集群是,用户从来不会意识到集群系统 ...

  7. 【PHP】什么时候使用Try Catch(转)

    几条建议: 如果无法处理某个异常,那就不要捕获它.  如果捕获了一个异常,请不要胡乱处理它.  尽量在靠近异常被抛出的地方捕获异常.  在捕获异常的地方将它记录到日志中,除非您打算将它重新抛出.  按 ...

  8. Python知识点进阶——迭代器

    可迭代对象 可迭代对象可以简单的理解为用for循环遍历的,如list.tuple.dict.set.str 判断一个对象是否是迭代器: 可以将数据类型 和 是否为可迭代对象 比较来判断是否是可以迭代 ...

  9. SoapUI(一)之webservice测试

    webservice测试需要具备的条件: 1.了解业务需求:如从客户端发送一个post请求给服务器,服务器将响应传给客户端. 2.需要一个明确的wsdl地址: 如天气预报的接口链接:http://ww ...

  10. stm32 flash和sram

    FLASH是用来存储程序的,SRAM是用来存储程序运行中的中间变量