DOC PREVIEW
CMU CS 15251 - Lecture

This preview shows page 1-2-3-4-5-6-7-8-9-62-63-64-65-66-67-68-69-124-125-126-127-128-129-130-131-132 out of 132 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 132 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

15-251Great Theoretical Ideas in Computer ScienceRecurrences, Fibonacci Numbers and Continued FractionsLecture 9, September 23, 2008Happy Autumnal Equinoxhttp://apod.nasa.gov/apod/ap080922.htmlLeonardo FibonacciLeonardo FibonacciIn 1202, Fibonacci proposed a problem about the growth of rabbit populationsRabbit ReproductionRabbit ReproductionA rabbit lives foreverRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth monthmonth1234567rabbitsRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth monthmonth1234567rabbitsRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth month1month1234567rabbitsRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth month1 1month1234567rabbitsRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth month1 1 2month1234567rabbitsRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth month1 1 32month1234567rabbitsRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth month1 1 3 52month1234567rabbitsRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth month1 1 3 52 8month1234567rabbitsRabbit ReproductionA rabbit lives foreverThe population starts as single newborn pairEvery month, each productive pair begets a new pair which will become productive after 2 months oldFn= # of rabbit pairs at the beginning of the nth month1 1 3 52 8 13Fibonacci Numbersmonth1234567rabbits1 1 3 52 8 13Fibonacci NumbersStage 0, Initial Condition, or Base Case:Fib(1) = 1; Fib (2) = 1month1234567rabbits1 1 3 52 8 13Fibonacci NumbersStage 0, Initial Condition, or Base Case:Fib(1) = 1; Fib (2) = 1Inductive Rule:For n>3, Fib(n) =month1234567rabbits1 1 3 52 8 13Fibonacci NumbersStage 0, Initial Condition, or Base Case:Fib(1) = 1; Fib (2) = 1Inductive Rule:For n>3, Fib(n) =Fib(n-1) + Fib(n-2)month1234567rabbits1 1 3 52 8 13Sequences That Sum To nSequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.f1 = 1Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.f1 = 1 0 = the empty sumSequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.f1 = 1 0 = the empty sumf2 = 1Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.f1 = 1 0 = the empty sumf2 = 1 1 = 1Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.f1 = 1 0 = the empty sumf2 = 1 1 = 1f3 = 2Sequences That Sum To n2 = 1 + 1 2Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.f1 = 1 0 = the empty sumf2 = 1 1 = 1f3 = 2Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.4 =2 + 2 2 + 1 + 1 1 + 2 + 1 1 + 1 + 2 1 + 1 + 1 + 1Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.4 =Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.fn+1 = fn + fn-1Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.fn+1 = fn + fn-1# of sequences beginning with a 2# of sequences beginning with a 1Sequences That Sum To nLet fn+1 be the number of different sequences of 1’s and 2’s that sum to n.Fibonacci Numbers Againfn+1 = fn + fn-1f1 = 1 f2 = 1Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.Visual Representation: TilingLet fn+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.1 way to tile a strip of length 01 way to tile a strip of length 1:2 ways to tile a strip of length 2:Visual Representation: Tilingfn+1 = fn + fn-1fn+1 is number of ways to tile length n.fn tilings that start with a square.fn-1 tilings that start with a domino.Fibonacci IdentitiesFibonacci IdentitiesSome examples:Fibonacci IdentitiesSome examples:Fibonacci IdentitiesSome examples:F2n = F1 + F3 + F5 + … + F2n-1Fibonacci IdentitiesSome examples:F2n = F1 + F3 + F5 + … + F2n-1Fibonacci IdentitiesSome examples:F2n = F1 + F3 + F5 + … + F2n-1Fm+n+1 = Fm+1 Fn+1 + Fm FnFibonacci IdentitiesSome examples:F2n = F1 + F3 + F5 + … + F2n-1Fm+n+1 = Fm+1 Fn+1 + Fm FnFibonacci IdentitiesSome examples:F2n = F1 + F3 + F5 + … + F2n-1Fm+n+1 = Fm+1 Fn+1 + Fm Fn(Fn)2 = Fn-1 Fn+1 + (-1)nFm+n+1 = Fm+1 Fn+1 + Fm FnFm+n+1 = Fm+1 Fn+1 + Fm FnmnFm+n+1 = Fm+1 Fn+1 + Fm Fnmnm-1n-1(Fn)2 = Fn-1 Fn+1 + (-1)n(Fn)2 = Fn-1 Fn+1 + (-1)nn-1Fn tilings of a strip of length n-1(Fn)2 = Fn-1 Fn+1 + (-1)nn(Fn)2 tilings of two strips of size n-1(Fn)2 = Fn-1 Fn+1 + (-1)nnDraw a vertical “fault


