Discrete Mathematics -- Chapter 1: Fundamental Ch t 1 F d t l Principles of Counting Hung-Yu Kao ( 高宏宇 ) Department of Computer Science and Information Engineering, N National Cheng Kung University l Ch K U
Outline � Preface & Introduction � Sum & Product � Permutations � Combinations: The Binomial Theorem ( 二項式定 理 ) � Combinations: The Binomial Theorem ( 二項式定 理 ) � Combinations with Repetition � The Catalan Numbers Th C t l N b � Summary 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 2
Take a look … 1 * 8 + 1 = 9 12 * 8 + 2 = 98 12 8 + 2 = 98 123 * 8 + 3 = 987 1234 * 8 + 4 = 9876 12345 * 8 + 5 = 98765 12345 8 5 98765 123456 * 8 + 6 = 987654 Theorem is art, art is theorem. 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 3
What is Discrete Mathematics? � 數 學的幾個分支的總稱,以研究 離 散 量 的結構和相互 間的關係為主要目標 � 研究對象 : 一般地是有限個或可 數 無窮個元素 研究對象 一般地是有限個或可 數 無窮個元素 � 內容包含: 數理邏 輯、集合 論 、代 數 結構、圖 論 、組合學、 數論 等。 (Wikipedia) (Wikipedia) 數論 等 � 研究有 離 散結構的系統的學科 � e.g, 班級人 數 , 課程安排 , 水 , g, , , , � 離 散 v.s. 連 續 � 描述 了 電腦科學 離 散性的特點 � 基礎核心部分 : 組合學(計 數 、排 列 、組合結構的分 析)和圖 論 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 4
Counting � Capable of solving difficult problems. � Coding theory, probability and statistics � Help the analysis and design of efficient algorithms. Help the analysis and design of efficient algorithms. � E.g., + + + + = 1 1 2 2 3 3 ? ? × 3 4 = = ? ? 2 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 5
Counting Example 1 � How many rectangles in this graph? ⎛ ⎞ ⎛ ⎞ 4 6 = ⎜ ⎟ ⎜ ⎟ − Ans * # squares ⎜ ⎟ ⎜ ⎟ 2 2 ⎝ ⎠ ⎝ ⎠ 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 6
Counting Example 2 � Fibonacci Sequence � By Fibonacci an mathematician in the 13th century � By Fibonacci, an mathematician in the 13th century � Counting rabbits � rules: � rules: How many rabbits after some period of time ? How many rabbits after some period of time ? 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 7
The Fibonacci Sequence 1 pair 1 pair p 1 pair 1 pair p 2 pairs 2 pairs p 3 pairs 3 pairs p 5 pairs 5 pairs p 8 pairs 8 pairs p F 1 F 2 F 3 F 4 F 5 F 6 2009 Spring 2009 Spring Discrete Mathematics – Discrete Mathematics – Ch 1 Ch 1 8
The Fibonacci Sequence � F n represents the number of rabbits in period n n n ⎛ + ⎞ ⎛ − ⎞ � F = F � F n = F n-1 + F n-2 + F 1 1 5 1 1 5 ⎜ ⎜ ⎜ ⎜ = = − − 用無 理數 算出自然 數 ! 用無 理數 算出自然 數 ! ⎜ ⎜ ⎜ ⎜ 2 2 5 5 ⎝ ⎠ ⎝ ⎠ � F n-1 : the number of adult rabbits at time period n = the number of rabbits (adult and baby) in the previous the number of rabbits (adult and baby) in the previous time period � F � F n-2 : the number of baby rabbits at time period n = the th b f b b t ti i d th bbit number of adult rabbits in F n-1 , which is F n-2 Q: can you model the rabbit number if the adult rabbit will die : can you model the rabbit number if the adult rabbit will die after m periods when they create a new pair of rabbits ? after m periods when they create a new pair of rabbits ? e.g., Fn = Fn e.g., Fn = Fn- -1 when m=1 1 when m=1 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 9
Counting Example 3 � 假設有 n 個人。從中挑選 若 干人(任意 數量 ) 出 來 。將挑選出 來 的人分成 若 干(任意 數量 ) 出 來 將挑選出 來 的人分成 若 干(任意 數量 ) 組。將任意一個這樣分出 來 的組稱之為一個 “系統"。那麼一共可以有多少個 兩兩不 同的 系統 那麼一共可以有多少個 兩兩不 同的 系統呢 ? 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 10
1.1 The Rules of Sum and Product � The Rule of Sum Th R l f S If a first task can be performed in m ways, while a second task can be � performed in n ways, and the two tasks cannot be performed simultaneously, then performing either task can be accomplished in any one of m+n ways. The Rule of Product � If a procedure can be broken down into first and second stages, and if � there are m possible outcomes for the first stage and if for each of these there are m possible outcomes for the first stage and if, for each of these outcomes, there are n possible outcomes for the second stage, then the total procedure can be carried out, in the designated order, in mn ways. � Ex 1.6 : If a license plate consists of two letters followed by four digits, how many different plates are there? 26 × 26 × 10 × 10 × 10 × 10 Rule combination 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 11
1.2 Permutations � Permutation: counting linear arrangements of distinct objects � If there are n distinct objects and r is an integer, with 1 ≤ r ≤ n , then by the rule of product then by the rule of product , � The number of permutations of size r for the n objects is = − − ⋅ ⋅ ⋅ − + + P P ( ( n n , r r ) ) n n ( ( n n 1 1 )( )( n n 2 2 ) ) ( ( n n r r 1 1 ) ) − − − ⋅ ⋅ ⋅ ( n r )( n r 1 ) ( 3 )( 2 )( 1 ) = − − ⋅ ⋅ ⋅ − + × n ( n 1 )( n 2 ) ( n r 1 ) − − − ⋅ ⋅ ⋅ ( ( n n r r )( )( n n r r 1 1 ) ) ( ( 3 3 )( )( 2 2 )( )( 1 1 ) ) n factorial n ! = − ( n r )! � Ex 1.9 : Given 10 students, three are to be chosen and seated in a row. How many such linear arrangements are possible? 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 12
Permutations with Repeated Objects � If there are n objects with n 1 indistinguishable objects of a first type, n 2 indistinguishable objects of a second t type, …, and n r indistinguishable objects of an r th type, d i di ti i h bl bj t f th t where n 1 + n 2 +…+ n r = n. � the number of (linear) arrangements of the given n objects � the number of (linear) arrangements of the given n objects n ! = n ! n !... n ! 1 1 2 2 r r � Ex 1.13 : Arranging all of the letters in MASSASAUGA, we g g , 7 ! find there are possible arrangements, 10 ! 4 ! 3 ! 1 ! 1 ! 1 ! 3 ! 1 ! 1 ! 1 ! arrangements while all four A’s are together. t hil ll f A’ t th 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 13
Permutations with Repeated Objects � Ex 1.14 : Determine the number of (staircase) paths in the xy-plane from (1, 1) to (4, 3), where each such path is R 3 made up of individual steps U U R going one unit to the right or one unit upward. it d U U U U R R 1 � As for xyz-space, from (1,1,1) R R R to (4 3 2)? to (4, 3, 2)? 1 4 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 14
Permutations with Repeated Objects (Exercise in textbook P45) 11 ! a a ) ) 7 !* 4 ! 11 ! 4 ! 4 ! − b b ) ) * * 7 !* 4 ! 2 !* 2 ! 3 !* 1 ! 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 15
Combinatorial Proofs ( ( 2 2 k k )! )! � Prove that is an integer. k 2 � Consider 2 k symbols x 1 , x 1 , x 2 , x 2 ,…, x k , x k . � The number of ways they can be arranged is ( 2 k )! ( 2 k )! = k k ⋅ ⋅ ⋅ 2 ! 2 ! 2 ! 2 � It must be an integer. ( mk )! � Prove that is also an integer. k ( ( m m ) ! ! ) 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 16
Arrangement around a Circle � Consider n distinct objects � Two arrangements are considered the same when one can g be obtained from the other by rotation. � How many different circular arrangements? How many different circular arrangements? � Thinking distinct linear arrangements for 4 objects, e.g., ABCD, BCDA, CDAB, and … � So, the number of circular arrangements is? 4!/4 = 3! C A A B B D D B D D B A C C A A C D B 2009 Spring 2009 Spring Discrete Mathematics – Discrete Mathematics – Ch 1 Ch 1 17
Arrangement around a Circle � Ex 1.17 : arrange six people (3 males, 3 females) around the table so that the sexes alternate. around the table so that the sexes alternate. No constraint 6!/6 = 5! = 120 Sexes alternate 3 x 2 x 2 x 1 x 1 = 12 2009 Spring 2009 Spring Discrete Mathematics Discrete Mathematics – – Ch 1 Ch 1 18
Recommend
More recommend