Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Mathematics Chapter 2 Basic Structures : Sets, Functions, Sequences, and Sums 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)

Similar presentations


Presentation on theme: "Discrete Mathematics Chapter 2 Basic Structures : Sets, Functions, Sequences, and Sums 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)"— Presentation transcript:

1 Discrete Mathematics Chapter 2 Basic Structures : Sets, Functions, Sequences, and Sums 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)

2 2-1 Sets Def 1 : A set is an unordered collection of objects. Def 2 : The objects in a set are called the elements, or members of the set. Example 5 : 常見的重要集合  N = { 0,1,2,3,…}, the set of natural number ( 自然數 )  Z = { …,-2,-1,0,1,2,…}, the set of integers ( 整數 )  Z + = { 1,2,3,…}, the set of positive integers ( 正整數 )  Q = { p / q | p ∈ Z, q ∈ Z, q≠0 }, the set of rational numbers ( 有理數 )  R = the set of real numbers ( 實數 ) ( 元素可表示成 1.234 等小數形式 ) Ch2-2

3 Def 4 : A ⊆ B iff ∀ x, x ∈ A → x ∈ B 補充: A ⊂ B 表示 A ⊆ B 但 A ≠ B Def 5 : S : a finite set The cardinality of S, denoted by |S|, is the number of elements in S. Def 7 : S : a set The power set of S, denoted by P(S), is the set of all subsets of S. Example 13 : S = {0,1,2} P(S) = { , {0}, {1}, {2}, {0,1}, {0,2}, {1,2}, {0,1,2} } Def 8 : A, B : sets The Cartesian Product of A and B, denoted by A x B, is the set A x B = { (a,b) | a ∈ A and b ∈ B } Ch2-3

4 Note. |A x B| = |A| . |B| Example 16 : A = {1,2}, B = {a, b, c} A x B = {(1,a), (1,b), (1,c), (2,a), (2,b), (2,c)} Exercise : 5, 7, 8, 17, 21, 23 Ch2-4

5 2-2 Set Operations Def 1,2,4 : A,B : sets  A ∪ B = { x | x  A or x  B } (union)  A∩B = { x | x  A and x  B } (intersection)  A – B = { x | x  A and x  B } ( 也常寫成 A \ B) Def 3 : Two sets A,B are disjoint if A∩B =  Def 5 : Let U be the universal set. The complement of the set A, denoted by A, is the set U – A. Example 10 : Prove that A∩B = A ∪ B pf : 稱為 Venn Diagram Ch2-5

6 Def 6 : A 1, A 2, …, A n : sets Let I = {1,3,5}, Def : (p.131 右邊 ) A,B : sets The symmetric difference of A and B, denoted by A ⊕ B, is the set { x | x  A  B or x  B  A } = ( A ∪ B )  ( A ∩B ) ※ Inclusion – Exclusion Principle ( 排容原理 ) |A ∪ B| = |A| + |B|  |A ∩ B| Exercise : 14, 45 Ch2-6

7 2-3 Functions Def 1 : A,B : sets A function f : A → B is an assignment of exactly one element of B to each element of A. We write f (a) = b if b is the unique element of B assigned by f to a ∈ A. eg. Ch2-7 ABAB 1 2 3 1 2 α β γ α β γ Not a function

8 Def : ( 以 f : A→B 為例,右上圖 ) f (α) = 1, f (β) = 4, f (γ) = 2 1 稱為 α 的 image (unique), α 稱為 1 的 pre-image(not unique) A : domain of f, B : codomain of f range of f = { f (a) | a ∈ A} = f (A) = {1,2,4} ( 未必 =B) Example 4 : f : Z → Z, f (x) = x 2, 則 f 的 domain, codomain 及 range? Ch2-8 AB 1 2 α β γ AB 1 2 3 α β γ 4 a function

9 Example 6 : Let f 1 : R → R and f 2 : R → R s.t. f 1 (x) = x 2, f 2 (x) = x  x 2, What are the function f 1 + f 2 and f 1 f 2 ? Sol : ( f 1 + f 2 )(x) = f 1 (x) + f 2 (x) = x 2 + ( x – x 2 ) = x ( f 1 f 2 )(x) = f 1 (x) . f 2 (x) = x 2 ( x – x 2 ) = x 3 – x 4 Def 5: A function f is said to be one-to-one, or injective, iff f (x) ≠ f (y) whenever x ≠ y. Example 8 : Ch2-9 AB 1 2 a b c AB 1 2 a b c d 4 5 3 d 3 4 5 is 1-1 not 1-1, 因 g (a) = g (d) = 4 f g