View Full Document

CMU CS 15251 - Lecture

Documents in this Course
lecture

lecture

66 pages

lecture

lecture

79 pages

lecture

lecture

111 pages

lecture

lecture

85 pages

lecture17

lecture17

64 pages

Lecture

Lecture

85 pages

Lecture

Lecture

71 pages

Lecture

Lecture

70 pages

Lecture

Lecture

11 pages

Lecture

Lecture

45 pages

Lecture

Lecture

50 pages

Lecture

Lecture

93 pages

Lecture

Lecture

93 pages

Lecture

Lecture

35 pages

Lecture

Lecture

98 pages

Lecture

Lecture

74 pages

Lecture

Lecture

13 pages

Lecture

Lecture

15 pages

Lecture

Lecture

66 pages

Lecture

Lecture

82 pages

Lecture

Lecture

15 pages

Lecture

Lecture

47 pages

Lecture

Lecture

69 pages

Lecture

Lecture

13 pages

Lecture

Lecture

67 pages

Lecture

Lecture

68 pages

Lecture

Lecture

69 pages

lecture03

lecture03

44 pages

Lecture

Lecture

69 pages

Lecture

Lecture

68 pages

Lecture

Lecture

55 pages

Lecture

Lecture

79 pages

Lecture

Lecture

85 pages

Lecture

Lecture

87 pages

Lecture

Lecture

85 pages

Lecture

Lecture

103 pages

Lecture

Lecture

9 pages

Lecture

Lecture

83 pages

Lecture

Lecture

8 pages

lecture03

lecture03

68 pages

lecture24

lecture24

78 pages

lecture03

lecture03

72 pages

Thales

Thales

129 pages

lecture13

lecture13

81 pages

Lecture

Lecture

64 pages

lecture01

lecture01

59 pages

lecture11

lecture11

105 pages

Lecture

Lecture

89 pages

Lecture

Lecture

74 pages

lecture25

lecture25

57 pages

Lecture

Lecture

99 pages

lecture

lecture

50 pages

lecture

lecture

14 pages

Lecture

Lecture

78 pages

lecture

lecture

8 pages

Lecture

Lecture

98 pages

lecture

lecture

83 pages

lecture23

lecture23

88 pages

lecture

lecture

64 pages

lecture

lecture

72 pages

Lecture

Lecture

88 pages

lecture

lecture

79 pages

Lecture

Lecture

60 pages

lecture

lecture

74 pages

lecture19

lecture19

72 pages

lecture25

lecture25

86 pages

lecture

lecture

13 pages

lecture17

lecture17

79 pages

lecture

lecture

91 pages

lecture

lecture

78 pages

Lecture

Lecture

11 pages

Lecture

Lecture

54 pages

lecture

lecture

72 pages

lecture

lecture

119 pages

lecture

lecture

167 pages

lecture

lecture

73 pages

lecture

lecture

73 pages

lecture

lecture

83 pages

lecture

lecture

49 pages

lecture

lecture

16 pages

lecture

lecture

67 pages

lecture

lecture

81 pages

lecture

lecture

72 pages

lecture

lecture

57 pages

lecture16

lecture16

82 pages

lecture21

lecture21

46 pages

Lecture

Lecture

92 pages

Lecture

Lecture

14 pages

Lecture

Lecture

49 pages

Lecture

Lecture

101 pages

Lecture

Lecture

98 pages

Lecture

Lecture

59 pages

Lecture

Lecture

64 pages

Lecture

Lecture

106 pages

Lecture

Lecture

70 pages

Lecture

Lecture

80 pages

Lecture

Lecture

76 pages

Lecture

Lecture

91 pages

Lecture

Lecture

112 pages

Lecture

Lecture

91 pages

Lecture

Lecture

10 pages

Lecture

Lecture

39 pages

Lecture

Lecture

79 pages

Lecture

Lecture

74 pages

Lecture

Lecture

44 pages

Lecture

Lecture

39 pages

Lecture

Lecture

99 pages

Lecture

Lecture

44 pages

Lecture

Lecture

59 pages

Lecture

Lecture

36 pages

lecture17

lecture17

36 pages

lecture

lecture

71 pages

lecture

lecture

79 pages

lecture

lecture

