0% found this document useful (0 votes)
8 views21 pages

Chap 2

Chapter 2 covers basic structures in mathematics, including sets, functions, sequences, and summations. It defines key concepts such as sets, operations on sets, functions and their properties, and the nature of sequences and countability. The chapter also includes examples and exercises to reinforce understanding of these concepts.

Uploaded by

xddoraxddd
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)
8 views21 pages

Chap 2

Chapter 2 covers basic structures in mathematics, including sets, functions, sequences, and summations. It defines key concepts such as sets, operations on sets, functions and their properties, and the nature of sequences and countability. The chapter also includes examples and exercises to reinforce understanding of these concepts.

Uploaded by

xddoraxddd
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/ 21

Chapter 2 Basic Structures: Sets, Functions, Sequences, and

Sums
2.1 Sets
Sets are used to group objects together.

DEFINITION 1: A set is an unordered collection of objects.


DEFINITION 2: The objects in a set are called elements, or members, of the
set A. A set is said to contain its elements.
元素 分隔線 特性、範圍
Example 4

Universal set U is represented by a rectangle.

FIGURE 1 Venn Diagram (維恩圖) for the Set of Vowels (母音)

The empty set  (= { })  {} (仍有一元素 ,singleton set)

2-1
FIGURE 2 Venn Diagram Showing that A Is a Subset of B.

DEFINITION 5: S is a set. If there are exactly n distinct elements in S


where n is a nonnegative integer. Then n is the cardinality of S (|S|).
(cardinality: 元素個數)

DEFINITION 7: The power set of S is the set of all subsets of the set S
(denoted P(S)). (包含 空集合 與 自己本身)

(power set: 所有子集的集合,n elements power set has 2n elements)

P() = {} ; P({}) = {, {}}(  : 看成有一個 folder 但沒有資料)

Cartesian Products (笛卡爾積)

: ordered collections. (排序集合) 兩集合間對應關係

