已阅读5页,还剩48页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Chapter3:Counting计数,Counting,CountableSet可数集合Permutationsandcombinations排列与组合PigeonholePrinciple鸽巢原理ElementsofProbability概率基础RecurrenceRelations递归关系,CountableSet,AsetAiscountableifandonlyifwecanarrangeallofitselementsinalinearlistinadefiniteorder.“Definite”meansthatwecanspecifythefirst,second,thirdelement,andsoon.Ifthelistendedandwiththenthelementasitslastelement,itisfinite.Ifthelistgoesonforever,itisinfinite.,ProofofCountability,Thesetofallintegersiscountable.Wecanarrangeallintegerinalinearlistasfollows:0,-1,1,-2,2,-3,3,.thatis:positivekisthe(2k+1)thelement,andnegativekisthe2kthelementinthelist.Isthesetofrationalnumberscountable?yes!,SetofOrderedPairs,Thesetofallobjectswiththeformiscountable,wherei,jarenonnegativeintegers.,So,thesetofrationalnumbersiscountable.,3.1Permutations排列,回忆:好像还有一个加法原则:一件事情有两种做法,第一种做法有n种方式,第二种做法有m种方式,则完成这件事情共有mn种方法.,Theorem1:multiplicationprincipleofcounting(计数的乘法原理)SupposethattwotasksT1andT2aretobeperformedinsequence.IfT1canbeperformedinn1ways,andforeachofthesewaysT2canbeperformedinn2ways,thenthesequenceT1T2canbeperformedinn1n2ways.,Example:LetAbeaset.|A|=n.howmanysubsetsdoesAhave?|p(A)|=2n.Why?定义标识符:由字符开头的8位字符数字串或者一位字符,共有多少个合法标识符?含数字1的小于10000的正整数个数.,Theorem2:SupposethattasksT1,T2,.,Tkaretobeperformedinsequence.IfT1canbeperformedinn1ways,andforeachofthesewaysT2canbeperformedinn2ways,andforeachofthesen1n2waysofperformingT1T2insequence,T3canbeperformedinn3ways,andsoon,thenthesequenceT1T2Tk,canbeperformedinexactlyn1n2nkways.,Problem1:LetAbeanysetwithnelements.(1rn)Howmanydifferentsequences,eachoflengthr,canbeformedfromA,ifelementsmayberepeated?nrIfrepetitionisnotpermitted?n(n-1)(n-r+1)Theorem3:P93Theorem4:nPrthenumberofpermutationsofnobjectstakenratatime(norepetition)n个对象中每次取r个的排列数,permutationofA:whenn=r,nPn=n!,Examples:,从52张扑克牌中发5张牌,如果考虑发牌次序,共有多少种牌型?Howmany“words”ofthreedistinctletterscanbeformedfromthelettersof“MAST”?Howmany“words”ofthreeletterscanbeformedfromthelettersof“MAST”?Howmany“words”ofthreedistinctletterscanbeformedfromthelettersof“MASS”?Howmanydistinct“words”ofthreeletterscanbeformedfromthelettersof“MASS”?,Problem:Howmanydistinguishablepermutationsofthelettersintheword“BANANA”arethere?Permutationswithlimitedrepeat6!*N1N2issameas*N2N1*A1A2A3issameas*A3A2A1So:6!/(2!*3!)Theorem5:P95Howmanydistinct“words”ofthreeletterscanbeformedfromthelettersof“MASS”?4P3/2!,3.2Combinations组合,Problem:LetAbesetwithnelements,and1rn,howmanydifferentsubsetsofAarethere,eachwithrelements?(C)Permutationsof|A|takenratatime:nPrPermutationsofrelements:rPrnPr=CrPr,so,C=nPr/rPrTheorem1:nCr:numberofcombinationsofnobjectstakenratatime(n个对象每次取r个时的组合数).,Examples:,Problem:AthreeCDsprizefromTop10list;Repeatsareallowed,choiceislefttowinnerandtheorderisirrelevant;Supposechoicesarerecordedbyavoicemailsystem;Thenumberofwaysinwhichthewinnercanmake?12C3Theorem2:Supposekselectionsaretobemadefromnitemswithoutregardtoorderandthatrepeatsareallowed,assumingatleastkcopiesofeachofthenitems.Thenumberofwaystheseselectionscanbemadeis(n+k-1)Ck.,Examples:,Ex5:Password:Firstchar:a,b,c,d,e,f,gLast7chars:charandnumberEx6:Seven-personCommittee:4from30men3from20womenInGeneral:OrdermatterspermutationOrderdoesnotmattercombination,3.3PigeonholePrinciple鸽巢原理,Theorem1:Ifnpigeons(鸽子)areassignedtompigeonholes(鸽巢),andm0,thereare(n-m)pigeonshavenotbeenassigned.Itsacontradiction.,Examples,注意:鸽巢原理只是存在性证明,它保证至少有两个对象有这种性质,但是没有信息识别这些元素,只是保证它们的存在;与之相对,构造性证明是通过实际构造出具有某种特性的对象或对象群体来保证存在性。Thekey:Whatispigeonholeandwhatispigeon?Ex2:Showthatifanyfivenumbersfrom1to8arechosen,thentwoofthemwilladdto9.Ex3:Ifany11numbersarechosenfromtheset1,2,20,thenoneofthemwillbeamultipleofanother.,Ex4:NotTooFarApart,Problem:Wehavearegionboundedbyaregularhexagonwhosesidesareoflength1unit.Showthatifanysevenpointsarechoseninthisregion,thentwoofthemmustbenofartherapartthan1unit.,Theregioncanbedividedintosixequilateraltriangles,thenamong7pointsrandomlychoseninthisregionmustbetwolocatedwithinonetriangle.,ShakingHandsataGathering,Situation:atagatheringofnpeople,everyoneshookhandswithatleastoneperson,andnooneshookhandsmorethanoncewiththesameperson.Problem:showthattheremusthavebeenatleasttwoofthemwhohadthesamenumberofhandshaking.Solution:Pigeon:thenparticipantsPigeonhole:differentnumberbetween1andn-1.,ExtendedPigeonholePrinciple推广的鸽巢原理,Theorem2:Ifnpigeonsareassignedtompigeonholes,mrecurrencerelationan=2+3(n-1)=explicitformulaE.g.2bn=2bn-1+1,b1=7bn=2n+2-1,ThinkingRecursively:Problem1,TowersofHanoiHowmanymovesareneedtomoveallthediskstothethirdpegbymovingonlyoneatatimeandneverplacingadiskontopofasmallerone.,T(1)=1T(n)=2T(n-1)+1,SolutionofTowersofHanoi,T(n)=2T(n-1)+12T(n-1)=4T(n-2)+24T(n-2)=8T(n-3)+4.2n-2T(2)=2n-1T(1)+2n-2,T(n)=2n-1,ThinkingRecursively:Problem2,CuttingtheplaneHowmanysectionscanbegeneratedatmostbynstraightlineswithinfinitelength.,Linen,Intersectingalln-1existinglinestogetasmostsectionsaspossible,L(0)=1L(n)=L(n-1)+n,SolutionofCuttingthePlane,L(n)=L(n-1)+n=L(n-2)+(n-1)+n=L(n-3)+(n-2)+(n-1)+n=L(0)+1+2+(n-2)+(n-1)+n,ThinkingRecursively:Problem3,JosephussproblemFindthepositiontolive,ordie!,1,9,10,3,4,5,7,8,2,6,1,9,10,3,4,5,7,8,2,6,11,J(10,2)=5;,J(13,2)=7;,ThinkingRecursively:Problem3(cont.),JosephussproblemGivennpeople,mthmanwillbeexecuted.Findthepositiontolive,ordie!JustJ(n,m),Whenm=2:J(1)=1J(2n)=2J(n)-1J(2n+1)=2J(n)+1,LinearHomogeneousRelation,iscalledlinearhomogeneousrelationofdegreek.,Yes,No,CharacteristicEquation,Foralinearhomogeneousrecurrencerelationofdegreekthepolynomialofdegreekiscalleditscharacteristicequation.Thecharacteristicequationoflinearhomogeneousrecurrencerelationofdeg
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 护理服务优化策略与实践
- 家庭责任承担保障承诺书(9篇)
- 2025重庆丹源安保服务有限公司招聘60人(国企)笔试参考题库附带答案详解(3卷)
- 旅游景区安全事故应急预案(5篇)
- 产科护理风险防范措施
- 生产安全责任状续签承诺函3篇范文
- 南充农业投资服务有限公司市场化选聘总经理笔试笔试历年备考题库附带答案详解
- 护理健康教育创新比赛
- 陕西省2025陕西宝鸡市属事业单位招聘高层次人才(79人)笔试历年参考题库典型考点附带答案详解(3卷合一)
- 临床护理岗位仪容仪表规范
- 2025年消防文员理论考试题库(浓缩400题)
- 成立消化分会的申请课件
- 贵州省金沙县沙土镇汇鑫煤矿市场化矿山生态修复整改技术方案
- 高标准农田安全生产管理制度
- 2025员工合同遗失证明模板样本
- GB/T 17038-2025内燃机车柴油机油
- 中西医结合儿科学练习试卷3(共872题) (一)
- 2025四川宜宾三江投资建设集团有限公司下属子公司第二批员工招聘21人笔试历年典型考点题库附带答案详解2套试卷
- 城市建筑垃圾零排放技术解决方案
- GB/T 16293-2025医药工业洁净室(区)浮游菌的测试方法
- 七上语文第14课《回忆我的母亲》作业设计
评论
0/150
提交评论