收藏 分享(赏)

ACM课件--特殊的数.ppt

上传人:gnk289057 文档编号:7925252 上传时间:2019-05-30 格式:PPT 页数:75 大小:1.53MB
下载 相关 举报
ACM课件--特殊的数.ppt_第1页
第1页 / 共75页
ACM课件--特殊的数.ppt_第2页
第2页 / 共75页
ACM课件--特殊的数.ppt_第3页
第3页 / 共75页
ACM课件--特殊的数.ppt_第4页
第4页 / 共75页
ACM课件--特殊的数.ppt_第5页
第5页 / 共75页
点击查看更多>>
资源描述

1、2019/5/30,1,ACM 程序设计,计算机学院 刘春英,2019/5/30,2,今天,,你 了吗?,AC,2019/5/30,3,每周一星(8):,天外来客,2019/5/30,4,第九讲,特殊的数 (Special Number),2019/5/30,5,主要内容,Fibonacci Number Lucas number Catalan Number Application to Special Number,2019/5/30,6,Fibonacci Number,Fibonacci is perhaps best known for a simple series of numb

2、ers, introduced in Liber abaci and later named the Fibonacci numbers in his honour. The series begins with 0 and 1. After that, use the simple rule: Add the last two numbers to get the next. 0,1,1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987,.,2019/5/30,7,Leonardo Fibonacci 1175-1250,201

3、9/5/30,8,You might ask where this came from?,2019/5/30,9,In Fibonaccis day, mathematical competitions and challenges were common. In 1225 Fibonacci took part in a tournament at Pisa ordered by the emperor himself, Frederick II. It was in just this type of competition that the following problem arose

4、:,2019/5/30,10,Beginning with a single pair of rabbits, if every month each productive pair bears a new pair, which becomes productive when they are 1 month old, how many rabbits will there be after n months?,2019/5/30,11,January,2019/5/30,12,February,2019/5/30,13,March,2019/5/30,14,April,2019/5/30,

5、15,May、June,?,2019/5/30,16,The number series is,1、1、2、3、5,This if fibonacci!,2019/5/30,17,Some other pictures,2019/5/30,18,2019/5/30,19,2019/5/30,20,2019/5/30,21,2019/5/30,22,Fibonacci number & Golden Section,A special value, closely related to the Fibonacci series, is called the golden section. Thi

6、s value is obtained by taking the ratio of successive terms in the Fibonacci series:,2019/5/30,23,Fibonacci Numbers in Nature,2019/5/30,24,white calla lily(白色马蹄莲),2019/5/30,25,Euphorbia(一种非洲植物,不常见),2019/5/30,26,trillium ( 延龄草),2019/5/30,27,Columbine(耧斗菜),2019/5/30,28,Bloodroot(一种罂粟科植物),2019/5/30,29,

7、black-eyed susan,2019/5/30,30,shasta daisy(大滨菊) with 21 petals,2019/5/30,31,Ordinary field daisies(雏菊) have 34 petals,2019/5/30,32,The association of Fibonacci numbers and plants is not restricted to numbers of petals.,2019/5/30,33,If we draw horizontal lines through the axils, we can detect obvious

8、 stages of development in the plant.,2019/5/30,34,The number of branches at any stage of development is a Fibonacci number.,2019/5/30,35,Furthermore, the number of leaves in any stage will also be a Fibonacci number.,2019/5/30,36,sunflowers (向日葵),2019/5/30,37,2019/5/30,38,2019/5/30,39,2019/5/30,40,F

9、ibonacci in geometrical style,2019/5/30,41,Lucas Number,Lucas Numbers are the companions to the Fibonacci numbers and satisfy the same recurrence :L(n)=L(n-1)+L(n-2),Where L(1)=1,L(2)=3,The first few are 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, .,2019/5/30,42,Edouard Lucas,1842-1891,2019/5/30,43,Questio