2-2
Example 16 What is the Cartesian product of A={1, 2} and B={a, b, c}
Sol: A x B ={(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}

Truth sets of quantifiers


Combine the predicate logic P and set theory a domain D. The truth set of P
to be the set of elements x in D for which P(x) is true.
(讓 P(x)為真 的所有 x 集合).

Example 20 The domain is the set of integers, and P(x) is “|x| = 1”;
Q(x) is “x2 = 2,” and R(x) is “|x| = x.”
Sol: Truth set of P = {1, -1}; Q(x) = ; R(x) = N(自然數)

EXERCISES (p. 119 ~ 121): 1, 3, 5, 7, 13, 17, 19, 31, 35

2-3
2.2 Set Operations
DEFINITION 1: The union (聯集) of two sets A and B, denoted by A∪B, is
the set containing those elements either in A or B.

FIGURE 1 Venn Diagram Representing the Union of A and B.

DEFINITION 2: The intersection (交集) of two sets A and B, denoted by


A∩B, the set containing those elements in both A and B.

FIGURE 2 Venn Diagram Representing the Intersection of A and B

DEFINITION 3: Two sets are called disjoint if their intersection is the empty
set. (不相交)

集合元素個數:

2-4
DEFINITION 4: The difference (差集) of A and B, denoted by A – B, is the
set containing those elements are in A but not in B. (also
called the completement of B with respect to A)

FIGURE 3 Venn Diagram for the Difference of A and B

DEFINITION 5: The complete of set A, denoted by A (U – A).

FIGURE 4 Venn Diagram for the Complement of the Set A.

2-5
De Morgan law: (類似 邏輯運算,AND(交集) 改為 OR(聯集),反之亦然)

2-6
n
A1  A2  ... An   Ai
i 1

n
A1  A2  ... An   Ai
i 1

2-7
(用 bit 0, 1 代表該位置 (集合)是否存有此 data,此結果與將 1, 0 看成真、假,

交集看成 AND,聯集看成 OR,跟邏輯變數一樣)

FIGURE 5 The Union and Intersection of A, B, and C.

Computer Representation of Sets


We can use 1 or 0 to represent an element in the set.

Example 18 U={1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Then the odd integers in


U={1, 3, 5, 7, 9}. It can be represented by bit string: 10 10 10 10 10

EXERCISES (p. 130 ~ 132): 1, 3, 9, 15, 25, 27, 37, 43, 45, 51, 59

2-8
2.3 Functions (也稱為 mapping or transformations)

(一個輸入 產生 一個輸出,所以,一個對應到兩個就不是 function)

函數 f : domain(定義域) -> codomain(range、值域)

FIGURE 1 Assignment of Grades in a Discrete Mathematics Class.

FIGURE 2 The Function f Maps A to B.


Example 5 Programming language: function floor(x: real) : integer

2-9
Sol: Domain= the set of real numbers; codomain= integers

Example 7 A={a, b, c, d, e} and B={1, 2, 3, 4} with f(a)=2, f(b)=1, f(c)=4,


f(d)= 1, f(e)=1. Find the image of the subset S={b, c, d}.
Sol: f(S) = {1, 4}

One-to-one (一對一) and onto (完整涵蓋) functions

(每一元素 對應到 不同元素)


Example 9 Determine function f(x) = x2 from the set of integers to integers
is one-to-one. (是否為一對一 ?)

Sol: f(1) = f(-1) = 1, but 1  -1, is not one-to-one.

2-10
FIGURE 3 A One-to-One Function.

(遞增 或 遞減函數並非 one-to-one (因為有 “等號”),但嚴格遞增(減)則是)

FIGURE 4 An Onto Function.

(一對一全對應:一對一且完整涵蓋)

2-11
報告中,參考文獻

FIGURE 5 Examples of Different Types of Correspondences.

Inverse function (反函數) and compositions of functions (複合函數)

-1
FIGURE 6 The Function f Is the Inverse of Function f.
The one-to-one correspondence is called invertible.

Example 17 Let f: Z -> Z be such that f(x) = x+1. Is f invertible, and if it is,
what is its inverse?
Sol: Let y=f(x) = x+1, then x = y-1. This means that y-1 is the unique element
of Z. Consequently, f -1(y) = x = y-1.

2-12
Composition:

FIGURE 7 The Composition of the Functions f and g.


Example 21 f(x) = 2x+3 and g(x) = 3x+2. What is the composition of f
and g? What is the composition of g and f ?
Sol: f  g = f(g(x)) = f(3x+2) = 2(3x+2) + 3 = 6x + 7
and
g  f = g(f(x)) = g(2x+3) = 3(2x+3) + 2 = 6x + 11

Example:

2-13
FIGURE 8 The Graph of f(n) = 2n + 1 from Z to Z.

FIGURE 9 The Graph of f(x) = x2 from Z to Z.

DEFINITION 12. The floor function x assigns the real number x to the
largest integer that is less than or equal to x,

2-14
the ceiling function x assigns the real number x to the smallest integer
that is greater than or equal to x.

x x
FIGURE 10 Graphs of the (a) Floor and (b) Ceiling Functions.
1  1   1  1
Example 24  2   0,  2   1, -
 2   1, - 2   0, 3.1  3, 3.1  4,

7  7, 7  7

≤ +
≤ 符號訂正:
≤ :  , : +
≤ +

+
+
+
EXERCISES (p. 146 ~ 149): 3, 7, 9, 15, 19, 27, 31, 39, 55, 57, 65, 73

2-15
2.4 Sequences (序列) and Summations
When the elements of an infinite set can be listed, the set is countable. So, the
set of rational number is countable, but the set of real numbers is not.
DEFINITION 1: A sequence is a function from a subset of the set of integers
to a set S. We use an to denote a term of sequence.

(Def 2: 等比 級數(幾何級數))

(Def 3: 等差 級數(數學級數))
Summations:

2-16
(see p.19 Example 18)

2-17
Pf:

Example 13

Example 15

100  101  201 49  50  99


=   297,925
6 6

2-18
Example 16
( |x| < 1 )

Example 17
(由上例得)

微分
Example 18. From Example 17 (differentiation (微分)):
1
 (1  x) 1
(1  x)
微分 (1 - x) -1  (1)(1  x)  2 (1)
 (1 - x) -2

Cardinality(元素個數)

FIGURE 1 A One-to-One Correspondence Between Z+ (正整數) and the

Set of Odd Positive Integers (正奇數).

2-19
(一個集合若為: 有限集合 或 與正整數集合有相同個數(infinite),則為
countable)

Example 20 The set of positive rational numbers (正有理數) is countable

Sol: 正有理數: p / q : first row q =1 (first column p =1)

Second row q =2 (second column p =2), … 可對應所有

正有理數

FIGURE 2 The Positive Rational Numbers Are Countable.


(正有理數與自然數對應,對應:1->1/1, 2 ->1/2, 3->2/1, 4-> 1/3, 5 ->2/2, 6->3/1,

7->1/4, 8->2/3, 9->3/2, 10->4/1, 11->1/5, … ,第一組 1 個,第 2 組 2 個(從 1/2

開始),第 3 組 3 個(從 1/3 開始), … 第 k 組 k 個(從 1/k 開始),所以,求

2-20
1000 對應到何數? 解法: 1 + 2 + … + k  1000, k=44,

所以 1 + 2 + … + 44 = 990,1000 – 990 = 10, 得 k=45 的第 10 個,1/45,


2/44, …, 10/36, ANS =10/36)
(若排序為上圖 2,答案為 36/10。奇數組: 分母從 1 開始,偶數組:分子

從 1 開始。K=45(奇數組),第 10 個 = 36/10 ,和 = 46)

(The set of real numbers is an uncountable set (Example 21 證明參閱課本))


EXERCISES (p. 160 ~ 163): 1, 3, 5, 9, 13, 17, 21, 23, 31, 43

2-21

You might also like