The Golden Ratio, Fibonacci Numbers, And Other Recurrences Great Theoretical Ideas In Computer Science John LaffertyCS 15-251 Fall 2006 Lecture 13October.

Slides:



Advertisements
Similar presentations
Recurrences and Continued Fractions Great Theoretical Ideas In Computer Science V. Adamchik D. Sleator CS Spring 2010 Lecture 8 Feb 04, 2010 Carnegie.
Advertisements

Factoring Polynomials
Lecture 3: Reduce to known problem Convex Hull (section 33.3 of CLRS). Suppose we have a bunch of points in the plane, given by their x and y coordinates.
Counting III: Pascal’s Triangle, Polynomials, and Vector Programs Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2003 Lecture.
CPE 130 Algorithms and Data Structures Recursion Asst. Prof. Dr. Nuttanart Facundes.
Ancient Wisdom: Primes, Continued Fractions, The Golden Ratio, and Euclid’s GCD Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall.
Fibonacci Sequences Susan Leggett, Zuzana Zvarova, Sara Campbell
Counting II: Recurring Problems And Correspondences Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 10Feb 12, 2004Carnegie.
Counting II: Pascal, Binomials, and Other Tricks Great Theoretical Ideas In Computer Science A. Gupta D. Sleator CS Fall 2010 Lecture 8Sept. 16,
The Fibonacci Numbers And An Unexpected Calculation. Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 7Feb 3, 2004Carnegie.
Great Theoretical Ideas in Computer Science.
The sequence begins with one. Each subsequent number is the sum of the two preceding numbers. The sequence begins with one. Each subsequent number is.
ISU CCEE BioE 202: Aesthetics The Golden Section – its origin and usefulness in engineering.
Fibonacci Numbers.
Discovering Fibonacci
FIBONACCI NUMBERS 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, ,
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Great Theoretical Ideas in Computer Science for Some.
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas in Computer Science for Some.
Advanced Counting Techniques
Maths in Nature By Keith Ball.
Fibonacci Numbers, Polynomial Coefficients, and Vector Programs.
Slide 5-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 9 The Mathematics of Spiral Growth 9.1Fibonacci’s Rabbits 9.2Fibonacci.
The Mathematical Formula of Life
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
From Counting to Pascal: A Journey through Number Theory, Geometry, and Calculus NYS Master Teachers March 9, 2015 Dave Brown – Slides.
Great Theoretical Ideas in Computer Science.
Counting III: Pascal’s Triangle, Polynomials, and Vector Programs Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2003 Lecture.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Great Theoretical Ideas in Computer Science.
The Golden Mean The Mathematical Formula of Life Life.
Fibonacci Numbers, Vector Programs and a new kind of science.
COMPSCI 102 Discrete Mathematics for Computer Science.
COMPSCI 102 Discrete Mathematics for Computer Science.
Great Theoretical Ideas in Computer Science.
COMPSCI 102 Introduction to Discrete Mathematics.
Introduction to Fibonacci number
Counting II: Recurring Problems And Correspondences Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2005 Lecture 7Sept 20, 2005Carnegie.
Choose Your Representation! Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2005 Lecture 14 Feb 24, 2005 Carnegie Mellon University.
ADVANCED ALGORITHMS REVIEW OF ANALYSIS TECHNIQUES (UNIT-1)
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Counting II: Recurring Problems And Correspondences Great Theoretical Ideas In Computer Science V. AdamchikCS Spring 2006 Lecture 6Feb 2, 2005Carnegie.
Recurrences, Phi and CF Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 13 Feb 28, 2006 Carnegie Mellon.
Based on Lecture Slides from Steven Rudich, CMU 15 a.
The Golden Ratio What is it? Also known as Phi (rhymes with fly)
COMPSCI 102 Introduction to Discrete Mathematics.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
Fibonacci Numbers Based on the following PowerPoint's
The Mathematical Formula of Life
A Number You Can Call Your Own
Induction: One Step At A Time
Counting III: Pascal’s Triangle, Polynomials, and Vector Programs
Great Theoretical Ideas in Computer Science
The Fibonacci Numbers And An Unexpected Calculation
Great Theoretical Ideas in Computer Science
The Golden Ratio, Fibonacci Numbers, And Other Recurrences
Infinite Geometric Series
Great Theoretical Ideas in Computer Science
Great Theoretical Ideas in Computer Science
Great Theoretical Ideas In Computer Science
Induction: One Step At A Time
Induction: One Step At A Time
The Mathematical Formula of Life
Counting III: Pascal’s Triangle, Polynomials, and Vector Programs
Counting II: Recurring Problems And Correspondences
Induction: One Step At A Time
Presentation transcript:

