14 Jan 2022•0 j'aime•37 vues

Télécharger pour lire hors ligne

Signaler

Art & Photos

sfefsf fsf

ssuser22a384Suivre

- 1. 15-251 Great Theoretical Ideas in Computer Science
- 2. Recurrences, Fibonacci Numbers and Continued Fractions Lecture 9, September 23, 2008
- 3. Happy Autumnal Equinox http://apod.nasa.gov/apod/ap080922.html
- 4. Leonardo Fibonacci
- 5. Leonardo Fibonacci In 1202, Fibonacci proposed a problem about the growth of rabbit populations
- 6. Rabbit Reproduction
- 7. Rabbit Reproduction A rabbit lives forever
- 8. Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair
- 9. Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old
- 10. Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month
- 11. month 1 2 3 4 5 6 7 rabbits Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month
- 12. month 1 2 3 4 5 6 7 rabbits Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month 1
- 13. month 1 2 3 4 5 6 7 rabbits Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month 1 1
- 14. month 1 2 3 4 5 6 7 rabbits Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month 1 1 2
- 15. month 1 2 3 4 5 6 7 rabbits Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month 1 1 3 2
- 16. month 1 2 3 4 5 6 7 rabbits Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month 1 1 3 5 2
- 17. month 1 2 3 4 5 6 7 rabbits Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month 1 1 3 5 2 8
- 18. month 1 2 3 4 5 6 7 rabbits Rabbit Reproduction A rabbit lives forever The population starts as single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months old Fn= # of rabbit pairs at the beginning of the nth month 1 1 3 5 2 8 13
- 19. Fibonacci Numbers month 1 2 3 4 5 6 7 rabbits 1 1 3 5 2 8 13
- 20. Fibonacci Numbers Stage 0, Initial Condition, or Base Case: Fib(1) = 1; Fib (2) = 1 month 1 2 3 4 5 6 7 rabbits 1 1 3 5 2 8 13
- 21. Fibonacci Numbers Stage 0, Initial Condition, or Base Case: Fib(1) = 1; Fib (2) = 1 Inductive Rule: For n>3, Fib(n) = month 1 2 3 4 5 6 7 rabbits 1 1 3 5 2 8 13
- 22. Fibonacci Numbers Stage 0, Initial Condition, or Base Case: Fib(1) = 1; Fib (2) = 1 Inductive Rule: For n>3, Fib(n) = Fib(n-1) + Fib(n-2) month 1 2 3 4 5 6 7 rabbits 1 1 3 5 2 8 13
- 23. Sequences That Sum To n
- 24. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.
- 25. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. f1 = 1
- 26. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. f1 = 1 0 = the empty sum
- 27. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. f1 = 1 0 = the empty sum f2 = 1
- 28. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. f1 = 1 0 = the empty sum f2 = 1 1 = 1
- 29. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. f1 = 1 0 = the empty sum f2 = 1 1 = 1 f3 = 2
- 30. Sequences That Sum To n 2 = 1 + 1 2 Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. f1 = 1 0 = the empty sum f2 = 1 1 = 1 f3 = 2
- 31. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. 4 =
- 32. 2 + 2 2 + 1 + 1 1 + 2 + 1 1 + 1 + 2 1 + 1 + 1 + 1 Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. 4 =
- 33. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.
- 34. fn+1 = fn + fn-1 Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.
- 35. fn+1 = fn + fn-1 # of sequences beginning with a 2 # of sequences beginning with a 1 Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.
- 36. Fibonacci Numbers Again fn+1 = fn + fn-1 f1 = 1 f2 = 1 Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.
- 37. Visual Representation: Tiling Let fn+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.
- 38. 1 way to tile a strip of length 0 1 way to tile a strip of length 1: 2 ways to tile a strip of length 2: Visual Representation: Tiling
- 39. fn+1 = fn + fn-1 fn+1 is number of ways to tile length n. fn tilings that start with a square. fn-1 tilings that start with a domino.
- 40. Fibonacci Identities
- 41. Fibonacci Identities Some examples:
- 42. Fibonacci Identities Some examples:
- 43. Fibonacci Identities Some examples: F2n = F1 + F3 + F5 + … + F2n-1
- 44. Fibonacci Identities Some examples: F2n = F1 + F3 + F5 + … + F2n-1
- 45. Fibonacci Identities Some examples: F2n = F1 + F3 + F5 + … + F2n-1 Fm+n+1 = Fm+1 Fn+1 + Fm Fn
- 46. Fibonacci Identities Some examples: F2n = F1 + F3 + F5 + … + F2n-1 Fm+n+1 = Fm+1 Fn+1 + Fm Fn
- 47. Fibonacci Identities Some examples: F2n = F1 + F3 + F5 + … + F2n-1 Fm+n+1 = Fm+1 Fn+1 + Fm Fn (Fn)2 = Fn-1 Fn+1 + (-1)n
- 48. Fm+n+1 = Fm+1 Fn+1 + Fm Fn
- 49. Fm+n+1 = Fm+1 Fn+1 + Fm Fn m n
- 50. Fm+n+1 = Fm+1 Fn+1 + Fm Fn m n m-1 n-1
- 51. (Fn)2 = Fn-1 Fn+1 + (-1)n
- 52. (Fn)2 = Fn-1 Fn+1 + (-1)n n-1 Fn tilings of a strip of length n-1
- 53. (Fn)2 = Fn-1 Fn+1 + (-1)n n (Fn)2 tilings of two strips of size n-1
- 54. (Fn)2 = Fn-1 Fn+1 + (-1)n n Draw a vertical “fault line” at the rightmost position (<n) possible without cutting any dominoes
- 55. (Fn)2 = Fn-1 Fn+1 + (-1)n n Swap the tails at the fault line to map to a tiling of 2 (n-1)’s to a tiling of an n-2 and an n.
- 56. (Fn)2 = Fn-1 Fn+1 + (-1)n-1 n even n odd
- 57. Sneezwort (Achilleaptarmica) Each time the plant starts a new shoot it takes two months before it is strong enough to support branching.
- 58. Counting Petals
- 59. Counting Petals 5 petals: buttercup, wild rose, larkspur, columbine (aquilegia) 8 petals: delphiniums 13 petals: ragwort, corn marigold, cineraria, some daisies 21 petals: aster, black-eyed susan, chicory 34 petals: plantain, pyrethrum 55, 89 petals: michaelmas daisies, the asteraceae family.
- 60. The Fibonacci Quarterly
- 61. Definition of φ (Euclid)
- 62. Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. Definition of φ (Euclid)
- 63. Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. Definition of φ (Euclid) A B C
- 64. Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. Definition of φ (Euclid) A B C φ = AC AB AB BC =
- 65. Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. Definition of φ (Euclid) A B C φ = AC AB AB BC = φ2 =
- 66. Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. Definition of φ (Euclid) A B C φ = AC AB AB BC = φ2 = AC BC
- 67. Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. Definition of φ (Euclid) A B C φ = AC AB AB BC = φ2 = AC BC φ 2 - φ =
- 68. Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. Definition of φ (Euclid) A B C φ = AC AB AB BC = φ2 = AC BC φ 2 - φ = AC BC AB BC - =
- 69. Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. Definition of φ (Euclid) A B C φ = AC AB AB BC = φ2 = AC BC φ 2 - φ = AC BC AB BC BC BC - = = 1
- 70. φ2 – φ – 1 = 0
- 71. φ2 – φ – 1 = 0 φ = 1 + √5 2
- 73. Golden ratio supposed to arise in… Parthenon, Athens (400 B.C.) b a The great pyramid at Gizeh Ratio of a person’s height to the height of his/her navel
- 74. Golden ratio supposed to arise in… Parthenon, Athens (400 B.C.) b a The great pyramid at Gizeh Ratio of a person’s height to the height of his/her navel Mostly circumstantial evidence…
- 75. Expanding Recursively
- 76. Expanding Recursively
- 77. Continued Fraction Representation
- 78. A (Simple) Continued Fraction Is Any Expression Of The Form: where a, b, c, … are whole numbers.
- 79. A Continued Fraction can have a finite or infinite number of terms. We also denote this fraction by [a,b,c,d,e,f,…]
- 80. A Finite Continued Fraction Denoted by [2,3,4,2,0,0,0,…]
- 81. An Infinite Continued Fraction Denoted by [1,2,2,2,…]
- 82. Recursively Defined Form For CF
- 83. Continued fraction representation of a standard fraction
- 84. e.g., 67/29 = 2 with remainder 9/29 = 2 + 1/ (29/9)
- 85. Ancient Greek Representation: Continued Fraction Representation
- 86. Ancient Greek Representation: Continued Fraction Representation = [1,1,1,1,0,0,0,…]
- 87. Ancient Greek Representation: Continued Fraction Representation
- 88. Ancient Greek Representation: Continued Fraction Representation = [1,1,1,1,1,0,0,0,…]
- 89. Ancient Greek Representation: Continued Fraction Representation = [1,1,1,1,1,1,0,0,0,…]
- 90. A Pattern? Let r1 = [1,0,0,0,…] = 1 r2 = [1,1,0,0,0,…] = 2/1 r3 = [1,1,1,0,0,0…] = 3/2 r4 = [1,1,1,1,0,0,0…] = 5/3 and so on. Theorem: rn = Fib(n+1)/Fib(n)
- 91. 1,1,2,3,5,8,13,21,34,55,….
- 92. 1,1,2,3,5,8,13,21,34,55,…. 2/1 = 2
- 93. 1,1,2,3,5,8,13,21,34,55,…. 2/1 = 2 3/2 = 1.5
- 94. 1,1,2,3,5,8,13,21,34,55,…. 2/1 = 2 3/2 = 1.5 5/3 = 1.666…
- 95. 1,1,2,3,5,8,13,21,34,55,…. 2/1 = 2 3/2 = 1.5 5/3 = 1.666… 8/5 = 1.6
- 96. 1,1,2,3,5,8,13,21,34,55,…. 2/1 = 2 3/2 = 1.5 5/3 = 1.666… 8/5 = 1.6 13/8 = 1.625
- 97. 1,1,2,3,5,8,13,21,34,55,…. 2/1 = 2 3/2 = 1.5 5/3 = 1.666… 8/5 = 1.6 13/8 = 1.625 21/13 = 1.6153846…
- 98. 1,1,2,3,5,8,13,21,34,55,…. 2/1 = 2 3/2 = 1.5 5/3 = 1.666… 8/5 = 1.6 13/8 = 1.625 21/13 = 1.6153846… 34/21 = 1.61904…
- 99. 1,1,2,3,5,8,13,21,34,55,…. 2/1 = 2 3/2 = 1.5 5/3 = 1.666… 8/5 = 1.6 13/8 = 1.625 21/13 = 1.6153846… 34/21 = 1.61904… φ = 1.6180339887498948482045
- 100. Pineapple whorls Church and Turing were both interested in the number of whorls in each ring of the spiral. The ratio of consecutive ring lengths approaches the Golden Ratio.
- 102. Proposition: Any finite continued fraction evaluates to a rational. Theorem Any rational has a finite continued fraction representation.
- 103. Hmm. Finite CFs = Rationals. Then what do infinite continued fractions represent?
- 104. An infinite continued fraction
- 105. Quadratic Equations • X2 – 3x – 1 = 0 • X2 = 3X + 1 • X = 3 + 1/X • X = 3 + 1/X = 3 + 1/[3 + 1/X] = …
- 106. A Periodic CF
- 107. Theorem: Any solution to a quadratic equation has a periodic continued fraction. Converse: Any periodic continued fraction is the solution of a quadratic equation. (try to prove this!)
- 108. So they express more than just the rationals… What about those non-recurring infinite continued fractions?
- 109. Non-periodic CFs
- 110. What is the pattern?
- 111. What is the pattern? No one knows!
- 112. What a cool representation! Finite CF: Rationals Periodic CF: Quadratic roots And some numbers reveal hidden regularity.
- 113. More good news: Convergents Let α = [a1, a2, a3, ...] be a CF. Define: C1 = [a1,0,0,0,0..] C2 = [a1,a2,0,0,0,...] C3 = [a1,a2,a3,0,0,...] and so on. Ck is called the k-th convergent of α α is the limit of the sequence C1, C2, C3,…
- 114. Best Approximator Theorem • A rational p/q is the best approximator to a real α if no rational number of denominator smaller than q comes closer to α.
- 115. Best Approximator Theorem • A rational p/q is the best approximator to a real α if no rational number of denominator smaller than q comes closer to α. BEST APPROXIMATOR THEOREM: Given any CF representation of α, each convergent of the CF is a best approximator for α !
- 116. Best Approximators of π C1 = 3 C2 = 22/7 C3 = 333/106 C4 = 355/113 C5 = 103993/33102 C6 =104348/33215
- 117. Continued Fraction Representation
- 118. Continued Fraction Representation
- 119. Remember? We already saw the convergents of this CF [1,1,1,1,1,1,1,1,1,1,1,…] are of the form Fib(n+1)/Fib(n) Hence:
- 120. 1,1,2,3,5,8,13,21,34,55,…. • 2/1 = 2 • 3/2 = 1.5 • 5/3 = 1.666… • 8/5 = 1.6 • 13/8 = 1.625 • 21/13 = 1.6153846… • 34/21 = 1.61904… • φ = 1.6180339887498948482045...
- 121. As we’ve seen...
- 122. Going the Other Way
- 123. What is the Power Series Expansion of z/(1-z-z2) ? What does this look like when we expand it as an infinite sum?
- 124. Since the bottom is quadratic we can factor it:
- 125. Write as a sum of two terms where Solving:
- 126. Now use the geometric series
- 128. The nth Fibonacci number is: Leonhard Euler (1765) J. P. M. Binet (1843) A de Moivre (1730)
- 131. 74 Recurrences and generating functions Golden ratio Continued fractions Convergents Closed form for Fibonaccis Here’s What You Need to Know…