Golden ratio

87
The Golden Ratio, Fibonacci Numbers, And Other Recurrences Great Theoretical Ideas In Computer Science John Lafferty CS 15-251 Fall 2006 Lecture 13 October 10, 2006 Carnegie Mellon University

description

 

Transcript of Golden ratio

  • 1. Great Theoretical Ideas In Computer Science John LaffertyCS 15-251Fall 2006 Lecture 13October 10, 2006Carnegie Mellon UniversityThe Golden Ratio, Fibonacci Numbers, And Other Recurrences

2. Leonardo FibonacciIn 1202, Fibonacci proposed a problem about the growth of rabbit populations. 3. Inductive Definition orRecurrence Relation for theFibonacci NumbersStage 0, Initial Condition, or Base Case: Fib(0) = 0; Fib (1) = 1Inductive Rule For n>1, Fib(n) = Fib(n-1) + Fib(n-2)n0 1 2 34 5 6 7 Fib(n) 0 1 1 23 5 8 13 4. Sneezwort (Achilleaptarmica)Each time the plant starts a new shootit takes two months before it is strongenough to support branching. 5. Counting Petals5 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, theasteraceae family. 6. 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. 7. Bernoulli Spiral When the growth of the organism isproportional to its size 8. Bernoulli Spiral When the growth of the organism isproportional to its size 9. Is therelife after and e?Golden Ratio: the divine proportion = 1.6180339887498948482045Phi is named after the Greek sculptor Phidias 10. Definition of (Euclid) 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.AC AB==AB BCA B C AC = 2 BC AC AB BC = 2 ==1 BC BC BC2 1 = 0 11. Expanding Recursively 1 = 1+ 1 = 1+ 1 1+ 1 = 1+ 1 1+ 1 1+ 12. Continued Fraction Representation 1 =1+ 11+ 1 1+ 11+ 1 1+ 11+ 1 1+ 1 1+1 1+1+.... 13. Continued Fraction Representation1+ 51=1+ 2 11+ 1 1+ 11+ 1 1+ 11+ 1 1+ 1 1+ 1 1+1 + .... 14. Remember?We already saw the convergents of this CF[1,1,1,1,1,1,1,1,1,1,1,] are of the formFib(n+1)/Fib(n) Fn1+ 5Hence: limn==Fn1 2 15. Continued Fraction Representation 1 =1+ 11+ 1 1+ 11+ 1 1+ 11+ 1 1+ 1 1+1 1+1+.... 16. 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 17. Continued fraction representation of a standard fraction 67 1 = 2+29 13+1 4+2 18. 6711 1= 2+= 2+2+ 2929 2 1 3+3+ 99 14+2 e.g., 67/29 = 2 with remainder 9/29 = 2 + 1/ (29/9) 19. A Representational Correspondence6711 1= 2+= 2+2+ 2929 2 1 3+3+ 99 14+2 Euclid(67,29) 67 div 29 = 2Euclid(29,9) 29 div 9 = 3Euclid(9,2)9 div 2 = 4Euclid(2,1)2 div 1 =2Euclid(1,0) 20. Euclids GCD = Continued FractionsA A 1= + B BB A mod B Euclid(A,B) = Euclid(B, A mod B)Stop when B=0Theorem: All fractions have finite continuous fraction expansions 21. Let us take a slight detour and look at a different representation. 22. Sequences That Sum To nLet fn+1 be the number of different sequences of 1s and 2s that sum to n.Example: f5 = 5 23. Sequences That Sum To nLet fn+1 be the number of different sequences of 1s and 2s that sum to n.Example: f5 = 5 4= 2+2 2+1+1 1+2+1 1+1+2 1+1+1+1 24. Sequences That Sum To nLet fn+1 be the number of different sequences of 1s and 2s that sum to n. f1 f3 f2 25. Sequences That Sum To nLet fn+1 be the number of different sequences of 1s and 2s that sum to n.f1 = 1f3 = 20 = the empty sum 2=1+1 2 f2 = 11=1 26. Sequences That Sum To nLet fn+1 be the number of different sequences of 1s and 2s that sum to n. fn+1 = fn + fn-1 27. Sequences That Sum To nLet fn+1 be the number of different sequences of 1s and 2s that sum to n. fn+1 = fn + fn-1# of # ofsequencessequencesbeginningbeginning with a 1 with a 2 28. Fibonacci Numbers Again Let fn+1 be the number of different sequences of 1s and 2s that sum to n. fn+1 = fn + fn-1 f1 = 1f2 = 1 29. Visual Representation: TilingLet fn+1 be the number of different ways to tile a 1 n strip with squares and dominoes. 30. Visual Representation: TilingLet fn+1 be the number of different ways to tile a 1 n strip with squares and dominoes. 31. Visual Representation: Tiling1 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: 32. fn+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. 33. Lets use this visualrepresentation toprove a couple of Fibonacci identities. 34. Fibonacci IdentitiesSome examples:F2n = F1 + F3 + F5 + + F2n-1Fm+n+1 = Fm+1 Fn+1 + Fm Fn(Fn)2 = Fn-1 Fn+1 + (-1)n 35. Fm+n+1 = Fm+1 Fn+1 + Fm Fnmnm-1 n -1 36. (Fn)2 = Fn-1 Fn+1 + (-1)n 37. (Fn)2 = Fn-1 Fn+1+ (-1)nn-1Fn tilings of a strip of length n-1 38. (Fn)2 = Fn-1 Fn+1 + (-1)n n-1n-1 39. (Fn)2 = Fn-1 Fn+1 +(-1)n n (Fn)2 tilings of two strips of size n-1 40. (Fn)2 = Fn-1 Fn+1+(-1)nnDraw a vertical faultline at the rightmostposition (X(1+X)/(1-X)3 outputs The kth entry is k2 77. X(1+X)/(1-X)3 = k2Xk What does X(1+X)/(1-X)4 do? 78. X(1+X)/(1-X)4 expands to : Sk Xkwhere Sk is the sum of thefirst k squares 79. Aha! Thus, if there is an alternative interpretation of the kth coefficient of X(1+X)/(1-X)4we would have a new way to get a formula for the sum ofthe first k squares. 80. Using pirates and gold wefound that:1 n + k 1 k n= X (1 X ) k =0 n -1 THUS: 1 k + 3 k4= X (1 X ) k =0 3 81. Coefficient of Xk in PV = (X2+X)(1-X)-4 is the sum of the first k squares: 1 k + 3 k4= X (1 X ) k =0 3 82. Polynomials give us closed formexpressions 83. REFERENCESCoxeter, H. S. M. ``The Golden Section, Phyllotaxis, and Wythoff's Game.'' Scripta Mathematica 19, 135-143, 1953."Recounting Fibonacci and Lucas Identities" by Arthur T. Benjamin and Jennifer J. Quinn, College Mathematics Journal, Vol. 30(5): 359--366, 1999. 84. Fibonacci NumbersArise everywhereVisual RepresentationsFibonacci IdentitiesPolynomialsThe infinite geometric seriesDivision of polynomialsRepresentation of Fibonacci numbers as coefficients of polynomials.Generating Functions and Power SeriesSimple operations (add, multiply)Quadratic form of the Geometric SeriesDeriving the closed form for Fn Study BeePirates and goldSum of squares once again!