4 、计数原理 /Counting 4.1 基本计数原理 The Basic of Counting 4.2 包含与排斥原理 The Inclusion-Exclusion Principle 4.3 鸽洞原理 The Pigeonhole Principle4 、计数原理 /Counting 4.1 基本计数原理 The Basic of Counting 4.2 包含与排斥原理 The Inclusion-Exclusion Principle 4.3 鸽洞原理 The Pigeonhole Principle求和规则 /The Sum RuleIf a first task can be done in n ways and a second task in m ways, and if there these tasks cannot be done at the same time, then there are n+m ways to be either task.|A1 A2| = |A1| + |A2| 其中 A1 A2 = 求和规则 /The Sum RuleIf a first task can be done in n ways and a second task in m ways, and if there these tasks cannot be done at the same time, then there are n+m ways to be either task.|A1 A2| = |A1| + |A2| 其中 A1 A2 = 例 3 单循环程序例 3 单循环程序Example 1Example 1求和规则的推广|A1 A2 … An | = |A1| + |A2| +… + |An| 其中 A i A j = ij, i,j =1,2,…,n求和规则的推广|A1 A2 … An | = |A1| + |A2| +… + |An| 其中 A i A j = ij, i,j =1,2,…,n求积规则 /The Product RuleSuppose that a procedure can be broken down into two tasks. If there are n ways to do the first task and m ways to do the second task after the first task has been done, then there are nm ways to do the procedure. |A1 A2 | = |A1| |A2|求积规则 /The Product RuleSuppose that a procedure can be broken down into two tasks. If there are n ways to do the first task and m ways to do the second task after the first task has been done, then there are nm ways to do the procedure. |A1 A2 | = |A1| |A2|How many functions are there from a set with m elements to one with n elements ?How many functions are there from a set w...