Module #17Recurrence Relations.ppt

  1. 1、本文档共30页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Module #17Recurrence Relations.ppt

1/8/01 (c)2001-2003, Michael P. Frank Discrete Mathematics and its Applications (c)2001-2002, Michael P. Frank Module #17: Recurrence Relations Rosen 5th ed., §6.1-6.3 ~29 slides, ~1.5 lecture §6.1: Recurrence Relations A recurrence relation (R.R., or just recurrence) for a sequence {an} is an equation that expresses an in terms of one or more previous elements a0, …, an?1 of the sequence, for all n≥n0. A recursive definition, without the base cases. A particular sequence (described non-recursively) is said to solve the given recurrence relation if it is consistent with the definition of the recurrence. A given recurrence relation may have many solutions. Recurrence Relation Example Consider the recurrence relation an = 2an?1 ? an?2 (n≥2). Which of the following are solutions? an = 3n an = 2n an = 5 Example Applications Recurrence relation for growth of a bank account with P% interest per given period: Mn = Mn?1 + (P/100)Mn?1 Growth of a population in which each organism yields 1 new one every period starting 2 periods after its birth. Pn = Pn?1 + Pn?2 (Fibonacci relation) Solving Compound Interest RR Mn = Mn?1 + (P/100)Mn?1 = (1 + P/100) Mn?1 = r Mn?1 (let r = 1 + P/100) = r (r Mn?2) = r·r·(r Mn?3) …and so on to… = rn M0 Tower of Hanoi Example Problem: Get all disks from peg 1 to peg 2. Only move 1 disk at a time. Never set a larger disk on a smaller one. Hanoi Recurrence Relation Let Hn = # moves for a stack of n disks. Optimal strategy: Move top n?1 disks to spare peg. (Hn?1 moves) Move bottom disk. (1 move) Move top n?1 to bottom disk. (Hn?1 moves) Note: Hn = 2Hn?1 + 1 Solving Tower of Hanoi RR Hn = 2 Hn?1 + 1 = 2 (2 Hn?2 + 1) + 1 = 22 Hn?2 + 2 + 1 = 22(2 Hn?3 + 1) + 2 + 1 = 23 Hn?3 + 22 + 2 + 1 … = 2n?1 H1 + 2n?2 + … + 2 + 1 = 2n?1 + 2n?2 + … + 2 + 1 (since H1 = 1) = = 2n ? 1 §6.2: Solving Recurrences A linear homogeneous recurrence of degree k with constant coefficients (“k-LiHoReCoCo”) is a recurrence of the f

文档评论(0)

zhaoxq + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档