10、n:,编程实现这类递归问题时应该注意什么问题?,2019/5/30,44,空间换 时 间!,2019/5/30,45,Catalan number,2019/5/30,46,先看一道题目:,HDOJ_1134: Game of Connections,2019/5/30,47,示意图:,2019/5/30,48,Easy or not ?,2019/5/30,49,The Catalan numbers (1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, .), name

11、d after Eugne Charles Catalan, arise in a number of problems in combinatorics. They can be computed using this formula:,Catalan Number,2019/5/30,50,Eugne Charles Catalan,(18141894 Belgium),2019/5/30,51,What can the Catalan numbers describe ?,2019/5/30,52,1. The number of ways a polygon with n+2 side

12、s can be cut into n triangles,4 sides, 2 ways:,2019/5/30,53,5 sides, 5 ways:,6 sides, 14 ways:,2019/5/30,54,7 sides, 42 ways:,2019/5/30,55,2. the number of ways in which parentheses can be placed in a sequence of numbers to be multiplied, two at a time,2019/5/30,56,5 numbers:,(1 (2 (3 (4 5) (1 (2 (3

13、 4) 5)(1 (2 3) (4 5) (1 (2 (3 4) 5)(1 (2 3) 4) 5) (1 2) (3 (4 5)(1 2) (3 4) 5) (1 (2 3) (4 5)(1 (2 (3 4) 5) (1 (2 3) 4) 5)(1 2) 3) (4 5) (1 2) (3 4) 5)(1 (2 3) 4) 5) (1 2) 3) 4) 5),2019/5/30,57,3.the number of rooted, trivalent trees with n+1 nodes,3 nodes:,2019/5/30,58,5 nodes:,4 nodes:,2019/5/30,5

14、9,4. the number of paths of length 2n through an n-by-n grid that do not rise above the main diagonal,2 x 2 grid:,2019/5/30,60,3 x 3 grid:,4 x 4 grid:,2019/5/30,61,5. The number of binary trees with n nodes.,There are 5 binary trees with 3 nodes.,2019/5/30,62,6. Some other applications,(1)The number

15、 of ways 2n people, seated round a table, can shake hands in n pairs, without their arms crossing. (2)The self-convolving sequence, c0=1, cn+1 = c0cn + c1cn-1 + . + cnc0,2019/5/30,63,(3) The recurring sequence c0=1, (n+2)cn+1 = (4n+2)cn, (n=0). (4)Another disguise is the number of ways n votes can c

16、ome in for each of two candidates A and B in an election, with A never behind B.,2019/5/30,64,思考(1): http:/ (1)当n=0时N=0意味着排队购票的所有人手中拿的都是 ¥50的钞票,那么这m个人排队方案总数为1。 (2)当mn时显然,f(m,n)=0,2019/5/30,66,(3)其他情况:考虑(m+n)个人排队购票的情景,第(m+n)人站在第(m+n-1)个人的后面,则第(m+n )个人的排队方式可以由下列两种情况获得: 1)第(m+n )个人手持¥100的钞票,则在他之前的(m+n-

17、1)个人中有m个人手持¥50的钞票,有(n-1)个人手持¥100的钞票,此种情况共有f(m,n-1); 2)第(m+n )个人手持¥50的钞票,则在他之前的(m+n-1)个人中有m-1个人手持¥50的钞票,有n个人手持¥100的钞票,此种情况共有f(m-1,n);,2019/5/30,67,根据加法原理得到f(m,n)=f(m-1,n)+f(m,n-1) 于是得到f(m,n)的计算公式,2019/5/30,68,计算示意图:,2019/5/30,69,计算示意图:,2019/5/30,70,计算示意图:,2019/5/30,71,可以推出直接的公式:,C(m+n,n)-C(m+n,m+1),2019/5/30,72,思考(2):,1130 How Many Trees?,2019/5/30,73,思考(3):,1131 Count the Trees,2019/5/30,74,课后作业:,1130 How Many Trees? 1131 Count the Trees 1133 Buy the Ticket 1134 Game of Connections 1023 Train Problem II 2018 母牛的故事 2041超级楼梯 2067小兔的棋盘,2019/5/30,75,ACM, 天天见!,

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报