12 pages

lecture

lecture

43 pages

lecture

lecture

87 pages

lecture

lecture

35 pages

lecture03

lecture03

23 pages

lecture

lecture

68 pages

lecture

lecture

74 pages

lecture

lecture

21 pages

lecture

lecture

79 pages

lecture

lecture

15 pages

lecture

lecture

83 pages

lecture

lecture

13 pages

Lecture

Lecture

53 pages

lecture

lecture

55 pages

lecture

lecture

49 pages

lecture

lecture

10 pages

lecture

lecture

70 pages

lecture

lecture

12 pages

Lecture

Lecture

105 pages

Lecture

Lecture

9 pages

Lecture

Lecture

72 pages

Lecture

Lecture

66 pages

Lecture

Lecture

54 pages

Lecture

Lecture

98 pages

Lecture

Lecture

57 pages

Lecture

Lecture

75 pages

Lecture

Lecture

48 pages

lecture

lecture

53 pages

Lecture

Lecture

72 pages

Lecture

Lecture

53 pages

Lecture

Lecture

84 pages

Lecture

Lecture

55 pages

Lecture

Lecture

15 pages

Lecture

Lecture

6 pages

Lecture

Lecture

38 pages

Lecture

Lecture

71 pages

Lecture

Lecture

110 pages

Lecture

Lecture

70 pages

lecture

lecture

48 pages

lecture

lecture

76 pages

lecture

lecture

48 pages

lecture

lecture

52 pages

lecture

lecture

43 pages

lecture

lecture

81 pages

lecture

lecture

82 pages

lecture

lecture

83 pages

lecture

lecture

64 pages

lecture

lecture

71 pages

lecture

lecture

65 pages

lecture

lecture

56 pages

lecture

lecture

12 pages

lecture

lecture

66 pages

lecture

lecture

50 pages

lecture

lecture

86 pages

lecture

lecture

70 pages

Lecture

Lecture

74 pages

Lecture

Lecture

54 pages

Lecture

Lecture

90 pages

lecture

lecture

78 pages

lecture

lecture

87 pages

Lecture

Lecture

55 pages

Lecture

Lecture

12 pages

lecture21

lecture21

66 pages

Lecture

Lecture

11 pages

lecture

lecture

83 pages

Lecture

Lecture

53 pages

Lecture

Lecture

69 pages

Lecture

Lecture

12 pages

lecture04

lecture04

97 pages

Lecture

Lecture

14 pages

lecture

lecture

75 pages

Lecture

Lecture

74 pages

graphs2

graphs2

8 pages

lecture

lecture

82 pages

Lecture

Lecture

8 pages

lecture

lecture

47 pages

lecture

lecture

91 pages

lecture

lecture

76 pages

lecture

lecture

73 pages

lecture

lecture

10 pages

lecture

lecture

63 pages

lecture

lecture

91 pages

lecture

lecture

79 pages

lecture

lecture

9 pages

lecture

lecture

70 pages

lecture

lecture

86 pages

lecture

lecture

102 pages

lecture

lecture

145 pages

lecture

lecture

91 pages

Lecture

Lecture

87 pages

lecture

lecture

87 pages

Notes

Notes

19 pages

Lecture

Lecture

50 pages

Lecture

Lecture

13 pages

Lecture

Lecture

97 pages

Lecture

Lecture

98 pages

Lecture

Lecture

83 pages

Lecture

Lecture

77 pages

Lecture

Lecture

102 pages

Lecture

Lecture

63 pages

Lecture

Lecture

104 pages

lecture

lecture

41 pages

lecture

lecture

14 pages

Lecture

Lecture

87 pages

Lecture

Lecture

94 pages

lecture

lecture

9 pages

Lecture

Lecture

96 pages

Lecture

Lecture

72 pages

Lecture

Lecture

35 pages

Lecture

Lecture

77 pages

Lecture

Lecture

98 pages

Lecture

Lecture

48 pages

Lecture

Lecture

66 pages

Lecture

Lecture

53 pages

lecture18

lecture18

101 pages

Lecture

Lecture

10 pages

Lecture

Lecture

70 pages

Lecture

Lecture

12 pages

Lecture

Lecture

74 pages

graphs

graphs

10 pages

Lecture

Lecture

62 pages

Lecture

Lecture

11 pages

Lecture

Lecture

71 pages

Lecture

Lecture

42 pages

lecture15

lecture15

72 pages

Lecture

Lecture

82 pages

Load more
Download Lecture
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?