The Golden Ratio, Fibonacci Numbers, And Other Recurrences Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2006 Lecture 13October 10, 2006Carnegie Mellon University

Leonardo Fibonacci In 1202, Fibonacci proposed a problem about the growth of rabbit populations.

Inductive Definition or Recurrence Relation for the Fibonacci Numbers Stage 0, Initial Condition, or Base Case: Fib(0) = 0; Fib (1) = 1 Inductive Rule For n>1, Fib(n) = Fib(n-1) + Fib(n-2) n Fib(n)

Sneezwort (Achilleaptarmica) Each time the plant starts a new shoot it takes two months before it is strong enough to support branching.

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.

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.

Bernoulli Spiral When the growth of the organism is proportional to its size

Is there life after  and  e  Golden Ratio: the divine proportion  = … “Phi” is named after the Greek sculptor Phidias

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. ABC

Pentagon

Expanding Recursively

Continued Fraction Representation

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:

Continued Fraction Representation

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= /13= … 34/21= …  =

Continued fraction representation of a standard fraction

e.g., 67/29 = 2 with remainder 9/29 = 2 + 1/ (29/9)

A Representational Correspondence Euclid(67,29) 67 div 29 = 2 Euclid(29,9)29 div 9 = 3 Euclid(9,2)9 div 2 = 4 Euclid(2,1)2 div 1 = 2 Euclid(1,0)

Euclid’s GCD = Continued Fractions Euclid(A,B) = Euclid(B, A mod B) Stop when B=0 Theorem: All fractions have finite continuous fraction expansions

Let us take a slight detour and look at a different representation.

Sequences That Sum To n Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n. Example: f 5 = 5

Sequences That Sum To n Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n. Example: f 5 = 5 4 =

Sequences That Sum To n f1f1 f2f2 f3f3 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n.

Sequences That Sum To n f 1 = 1 0 = the empty sum f 2 = 1 1 = 1 f 3 = 2 2 = Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n.

Sequences That Sum To n f n+1 = f n + f n-1 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n.

Sequences That Sum To n f n+1 = f n + f n-1 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n. # of sequences beginning with a 2 # of sequences beginning with a 1

Fibonacci Numbers Again f n+1 = f n + f n-1 f 1 = 1 f 2 = 1 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n.

Visual Representation: Tiling Let f n+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.

Visual Representation: Tiling Let f n+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.

Visual Representation: Tiling 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:

f n+1 = f n + f n-1 f n+1 is number of ways to tile length n. f n tilings that start with a square. f n-1 tilings that start with a domino.

Let’s use this visual representation to prove a couple of Fibonacci identities.

Fibonacci Identities Some examples: F 2n = F 1 + F 3 + F 5 + … + F 2n-1 F m+n+1 = F m+1 F n+1 + F m F n (F n ) 2 = F n-1 F n+1 + (-1) n

F m+n+1 = F m+1 F n+1 + F m F nmn m-1n-1

(F n ) 2 = F n-1 F n+1 + (-1) n

n-1 F n tilings of a strip of length n-1

(F n ) 2 = F n-1 F n+1 + (-1) nn-1 n-1

n (F n ) 2 tilings of two strips of size n-1

