版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Elements of Discrete Structures,Chapter 6: Counting (Part 2),1,The Pigeonhole Principle,2,Pigeonhole Principle: Let k and n be positive integers (n k), and we divide n balls among k boxes, then at least one box contains 2 balls,13 Pigeons, 12 Boxes,Generalized Pigeonhole Principle,Theorem: If we hav
2、e n k balls, k and n are positive integers, and we divide them among k boxes, then at least one box contains n/k balls Assume 10 boxes (k = 10). Number of balls n = 11 20, at least a box has 2 ballsNumber of balls n = 21 30, at least a box has 3 ballsNumber of balls n = 31 40, at least a box has 4 b
3、alls Example: In a group of 1,000 people there are at least 3 people who have their birthday on the same day. Why? This is because 1000/365 = 3,3,Generalized Pigeonhole Principle,Proof of the Generalized Pigeonhole Theorem: By contradiction: Assume none of the k boxes contains n/k balls. Then, each
4、box contains at most n/k 1 balls. So, n k(n/k 1). We know n/k n/k +1 (from the property: x x + 1). So, n k(n/k 1) k(n/k + 1 1) = n. Or, n n. Contradiction!,4,Pigeonhole Principle Example,We have 5 possible grades: A, B, C, D, and F. How many students do we need to have to be sure at least 6 students
5、 get the same grade? Boxes = grades = 5. Balls = students = n. Try to fill the boxes evenly: If we have 25 students, then we can evenly have 5 As, 5 Bs etc. So if we have 26 students, we need add a student to a grade which then has 6 students Formally, n/5 6. So, n 26,5,Pigeonhole Principle Example,
6、For every positive integer n, there is an integer m that is a multiple of n, and m consists of only the decimal digits of 0s and 1s To show this, we construct m from n + 1 numbers: 1, 11, 111, 1111, , 1111 (n+1 1s) Divide each by n and find the two numbers (a and b) that are congruent (mod n) (same
7、remainders) by Pigeonhole Principle (how?) Then n | a b ( assume a b). Definition of congruence. Let m = a b. m is a multiple of n and has only 1s & 0s,6,Pigeonhole Principle Example,Consider the case n = 3. Construct m from n + 1 = 4 integers as follows: 1, 11, 111, 1111 Divide each of them by n (3
8、) to get: 1 = 30 + 1, 11 = 33 + 2, 111 = 337 + 0, 1111 = 3370 + 1. In this case: 1 mod 3 = 1, 1111 mod 3 = 1. If we subtract these two integers we get a new integer that is divisible by n: m = 1111 1 = 1110 (= 3 370), which is a multiple of 3,7,Pigeonhole Principle Example,At a party of 6 people, ev
9、ery two people are either enemies or friends. Show that there are at least 3 mutual friends or 3 mutual enemies at the party,8,friends,friends,friends,enemies,enemies,enemies,OR,Pigeonhole Principle Example,Proof: Consider person A: A certainly has either 3 friends or 3 enemies at the party (Pigeonh
10、ole Principle: 5 people in 2 categories). Assume three of them are friends of A. If the three are mutual enemies then we have 3 mutual enemies and we are done. If not, then at least 2 are friends, but they are also As friends, which makes a group of three mutual friends. Similar proof for the case o
11、f three enemies,9,Workstation-Server Example,We connect 15 workstations to 10 servers. One server can only let one workstation use it to communicate at a time. We require that any 10 workstations can use the 10 servers at any time,10,Servers,Workstations,Workstation-Server Example,Claim: The minimal
12、 number of cables required to connect between workstations and servers is 60 Proof: By contradiction. Assume it is 59. Then one server S must connect to at most 5 workstations (59/10 = 5). This means that the remaining 10 workstations are not connected to S. So these 10 workstations can only communi
13、cate to at most 9 servers. It is a contradiction!,11,Permutations,r-permutation: An ordered arrangement of r elements of a set of n distinct elements, r n Example: S = 1, 2, 3, 4: 2134 is a permutation of S321 is a 3-permutation of S 32 is a 2-permutation of S Permutation Theorem: The number of r-pe
14、rmutations of n objects is: P(n, r) = n(n 1)(n 2).(n r+1) = First object can be chosen in n ways, second in (n 1) ways, ., r-th object in n r + 1 ways. Use product rule to get the above result When r = n, P(n, n) = n(n 1)(n 2).1 = n!,12,Permutation Examples,A mailman needs to bring 8 packages to 8 c
15、ities. He starts at city 1. How many ways are there to visit the remaining 7 cities? Pick second city among 7, 3rd among 6, 4th among 5, . Answer: 7! How many permutations of the letters “a, b, c, d, e, f, g, h” contain “abc” as a block. Rename “abc” to B. Now we have: how many permutations of B, d,
16、 e, f, g, h are there? Answer: 6!,13,Combinations,r-combination C(n, r): An unordered selection of r elements (or subset of size r) from a set of n elements. Example: S = 1, 2, 3, 4. Then 3, 2, 1 = 1, 2, 3 is a 3-combination. 1, 3, 4 is another and 1, 4 is a 2-combination Combination Theorem: The to
17、tal number of r-combinations of a set of size n, 0 r n, is given by,14,Combinations,Proof of combination theorem: P(n, r) counts the total number of ordered arrangements. However, the difference of C(n, r) is that it is only interested in unordered arrangements here. For every subset of r elements o
18、ne can exactly construct r! ordered arrangements in the permutation, everyone of which is included in P(n, r). These r! arrangements should be considered the same in C(n, r). We thus need to divide P(n, r) by r!,15,Combinations,Note that C(n, r) = C(n, n r). Its symmetricThis is because Also,16,Comb
19、ination Example,How many poker hands of five cards can be dealt from a standard deck of 52 cards? Also, how many ways are there to select 47 cards from a deck of 52 cards? Solution: Since the order in which the cards are dealt does not matter, the number of five card hands is: The different ways to
20、select 47 cards from 52 is,Combination Examples,How many bit-strings of length 8 contain four 1s We need to form a committee of 7 people, 3 from math and 4 from computer science to develop a discrete math course. There are 9 math candidates and 11 CS candidates T Two separate problems that need to b
21、e combined using the product rule. C(9, 3) possibilities for math and C(11, 4) possibilities for CS: Total = C(9, 3)C(11, 4) = 27,720,18,Combination Example,How many paths are there from (0, 0) to (m, n) with right and up moves as the only allowed moves? We need exactly n up moves and m right moves
22、to get to (m,n). Let “up” be a “1” and right be a “0”. Thus we need to count the total number of bit-strings with exactly m 1s and n 0s.,19,One possible path,(m,n),(0,0),This is equivalent to select n (or m) elements from a set of n + m elements: C(n+m, n),011100001010,(7,5),Binomial Coefficients,Bi
23、nomial Theorem (n, j 0 and j n) (Note that ) When (x + y)n is in its expanded form, the coefficient of term xn-jyj is,20,Binomial Coefficient Examples,What is the coefficient of x12 y13 in the expansion of (x + y)25 ? We need to pick 12 xs from 25 terms: C(25,12) = C(25,13) = 25!/(12!13!) What is th
24、e coefficient of x12y13 in (2x 3y)25? First replace a = 2x and b = -3y. The coefficient of a12b13 in (a + b)25 is C(25, 13). thus it follows that: C(25,13)a12b13 = C(25,13)212x12 (-3)13 y13. So the coefficient of x12y13 is C(25,13)212(-3)13 = - (25!/(12!13!)212313,21,Binomial Coefficient Example,Wha
25、t are coefficients for xk in the expansion of (x+1/x)100 in terms of k, where k is an integer? A typical term for j is (i) Let k = 100 2j. Then j = (100 k)/2 As j runs from 0 to 100, k runs from 100 to -100 in decrements of 2 (100, 98, , 0, -2, , -100) So, (i) is equivalent to,22,Binomial Coefficien
26、t Corollaries,Let n be nonnegative integer. Then Let x = 1 and y = 1 in the Binomial Theorem Let n be nonnegative integer. Then Let x = 1 and y = 2 in (i) and let x = 1 and y = -1 in (ii) in the Binomial Theorem,23,(i) and,(ii),24,Pascals Triangle / Identity,Pascals Identity,Pascals Identity, where
27、n, k 0 and k n: Proof: Denote T = a1, a2, , ak+1, and S = T aj where aj is some arbitrary element in T. The number of subsets of k elements of T is C(n +1, k). This must be equal to the number of ways to pick k elements from T that do not contain aj (= picking k elements from S, or C(n, k), plus the
28、 number of ways to pick k elements that always contain aj (= picking k 1 elements from S, or C(n, k 1). Hence C(n + 1, k) = C(n, k) + C(n, k 1),25,Pascals Identity,Pascals Identity, where n, k 0 and k n: An algebraic proof,26,Permutation with Repetition,The number of r-permutations of a set of n obj
29、ects with repetition allowed is nr Example: How many 3-permutations can be formed from S = 1, 2, 3, 4 with repetition?First object can be chosen in 4 ways. The second object can be chosen also in 4 ways because the elements can be used repeatedly. So, 444 = 43 Example: How many strings of length r c
30、an be formed from the English alphabet?This is 262626 26 (r of them multiplied together) = 26r, because each position can repeatedly select any of the 26 English letters,Combination with Repetition,The number of r-combinations of a set of n objects with repetition allowed is Example: How many 2-combinations with repetition from 1, 2, 3, 4?They are 1, 1, 1, 2, 1, 3, 1, 4, 2, 2, 2, 3, 2, 4, 3, 3, 3, 4, 4, 4. There are C(4+21, 2) = C(5, 2) =10,Combination with Repetition,Example: How many ways are there to select five bills from a cash box containing $1,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 15.2线段的垂直平分线第2课时课件-2026-2027学年沪科版八年级数学上册
- 2026年度室内给水管道专项方案-食品加工厂房
- AI原生SOC能力白皮书2026
- 教学实施报告
- 2025 中国急性主动脉夹层急诊救治指南中文版 专家解读
- 人美版美术四年级上册《现在与未来》教案
- 企业管理学期末考试重点总结
- 男科常见疾病少精症健康宣教
- rel-Medioresinol-生命科学试剂-MCE
- 妇科术后快速康复方案
- 高三英语完形填空六类解题锦囊教学设计
- 2026年铁路集团笔试题库(含答案)
- 2026村后备干部考试题库(含答案)
- 2026年上海市安全员B证(项目负责人)试题及解析附答案
- 2026年“优~质服务基层行”能力评价标准解读
- 河南郑州文化500千伏输变电工程报告书
- 2026年10月自考《习概》模拟试卷(一)
- 新版2026年秋季新版苏教版四年级上册科学第四单元 光与影(12-15课)教案合集
- 2026新教材语文 六年级上册第八单元习作 传承好家风 教学课件
- 2026新教材 统编版九年级语文上册第四单元阅读综合实践【考点精讲版】教学课件
- 新版(2026秋新版)人教版四年级数学上册《综合与实践 寻找宝藏》教案合集
评论
0/150
提交评论