10 Example 10 : Determine whether the function f (x) = x + 1 is one-to-one ? Sol : x ≠ y  x + 1 ≠ y + 1  f (x) ≠ f (y) ∴ f is 1-1 Def 7 : A function f : A → B is called onto, or surjective, iff for every element b ∈ B, ∃ a ∈ A with f (a) = b. ( 即 B 的所有 元素都被 f 對應到 ) Example 11 : Ch2-10 Note : 當 |A| < |B| 時, 必定不會 onto. onto a b c d 2 3 1 f not onto AB a b c 1 2 3 4 f

11 Def 8 : The function f is a one-to-one correspondence, or a bijection, if it is both 1-1 and onto. Examples in Fig 5 ※補充 : f : A →B (1) If f is 1-1, then |A| ≤ |B| (2) If f is onto, then |A| ≥ |B| (3) if f is 1-1 and onto, then |A| = |B|. Ch2-11 1-1, not onto a b c 2 3 1 4 not 1-1, onto a b c 1 2 3 d 1-1 and onto a b c d 2 3 1 4

12 ※ Some important functions Def 12 :  floor function : x : ≤ x 的最大整數,即 [ x ]  ceiling function : x : ≥ x 的最小整數. Example 24 : ½ = -½ = 7 = Example 29 :  factorial function : f : N → Z +, f ( n ) = n ! = 1 x 2 x … x n Exercise : 1,12,17,19 Ch2-12

13 2.4 Sequences and Summations ※ Sequence ( 數列 ) Def 1. A sequence is a function f from A  Z + (or A  N ) to a set S. We use a n to denote f ( n ), and call a n a term ( 項 ) of the sequence. Example 1. {a n }, where a n = 1/n, n  Z +  a 1 =1, a 2 =1/2, a 3 =1/3, … Example 2. {b n }, where b n = (  1) n, n  N  b 0 = 1, b 1 =  1, b 2 = 1, … Ch2-13

14 Example 7. How can we produce the terms of a sequence if the first 10 terms are 5, 11, 17, 23, 29, 35,41, 47, 53, 59 ? Sol : a 1 = 5 a 2 =11 = 5 + 6 a 3 =17 = 11 + 6 = 5 + 6  2 : :  a n = 5 + 6  (n  1) = 6n  1 Ch2-14

15 Example 8. Conjecture a simple formula for a n if the first 10 terms of the sequence {a n } are 1, 7, 25, 79, 241, 727, 2185, 6559, 19681, 59047 ? Sol : 顯然非等差數列 後項除以前項的值接近 3  猜測數列為 3 n  … 比較: {3 n } : 3, 9, 27, 81, 243, 729, 2187,… {a n } : 1, 7, 25, 79, 241, 727, 2185,…  a n = 3 n  2, n  1 Ch2-15

16  Summations Here, the variable j is call the index of summation, m is the lower limit, and n is the upper limit. Ch2-16 Example 10. Example 13. (Double summation)

17 Example 14. Table 2. Some useful summation formulae Ch2-17

18  Cardinality Def 4. The sets A and B have the same cardinality (size) if and only if there is a one-to-one correspondence (1-1 and onto function) from A to B. Def 5. A set that is either finite or has the same cardinality as Z + (or N) is called countable ( 可數 ). A set that is not countable is called uncountable. Ch2-18

19 Ch2-19 Example 18. Show that the set of odd positive integers is a countable set. Pf: (Figure 1) Z + : 1 2 3 4 5 6 7 8 … …… { 正奇數 } : 1 3 5 7 9 11 13 15 … f : Z +  {all positive integers} f ( n) = 2n – 1 is 1-1 & onto.

20 Example 19. Show that the set of positive rational number (Q + ) is countable. Ch2-20 ∴ Z + : 1, 2, 3, 4, 5, 6, 7, 8, 9 … Q + : ( 注意,因 等於 ,故 不算 ) ※ Note. R is uncountable. (Example 21) Exercise : 9,13,17,42 Pf: Q + = { a / b | a, b  Z + } (Figure 2) 1 1


Download ppt "Discrete Mathematics Chapter 2 Basic Structures : Sets, Functions, Sequences, and Sums 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)"

Similar presentations


Ads by Google