(F n ) 2 = F n-1 F n+1 + (-1) n n Draw a vertical “fault line” at the rightmost position (<n) possible without cutting any dominoes

(F n ) 2 = F n-1 F n+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.

(F n ) 2 = F n-1 F n+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.

(F n ) 2 = F n-1 F n+1 + (-1) n-1 n even n odd

More random facts The product of any four consecutive Fibonacci numbers is the area of a Pythagorean triangle. The sequence of final digits in Fibonacci numbers repeats in cycles of 60. The last two digits repeat in 300, the last three in 1500, the last four in 15,000, etc. Useful to convert miles to kilometers.

The Fibonacci Quarterly

Let’s take a break from the Fibonacci Numbers in order to talk about polynomial division.

How to divide polynomials? 1 1 – X ? 1 1 -(1 – X) X + X -(X – X 2 ) X2X2 + X 2 -(X 2 – X 3 ) X3X3 = 1 + X + X 2 + X 3 + X 4 + X 5 + X 6 + X 7 + … …

1 + X 1 + X 2 + X 3 + … + X n-1 + X n = 1 + X 1 + X 2 + X 3 + … + X n-1 + X n = X n X - 1 The Geometric Series

1 + X 1 + X 2 + X 3 + … + X n-1 + X n = 1 + X 1 + X 2 + X 3 + … + X n-1 + X n = X n X - 1 The limit as n goes to infinity of X n X - 1 = - 1 X - 1 = X

1 + X 1 + X 2 + X 3 + … + X n + ….. = 1 + X 1 + X 2 + X 3 + … + X n + ….. = X The Infinite Geometric Series

(X-1) ( 1 + X 1 + X 2 + X 3 + … + X n + … ) = X 1 + X 2 + X 3 + … + X n + X n+1 + … X 1 - X 2 - X 3 - … - X n-1 – X n - X n+1 - … = X 1 + X 2 + X 3 + … + X n + ….. = 1 + X 1 + X 2 + X 3 + … + X n + ….. = X

1 + X 1 + X 2 + X 3 + … + X n + ….. = 1 + X 1 + X 2 + X 3 + … + X n + ….. = X 1 – X1 1 -(1 – X) X + X -(X – X 2 ) X2X2 + X 2 + … -(X 2 – X 3 ) X3X3 …

X 1 – X – X 2 Something a bit more complicated 1 – X – X 2 X X 2 + X 3 -(X – X 2 – X 3 ) X 2X 3 + X 4 -(X 2 – X 3 – X 4 ) + X 2 -(2X 3 – 2X 4 – 2X 5 ) + 2X 3 3X 4 + 2X 5 + 3X 4 -(3X 4 – 3X 5 – 3X 6 ) 5X 5 + 3X 6 + 5X 5 -(5X 5 – 5X 6 – 5X 7 ) 8X 6 + 5X 7 + 8X 6 -(8X 6 – 8X 7 – 8X 8 )

Hence = F F 1 X 1 + F 2 X 2 +F 3 X 3 + F 4 X 4 + F 5 X 5 + F 6 X 6 + … X 1 – X – X 2 = 0  X X 2 + 2X 3 + 3X 4 + 5X 5 + 8X 6 + …

