Chapter2.pptxChapter2
Chapter2.pptxChapter2
1
Chapter Outline
• Sets
• The Language of Sets
• Set Operations
• Set Identities
• Functions
• Types of Functions
• Operations on Functions
• Computability
• Sequences and Summations
• Types of Sequences
• Summation Formulae
• Set Cardinality
• Countable Sets
2
Sets
Section 2.1
3
集合论
• 集合是最基本的离散结构,所有其他离散结构都建立在集合之上。
• 集合论是一个数学分支,其基本概念已渗透到数学的几乎所有领域,常被视为数学基础之一,特别是 ZFC
集合论。
• 集合论的两种体系
• 朴素集合论
• 公理集合论
• 朴素集合论中,集合的直觉定义的使用导致了悖论,在公理集合论中不存在。
4
Sets 集合
A.
• If a is not a member of A, write a ∉ A
5
Describing a Set: Roster Method 花名册方法
• S = {a,b,c,d}
S = {a,b,c,d} = {b,c,a,d}
• Order not important
• Each distinct object is either a member or not; listing more than once does
S = {a,b,c,d} = {a,b,c,b,c,d}
not change the set.
• Elipses (…) may be used to describe a set without listing all of the members
when the pattern is clear.
S = {a,b,c,d, ……,z }
V = {a,e,i,o,u}
• Set of all vowels in the English alphabet:
{{1,2,3},a, {b,c}}
• Sets can be elements of sets.
{N,Z,Q,R}
7
Some Important Sets
8
Set-Builder Notation 集合构造器符号
S = {x | P(x)}
• A predicate may be used:
• Example: S = {x | Prime(x)}
9
Interval Notation 区间符号
[a,b] = {x | a ≤ x ≤ b}
[a,b) = {x | a ≤ x < b}
(a,b] = {x | a < x ≤ b}
(a,b) = {x | a < x < b}
10
Universal Set and Empty Set 全集 与 空集
11
Set Equality 集合的相等
Definition: Two sets are equal if and only if they have the
same elements.
• Therefore if A and B are sets, then A and B are equal if and
only if
{1,3,5} = {3, 5, 1}
• We write A = B if A and B are equal sets.
{1,5,5,5,3,3,1} = {1,3,5}
12
Subsets 子集合
set B.
• A ⊆ B holds if and only if
1. Because a ∈ ∅ is always false, ∅ ⊆ S ,for every set S.
is true.
13
Another look at Equality of Sets
• 证明两个集合 A 和 B 相等,可以通过证明 A ⊆ B 且 B ⊆ A 。
•
14
Proper Subsets 真子集
is true.
文氏图
Venn Diagram
B
U
A
15
Set Cardinality 集合的基数
1. |ø| = 0
Examples:
set is 2ⁿ.
• If a set has n elements, then the cardinality of the power
17
Tuples 元组
• The ordered pairs (a,b) and (c,d) are equal if and only if a
= c and b = d.
18
Cartesian Product 笛卡尔积
Example:
A = {a,b} B = {1,2,3}
A × B = {(a,1),(a,2),(a,3), (b,1),(b,2),(b,3)}
9. )
from the set A to the set B. (Relations will be covered in depth in Chapter
19
Cartesian Product
• 这是常用的表达集合的方法。
21
Set Operations
集合运算
Section 2.2
22
Union 集合的并
当我们讨论集合运算的时候,必须有全集 U ,
U
且 U 一般是显而易见的 .
A B
23
Intersection 集合的交
by A ∩ B, is
• Definition: The intersection 交集 of sets A and B, denoted
{1,2,3} ∩ {4,5,6} ?
• Example:What is?
U
Solution: ∅ A B
24
Difference 集合的差
A – B = {x | x ∈ A x ∉ B} = A ∩B
called the complement of B with respect to A.
25
Complement 集合的补
Ā = {x ∈ U | x ∉ A}
(The complement of A is sometimes denoted by Ac .)
26
容斥原理初探
|A ∪ B| = |A| + | B| − |A ∩ B|
• Inclusion-Exclusion U
A B
27
Review Questions
2. A ∩ B
Solution: {1,2,3,4,5,6,7,8}
Solution: {4,5}
3. Ā
4.
Solution: {0,6,7,8,9,10}
5. A – B
Solution: {0,1,2,3,9,10}
6. B – A
Solution: {1,2,3}
Solution: {6,7,8}
28
Symmetric Difference (*) 集合的对称差
U = {0,1,2,3,4,5,6,7,8,9,10}
Example:
A = {1,2,3,4,5} B ={4,5,6,7,8}
What is : U
• Solution: {1,2,3,6,7,8}
A B
Venn Diagram
29
Set Identities 集合恒等式
• Complementation law
32
Proving Set Identities
33
Proving Set Identities
Example:
34
Membership Table 成员表
Solution:
A B C
1 1 1 1 1 1 1 1
1 1 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 0 0 0 1 1 1 1
0 1 1 1 1 1 1 1
0 1 0 0 0 1 0 0
0 0 1 0 0 0 1 0
0 0 0 0 0 0 0 0
35
Generalized Unions and Intersections
36
Computer Representation of Sets 集合的计算机表示
37
Functions 函数
Section 2.3
38
Functions
called mappings 映射 or
Students
A
transformations 变换 .
Carlota Rodriguez
B
Sandeep Patel C
Jalen Williams D
F
Kathy Scott 39
Functions
and
40
Functions
Given a function f: A → B:
• A is called the domain 定义域 of f.
• B is called the codomain 陪域 of f.
• 函数相等: Two functions are equal when they have the same
under f. We denote it by f(A).
A B
a
f {a,b,c,} is ? {y,z} x
b
y
f {c,d} is ? {z}
c
d z
42
Representing Functions
f(x) = x + 1
• A formula.
• A computer program.
• A Java program that when given an integer n, produces the nth
• 图像
Fibonacci Number
43
Injections 单射
A B
a x
v
b
y
c
z
d
w 44
Surjections 满射
A B
a x
b y
c
d z
45
Bijections 双射
Aa Bx
b
y
c
d z
w
46
Inverse Functions 反函数
47
Inverse Functions
f
A B A B
V a V
a
b
b W
W
c
c
d X
d X
Y
Y 48
Inverse Functions
f-1 (y) = y – 1.
Solution:
and The
if so, function
what f isinverse?
is its invertible because it is a one-to-one correspondence.
50
Composition
g f
A B C A C
a V a
h
h
b i b
W
c i
j c
d X
d j
Y
51
Composition
52
Graphs of Functions 函数的图
f(a) = b}.
Example:
54
Floor and Ceiling Functions
55
Floor and Ceiling Functions
Case 2: ε≥½
Examples:
f(1) = 1! = 1
f(2) = 2! = 1 ∙ 2 = 2
Stirling’s Formula:
f(6) = 6! = 1 ∙ 2 ∙ 3∙ 4∙ 5 ∙ 6 = 720
f(20) = 2,432,902,008,176,640,000.
57
Partial Functions 部分函数
• 往往是为了使用的方便引入部分函数。
• We may want to use such notions as the “youngest child” function,
which is undefined for a couple having no children.
58
Sequences and Summations
序列与求和
Section 2.4
59
Sequences 序列
2, 3, 4, ….} ) to a set S.
• The notation an is used to denote the image of the
integer n. We can think of an as the equivalent of f(n)
60
Sequences
61
Geometric Progression 几何级数
Let a = −1 and d = 4:
Examples:
Let a = 1 and d = 2:
63
Recurrence Relations 递推关系
64
Recurrence Relations 递推关系
a1 = a0 + 3 = 2 + 3 = 5
Solution: We see from the recurrence relation that
a2 = 5 + 3 = 8
a3 = 8 + 3 = 11
65
Recurrence Relations
66
Fibonacci Sequence 斐波那契数列
f2 = f1 + f0 = 1 + 0 = 1 ,
Answer:
f3 = f2 + f1 = 1 + 1 = 2 ,
f4 = f3 + f2 = 2 + 1 = 3 ,
f5 = f4 + f3 = 3 + 2 = 5 ,
f6 = f5 + f4 = 5 + 3 = 8 .
67
Solving Recurrence Relations 求解递推关系
68
Iterative Solution 迭代法
69
Iterative Solution
Let {an} be a sequence that satisfies the recurrence relation an = an-1 + 3 for n =
2,3,4,…. and suppose that a1 = 2.
an = an-1 + 3
= (an-2 + 3) + 3 = an-2 + 3 ∙ 2
= (an-3 + 3 )+ 3 ∙ 2 = an-3 + 3 ∙ 3
.
.
.
70
Guess Sequences
71
Useful Sequences
采用了奥卡姆剃刀原则:
如无必要,勿增实体。
72
Guessing Sequences
73
Guessing Sequences
• 1, 0, 1, 0, 1, 0,…
74
Integer Sequences
75
Summations 求和
• The notation:
represents
76
Summations
• Examples:
77
Product Notation (optional)
• The notation:
represents
78
Some Useful Summation Formulae
79
Geometric Series
80
81
Double Summations
可以变换求和顺序
82
Infinite Series 无限级数
83
Infinite Series 无限级数
• 无限级数 =?
• 无限级数的收敛与绝对收敛。
• -- 《》
84
Cardinality of Sets
集合的基数
Section 2.5
85
Cardinality
|A| ≤ |B|.
to B, the cardinality of A is less than or the same as the
• 一般地,当我们说一个集合是可数的,我们指的是可数无限的。对于有限的情况,我们一般说集合是有限的。
87
两种无限集
• 无限集分为两种,可数无限集(和自然数集合具有相同基数)和不可数集。
88
Hilbert’s Grand Hotel
希尔伯特大饭店
某些对有限集不可能的事情对无限集变得可能。
The Grand Hotel (example due to David Hilbert) has countably
infinite number of rooms, each occupied by a guest. We can
always accommodate a new guest at this hotel. How is this
possible?
2 4 6 8 10 12 ……
Then f is a bijection from N to E since f is both one-to-one
90
Showing that a Set is Countable
0, 1, − 1, 2, − 2, 3, − 3 ,………..
Solution: Can list in a sequence:
f(n) = −(n−1)/2
• When n is even: f(n) = n/2
• When n is odd:
91
The Positive Rational Numbers are Countable
有理数集是可数集
And so on.
1, ½, 2, 3, 1/3,1/4, 2/3, ….
92
Strings 有限字母表下的字符串集是可数集
4. And so on.
This implies a bijection from N to S and hence it is a
countably infinite set.
93
The set of all Java programs is countable.
94
The Real Numbers are Uncountable 实数集是不可数集
1. Suppose R is countable. Then the real numbers between 0 and 1 are also countable.
proof by contradiction. 归谬法
Hence, all the real numbers between 0 and 1 cannot be listed, so the set of real
numbers between 0 and 1 is uncountable. So the set of real numbers is
6.
uncountable.
95
康托尔定理( * )
• 无穷集有着不同的数量级,有不同的层次,而且是无穷多个层次!
• 热闹的无限王国。
96
97
Computability 可计算性
• 在 ZFC 公理集合论下,连续统假设不能证明也不能证伪。
99