Going the Other Way (1 - X- X 2 )  ( F F 1 X 1 + F 2 X 2 + … + F n-2 X n-2 + F n-1 X n-1 + F n X n + … F 0 = 0, F 1 = 1

Going the Other Way (1 - X- X 2 )  ( F F 1 X 1 + F 2 X 2 + … + F n-2 X n-2 + F n-1 X n-1 + F n X n + … = ( F F 1 X 1 + F 2 X 2 + … + F n-2 X n-2 + F n-1 X n-1 + F n X n + … - F 0 X 1 - F 1 X 2 - … - F n-3 X n-2 - F n-2 X n-1 - F n-1 X n - … - F 0 X 2 - … - F n-4 X n-2 - F n-3 X n-1 - F n-2 X n - … = F ( F 1 – F 0 ) X 1 F 0 = 0, F 1 = 1 = X

Thus F F 1 X 1 + F 2 X 2 + … + F n-1 X n-1 + F n X n + … X 1 – X – X 2 =

So much for trying to take a break from the Fibonacci numbers…

What is the Power Series Expansion of x/(1-x-x 2 ) ? What does this look like when we expand it as an infinite sum?

Since the bottom is quadratic we can factor it. X / (1-X-X 2 ) = X/(1-  X)(1 – (-  ) -1 X) where  = “The Golden Ratio”

X (1 –  X)(1- (-  ) -1 X) Linear factors on the bottom  n=0..∞ = XnXn ?

( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 (1 – aX)(1-bX) Geometric Series (Quadratic Form) a n+1 – b n+1 a - b  n=0..∞ XnXn = =

1 (1 –  X)(1- (-  -1 X) Geometric Series (Quadratic Form)  n+1 – (-  - 1) n+1 √5√5√5√5  n=0.. ∞ = XnXn

X (1 –  X)(1- (-  -1 X) Power Series Expansion of F  n+1 – (-  - 1) n+1 √5√5√5√5  n=0.. ∞ = X n+1

The i th Fibonacci number is: Leonhard Euler (1765) J. P. M. Binet (1843) A de Moivre (1730)

Less than.277

What is the coefficient of X k in the expansion of: ( 1 + X + X 2 + X 3 + X ) n ? Each path in the choice tree for the cross terms has n choices of exponent e 1, e 2,..., e n ¸ 0. Each exponent can be any natural number. Coefficient of X k is the number of non-negative solutions to: e 1 + e e n = k

What is the coefficient of X k in the expansion of: ( 1 + X + X 2 + X 3 + X ) n ?

( 1 + X + X 2 + X 3 + X ) n =

What is the coefficient of X k in the expansion of: (a 0 + a 1 X + a 2 X 2 + a 3 X 3 + …) ( 1 + X + X 2 + X ) = (a 0 + a 1 X + a 2 X 2 + a 3 X 3 + …) / (1 – X) ? a 0 + a 1 + a a k

(a 0 + a 1 X + a 2 X 2 + a 3 X 3 + …) / (1 – X) =

Some simple power series

Al-Karaji’s Identities Zero_Ave = 1/(1-X); First_Ave = 1/(1-X) 2 ; Second_Ave = 1/(1-X) 3 ; Output = 1/(1-X) 2 + 2X/(1-X) 3 = (1-X)/(1-X) 3 + 2X/(1-X) 3 = (1+X)/(1-X) 3

(1+X)/(1-X) 3 outputs outputs X(1+X)/(1-X) 3 outputs outputs The k th entry is k 2 The k th entry is k 2

X(1+X)/(1-X) 3 =  k 2 X k What does X(1+X)/(1-X) 4 do?

X(1+X)/(1-X) 4 expands to :  S k X k where S k is the sum of the first k squares

Aha! Thus, if there is an alternative interpretation of the k th coefficient of X(1+X)/(1-X) 4 we would have a new way to get a formula for the sum of the first k squares.

Using pirates and gold we found that: THUS:

Coefficient of X k in P V = (X 2 +X)(1-X) -4 is the sum of the first k squares:

Polynomials give us closed form expressions

REFERENCES Coxeter, H. S. M. ``The Golden Section, Phyllotaxis, and Wythoff's Game.'' Scripta Mathematica 19, , "Recounting Fibonacci and Lucas Identities" by Arthur T. Benjamin and Jennifer J. Quinn, College Mathematics Journal, Vol. 30(5): , 1999.

Study Bee Fibonacci Numbers Arise everywhere Visual Representations Fibonacci Identities Polynomials The infinite geometric series Division of polynomials Representation of Fibonacci numbers as coefficients of polynomials. Generating Functions and Power Series Simple operations (add, multiply) Quadratic form of the Geometric Series Deriving the closed form for F n Pirates and gold Sum of squares once again!