SlideShare a Scribd company logo
1 of 87
Download to read offline
Great Theoretical Ideas In Computer Science
John Lafferty                                  CS 15-251    Fall 2006
Lecture 13      October 10, 2006            Carnegie Mellon University


             The Golden Ratio, Fibonacci
                Numbers, And Other
                    Recurrences
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            0   1   2   3    4       5   6   7


  Fib(n)       0   1   1   2    3       5   8   13
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
Bernoulli Spiral
When the growth of the organism is
     proportional to its size
Is there
                   life after
                    π and e?




   Golden Ratio: the divine proportion

   φ = 1.6180339887498948482045…

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


     AC AB
 φ=      =
     AB BC
                   A                             B         C
      AC
 φ =
  2

       BC
          AC AB BC
 φ −φ =
  2
              − =  =1
          BC BC BC
 φ2 − φ −1 = 0
Expanding Recursively
            1
   φ = 1+
            φ
                1
    = 1+
                    1
            1+
                    φ
                    1
    = 1+
                        1
            1+
                            1
                    1+
                            φ
Continued Fraction Representation
                                  1
 φ =1+
                                      1
         1+
                                          1
              1+
                                              1
                   1+
                                                  1
                        1+
                                                      1
                             1+
                                                          1
                                  1+
                                                              1
                                          1+
                                                       1
                                                  1+
                                                     1+....
Continued Fraction Representation

1+ 5                              1
     =1+
  2                                   1
         1+
                                          1
              1+
                                              1
                   1+
                                                  1
                        1+
                                                      1
                             1+
                                                          1
                                  1+
                                                              1
                                          1+
                                                        1
                                                  1+
                                                     1 + ....
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)


                    Fn      1+ 5
   Hence:   limn→∞      =φ=
                   Fn−1       2
Continued Fraction Representation
                                  1
 φ =1+
                                      1
         1+
                                          1
              1+
                                              1
                   1+
                                                  1
                        1+
                                                      1
                             1+
                                                          1
                                  1+
                                                              1
                                          1+
                                                       1
                                                  1+
                                                     1+....
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
Continued fraction representation of a
          standard fraction



       67         1
          = 2+
       29           1
               3+
                         1
                      4+
                         2
67      1        1         1
   = 2+    = 2+      2+
29      29         2         1
                3+      3+
        9          9           1
                           4+
                               2


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

67      1        1         1
   = 2+    = 2+      2+
29      29         2         1
                3+      3+
        9          9           1
                           4+
                               2
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

          A ⎢ A⎥             1
           =⎢ ⎥+
          B ⎣B⎦              B
                          A mod B
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 fn+1 be the number of different
sequences of 1’s and 2’s that sum to n.

Example: f5 = 5
Sequences That Sum To n

Let fn+1 be the number of different
sequences of 1’s and 2’s that sum to n.

Example: f5 = 5

     4=     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.


f1                         f3


f2
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                  f3 = 2
 0 = the empty sum       2=1+1
                            2
f2 = 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.


      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.


      fn+1 = fn + fn-1
   # of                         # of
 sequences                    sequences
 beginning                    beginning
  with a 1                     with a 2
Fibonacci Numbers Again

 Let fn+1 be the number of different
sequences of 1’s and 2’s that sum to n.



       fn+1 = fn + fn-1

       f1 = 1        f2 = 1
Visual Representation: Tiling

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

Let fn+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:
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.
Let’s use this visual
 representation to
 prove a couple of
Fibonacci identities.
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
Fm+n+1   = Fm+1 Fn+1   +       Fm Fn

            m              n




         m-1               n -1
(Fn)2   = Fn-1 Fn+1   +   (-1)n
(Fn)2   = Fn-1 Fn+1      +     (-1)n

              n-1




   Fn tilings of a strip of length n-1
(Fn)2   = Fn-1 Fn+1   +   (-1)n

             n-1




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

             n




  (Fn)2 tilings of two strips of size n-1
(Fn)2   = Fn-1 Fn+1    +      (-1)n

            n




                 Draw a vertical “fault
                 line” at the rightmost
                   position (<n) possible
                    without cutting any
                               dominoes
(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.
(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.
(Fn)2   = Fn-1 Fn+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 + X2
            ?
    1–X         1–X     1
                      -(1 – X)

                           X
                         -(X – X2)

                                   X2
                                 -(X2 – X3)
                                       X3 …


=    1 + X + X2 + X3 + X4 + X5 + X6 + X7 + …
Xn+1 - 1
1 + X1 + X2 + X3 + … + Xn-1 + Xn =
                                     X- 1




         The Geometric Series
Xn+1 - 1
1 + X1 + X2 + X3 + … + Xn-1 + Xn =
                                     X- 1




The limit as n goes to infinity of
       Xn+1 - 1
       X- 1
                  =          -1
                            X- 1


                  =           1
                            1-X
1
1+   X1   +   X2   +   X3   +…+   Xn   + ….. =
                                                 1-X




          The Infinite Geometric Series
1
1+   X1   +   X2   +   X3   +…+   Xn   + ….. =
                                                 1-X




(X-1) ( 1 + X1 + X2 + X 3 + … + Xn + … )
=           X1 + X2 + X 3 + …        + Xn + Xn+1 + ….
     - 1 - X1 - X2 - X 3 - … - Xn-1 – Xn - Xn+1 - …

=             1
1
1+   X1   +   X2   +   X3   +…+    Xn   + ….. =
                                                  1-X


                            1 + X + X2 + …
               1–X        1
                        -(1 – X)

                                X
                              -(X – X2)

                                     X2
                                   -(X2 – X3)
                                          X3 …
Something a bit more complicated

                     X + X2 + 2X3 + 3X4 + 5X5 + 8X6
       1 – X – X2     X
                    -(X – X2 – X3)

                          X2 + X3
                        -(X2 – X3 – X4)
   X
                              2X3 + X4
1 – X – X2                  -(2X3 – 2X4 – 2X5)

                                       3X4 + 2X5
                                     -(3X4 – 3X5 – 3X6)

                                            5X5 + 3X6
                                           -(5X5 – 5X6 – 5X7)
                                                   8X6 + 5X7
                                                 -(8X6 – 8X7 – 8X8)
Hence

     X
 1 – X – X2

= 0×1 + 1 X1 + 1 X2 + 2X3 + 3X4 + 5X5 + 8X6 + …


= F0 1 + F1 X1 + F2 X2 +F3 X3 + F4 X4 +
             F5 X5 + F6 X6 + …
Going the Other Way
                                                  F0 = 0, F1 = 1
(1 - X- X2) ×
     ( F0 1 + F1 X1 + F2 X2 + … + Fn-2 Xn-2 + Fn-1 Xn-1 + Fn Xn + …
Going the Other Way

(1 - X- X2) ×
     ( F0 1 + F1 X1 + F2 X2 + … + Fn-2 Xn-2 + Fn-1 Xn-1 + Fn Xn + …

= ( F0 1 + F1 X1 + F2 X2 + … + Fn-2 Xn-2 + Fn-1 Xn-1 + Fn Xn + …

        - F0 X1 - F1 X2 - … - Fn-3 Xn-2 - Fn-2 Xn-1 - Fn-1 Xn - …

                 - F0 X2 - … - Fn-4 Xn-2 - Fn-3 Xn-1 - Fn-2 Xn - …

= F0 1 + ( F1 – F0 ) X1
                                              F0 = 0, F1 = 1
=X
Thus

F0 1 + F1 X1 + F2 X2 + … + Fn-1 Xn-1 + Fn Xn + …

                                  X
                         =
                              1 – X – X2
So much for
trying to take a
  break from
 the Fibonacci
   numbers…
What is the Power Series
Expansion of x/(1-x-x2) ?

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-X2) =

       X/(1- φX)(1 – (-φ)-1X)

           where φ =

      “The Golden Ratio”
X
        (1 – φX)(1- (-φ)-1X)




=     ∑n=0..∞                  ?   Xn




    Linear factors on the bottom
(1 + aX1 + a2X2 + … + anXn + …..) (1 + bX1 + b2X2 + … + bnXn + …..) =

                                                         1
                                        =
                                               (1 – aX)(1-bX)


           =        ∑n=0..∞                   an+1 – bn+1
                                                             Xn
                                                 a- b




         Geometric Series (Quadratic Form)
1
        (1 – φX)(1- (-φ-1X)



                        φn+1 – (-φ-1)n+1
=    ∑n=0.. ∞                   √5
                                           Xn




Geometric Series (Quadratic Form)
X
         (1 – φX)(1- (-φ-1X)



                         φn+1 – (-φ-1)n+1 n+1
=     ∑n=0.. ∞                    √5
                                         X




    Power Series Expansion of F
∞
    x
           = F0 x + F1 x + F2 x + F3 x + L = ∑ Fi x
                 0      1      2      3             i

1− x − x 2
                                             i =0




                x        ∞
                               1 ⎛ i ⎛ 1 ⎞i ⎞ i
                       =∑        ⎜φ − ⎜ − ⎟ ⎟ x
            1− x − x            5⎜    ⎝ φ⎠ ⎟
                     2
                        i =0
                                 ⎝          ⎠
Leonhard Euler (1765)
 J. P. M. Binet (1843)
 A de Moivre (1730)




The ith Fibonacci number is:
      ∞
            1 ⎛ i ⎛ 1 ⎞i ⎞
     ∑        ⎜φ − ⎜ − ⎟ ⎟
             5⎜
     i =0
              ⎝    ⎝ φ⎠ ⎟⎠
φ       −
                 FG −1IJ   n
                                                 FG −1IJ   n


                  HφK                             HφK
           n

                                   φ   n
                                                               Less than
Fn =                           =               −                 .277
                  5                    5             5


Fn = closest integer to
                                           φ   n
                                                =
                                                  LM φ OP  n


                                               5 N 5Q
φ       −
                       FG −1IJ    n

                                                                                   −
                                                                                     FG −1IJ n


                        HφK                                                           HφK
                 n

 Fn                                                      φn
     =                                   =                                 +
Fn−1
         φ   n −1
                     −
                        FG −1IJ   n −1

                                             φ   n −1
                                                        −
                                                          FG −1IJ   n −1

                                                                               φ n−1−
                                                                                        FG −1IJ   n −1


                         HφK                               HφK                           HφK

                                                     Fn
                                      lim n→∞            =φ
                                                    Fn−1
What is the coefficient of
  Xk in the expansion of:

( 1 + X + X 2 + X3 + X4 + . . . . ) n ?


  Each path in the choice tree for the
  cross terms has n choices of exponent
  e1, e2, . . . , en ¸ 0. Each exponent can be
  any natural number.
    Coefficient of Xk is the number of
        non-negative solutions to:
           e1 + e2 + . . . + en = k
What is the coefficient of
  Xk in the expansion of:

( 1 + X + X 2 + X3 + X4 + . . . . ) n ?




             ⎛ n + k − 1⎞
             ⎜          ⎟
             ⎝   n -1 ⎠
( 1 + X + X 2 + X3 + X4 + . . . . ) n =

    1            ∞
                    ⎛ n + k − 1⎞ k
         n   = ∑⎜              ⎟X
(1 − X )       k =0 ⎝   n -1 ⎠
What is the coefficient of Xk in the
              expansion of:

(a0 + a1X + a2X2 + a3X3 + …) ( 1 + X + X2 + X3 + . . . )

   = (a0 + a1X + a2X2 + a3X3 + …) / (1 – X)        ?




                       a0 + a1 + a2 + .. + ak
(a0 + a1X + a2X2 + a3X3 + …) / (1 – X)

=            i =k
        ∞
           ⎛      ⎞ k
      ∑ ⎜ ∑ ai ⎟X
      k =0 ⎝ i =0 ⎠
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 <1, 4, 9, ..>

        X(1+X)/(1-X)3
outputs <0, 1, 4, 9, ..>

  The kth entry is k2
X(1+X)/(1-X)3 = ∑ k2Xk


What does X(1+X)/(1-X)4 do?
X(1+X)/(1-X)4 expands to :


         ∑ Sk Xk

where Sk is the sum of the
     first k squares
Aha! Thus, if there is an
alternative interpretation of
    the kth 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:


   1              ∞
                      ⎛ n + k − 1⎞ k
        n      = ∑⎜              ⎟X
(1 − X )         k =0 ⎝   n -1 ⎠


THUS:
    1             ∞
                      ⎛k + 3⎞ k
           4
               = ∑⎜         ⎟X
(1 − X )         k =0 ⎝  3 ⎠
Coefficient of Xk in PV = (X2+X)(1-X)-4 is
the sum of the first k squares:




                                1            ∞
                                                  ⎛k + 3⎞ k
                                       4
                                           = ∑⎜         ⎟X
                            (1 − X )         k =0 ⎝  3 ⎠
Polynomials give us closed form
         expressions
REFERENCES

Coxeter, 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.
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 Fn
Study Bee
             Pirates and gold
             Sum of squares once again!

More Related Content

Viewers also liked (8)

Golden ratio
Golden  ratioGolden  ratio
Golden ratio
 
Golden Ratio
Golden RatioGolden Ratio
Golden Ratio
 
Golden ratio
Golden ratioGolden ratio
Golden ratio
 
Golden ratio
Golden ratioGolden ratio
Golden ratio
 
Golden ratio
Golden ratioGolden ratio
Golden ratio
 
The Golden Mean
The Golden MeanThe Golden Mean
The Golden Mean
 
The Golden Ratio
The Golden RatioThe Golden Ratio
The Golden Ratio
 
The golden ratio
The golden ratioThe golden ratio
The golden ratio
 

More from Aarish Shahab

More from Aarish Shahab (13)

Computer sayri
Computer sayriComputer sayri
Computer sayri
 
Engl test 12
Engl test 12Engl test 12
Engl test 12
 
Goalsetting
GoalsettingGoalsetting
Goalsetting
 
Four part philosophy 97 03
Four part philosophy 97 03Four part philosophy 97 03
Four part philosophy 97 03
 
Aptitude test paper
Aptitude test paperAptitude test paper
Aptitude test paper
 
Time management
Time managementTime management
Time management
 
Overcommitment can kill your happiness
Overcommitment can kill your happinessOvercommitment can kill your happiness
Overcommitment can kill your happiness
 
Employee relations
Employee relationsEmployee relations
Employee relations
 
Overcommitment can kill your happiness
Overcommitment can kill your happinessOvercommitment can kill your happiness
Overcommitment can kill your happiness
 
Aptitude test
Aptitude testAptitude test
Aptitude test
 
Advt paper
Advt paperAdvt paper
Advt paper
 
Gwho101102 irma
Gwho101102 irmaGwho101102 irma
Gwho101102 irma
 
Gwho101101 iift
Gwho101101 iiftGwho101101 iift
Gwho101101 iift
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Golden ratio

  • 1. Great Theoretical Ideas In Computer Science John Lafferty CS 15-251 Fall 2006 Lecture 13 October 10, 2006 Carnegie Mellon University The Golden Ratio, Fibonacci Numbers, And Other Recurrences
  • 2. Leonardo Fibonacci In 1202, Fibonacci proposed a problem about the growth of rabbit populations.
  • 3. 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 0 1 2 3 4 5 6 7 Fib(n) 0 1 1 2 3 5 8 13
  • 4. Sneezwort (Achilleaptarmica) Each time the plant starts a new shoot it takes two months before it is strong enough to support branching.
  • 5. 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.
  • 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.
  • 8. Bernoulli Spiral When the growth of the organism is proportional to its size
  • 9. Bernoulli Spiral When the growth of the organism is proportional to its size
  • 10.
  • 11.
  • 12. Is there life after π and e? Golden Ratio: the divine proportion φ = 1.6180339887498948482045… “Phi” is named after the Greek sculptor Phidias
  • 13. 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 BC A B C AC φ = 2 BC AC AB BC φ −φ = 2 − = =1 BC BC BC φ2 − φ −1 = 0
  • 14. Expanding Recursively 1 φ = 1+ φ 1 = 1+ 1 1+ φ 1 = 1+ 1 1+ 1 1+ φ
  • 15. Continued Fraction Representation 1 φ =1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1+....
  • 16. Continued Fraction Representation 1+ 5 1 =1+ 2 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 + ....
  • 17. 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) Fn 1+ 5 Hence: limn→∞ =φ= Fn−1 2
  • 18. Continued Fraction Representation 1 φ =1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1 1+ 1+....
  • 19. 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
  • 20. Continued fraction representation of a standard fraction 67 1 = 2+ 29 1 3+ 1 4+ 2
  • 21. 67 1 1 1 = 2+ = 2+ 2+ 29 29 2 1 3+ 3+ 9 9 1 4+ 2 e.g., 67/29 = 2 with remainder 9/29 = 2 + 1/ (29/9)
  • 22. A Representational Correspondence 67 1 1 1 = 2+ = 2+ 2+ 29 29 2 1 3+ 3+ 9 9 1 4+ 2 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)
  • 23. Euclid’s GCD = Continued Fractions A ⎢ A⎥ 1 =⎢ ⎥+ B ⎣B⎦ B A mod B Euclid(A,B) = Euclid(B, A mod B) Stop when B=0 Theorem: All fractions have finite continuous fraction expansions
  • 24. Let us take a slight detour and look at a different representation.
  • 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. Example: f5 = 5
  • 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. Example: f5 = 5 4= 2+2 2+1+1 1+2+1 1+1+2 1+1+1+1
  • 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 f3 f2
  • 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 f3 = 2 0 = the empty sum 2=1+1 2 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. fn+1 = fn + fn-1
  • 30. Sequences That Sum To n Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. fn+1 = fn + fn-1 # of # of sequences sequences beginning beginning with a 1 with a 2
  • 31. Fibonacci Numbers Again Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n. fn+1 = fn + fn-1 f1 = 1 f2 = 1
  • 32. Visual Representation: Tiling Let fn+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.
  • 33. Visual Representation: Tiling Let fn+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.
  • 34. 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:
  • 35. 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.
  • 36. Let’s use this visual representation to prove a couple of Fibonacci identities.
  • 37. 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
  • 38. Fm+n+1 = Fm+1 Fn+1 + Fm Fn m n m-1 n -1
  • 39. (Fn)2 = Fn-1 Fn+1 + (-1)n
  • 40. (Fn)2 = Fn-1 Fn+1 + (-1)n n-1 Fn tilings of a strip of length n-1
  • 41. (Fn)2 = Fn-1 Fn+1 + (-1)n n-1 n-1
  • 42. (Fn)2 = Fn-1 Fn+1 + (-1)n n (Fn)2 tilings of two strips of size n-1
  • 43. (Fn)2 = Fn-1 Fn+1 + (-1)n n Draw a vertical “fault line” at the rightmost position (<n) possible without cutting any dominoes
  • 44. (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.
  • 45. (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.
  • 46. (Fn)2 = Fn-1 Fn+1 + (-1)n-1 n even n odd
  • 47. 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.
  • 49. Let’s take a break from the Fibonacci Numbers in order to talk about polynomial division.
  • 50. How to divide polynomials? 1 1 + X + X2 ? 1–X 1–X 1 -(1 – X) X -(X – X2) X2 -(X2 – X3) X3 … = 1 + X + X2 + X3 + X4 + X5 + X6 + X7 + …
  • 51. Xn+1 - 1 1 + X1 + X2 + X3 + … + Xn-1 + Xn = X- 1 The Geometric Series
  • 52. Xn+1 - 1 1 + X1 + X2 + X3 + … + Xn-1 + Xn = X- 1 The limit as n goes to infinity of Xn+1 - 1 X- 1 = -1 X- 1 = 1 1-X
  • 53. 1 1+ X1 + X2 + X3 +…+ Xn + ….. = 1-X The Infinite Geometric Series
  • 54. 1 1+ X1 + X2 + X3 +…+ Xn + ….. = 1-X (X-1) ( 1 + X1 + X2 + X 3 + … + Xn + … ) = X1 + X2 + X 3 + … + Xn + Xn+1 + …. - 1 - X1 - X2 - X 3 - … - Xn-1 – Xn - Xn+1 - … = 1
  • 55. 1 1+ X1 + X2 + X3 +…+ Xn + ….. = 1-X 1 + X + X2 + … 1–X 1 -(1 – X) X -(X – X2) X2 -(X2 – X3) X3 …
  • 56. Something a bit more complicated X + X2 + 2X3 + 3X4 + 5X5 + 8X6 1 – X – X2 X -(X – X2 – X3) X2 + X3 -(X2 – X3 – X4) X 2X3 + X4 1 – X – X2 -(2X3 – 2X4 – 2X5) 3X4 + 2X5 -(3X4 – 3X5 – 3X6) 5X5 + 3X6 -(5X5 – 5X6 – 5X7) 8X6 + 5X7 -(8X6 – 8X7 – 8X8)
  • 57. Hence X 1 – X – X2 = 0×1 + 1 X1 + 1 X2 + 2X3 + 3X4 + 5X5 + 8X6 + … = F0 1 + F1 X1 + F2 X2 +F3 X3 + F4 X4 + F5 X5 + F6 X6 + …
  • 58. Going the Other Way F0 = 0, F1 = 1 (1 - X- X2) × ( F0 1 + F1 X1 + F2 X2 + … + Fn-2 Xn-2 + Fn-1 Xn-1 + Fn Xn + …
  • 59. Going the Other Way (1 - X- X2) × ( F0 1 + F1 X1 + F2 X2 + … + Fn-2 Xn-2 + Fn-1 Xn-1 + Fn Xn + … = ( F0 1 + F1 X1 + F2 X2 + … + Fn-2 Xn-2 + Fn-1 Xn-1 + Fn Xn + … - F0 X1 - F1 X2 - … - Fn-3 Xn-2 - Fn-2 Xn-1 - Fn-1 Xn - … - F0 X2 - … - Fn-4 Xn-2 - Fn-3 Xn-1 - Fn-2 Xn - … = F0 1 + ( F1 – F0 ) X1 F0 = 0, F1 = 1 =X
  • 60. Thus F0 1 + F1 X1 + F2 X2 + … + Fn-1 Xn-1 + Fn Xn + … X = 1 – X – X2
  • 61. So much for trying to take a break from the Fibonacci numbers…
  • 62. What is the Power Series Expansion of x/(1-x-x2) ? What does this look like when we expand it as an infinite sum?
  • 63. Since the bottom is quadratic we can factor it. X / (1-X-X2) = X/(1- φX)(1 – (-φ)-1X) where φ = “The Golden Ratio”
  • 64. X (1 – φX)(1- (-φ)-1X) = ∑n=0..∞ ? Xn Linear factors on the bottom
  • 65. (1 + aX1 + a2X2 + … + anXn + …..) (1 + bX1 + b2X2 + … + bnXn + …..) = 1 = (1 – aX)(1-bX) = ∑n=0..∞ an+1 – bn+1 Xn a- b Geometric Series (Quadratic Form)
  • 66. 1 (1 – φX)(1- (-φ-1X) φn+1 – (-φ-1)n+1 = ∑n=0.. ∞ √5 Xn Geometric Series (Quadratic Form)
  • 67. X (1 – φX)(1- (-φ-1X) φn+1 – (-φ-1)n+1 n+1 = ∑n=0.. ∞ √5 X Power Series Expansion of F
  • 68. x = F0 x + F1 x + F2 x + F3 x + L = ∑ Fi x 0 1 2 3 i 1− x − x 2 i =0 x ∞ 1 ⎛ i ⎛ 1 ⎞i ⎞ i =∑ ⎜φ − ⎜ − ⎟ ⎟ x 1− x − x 5⎜ ⎝ φ⎠ ⎟ 2 i =0 ⎝ ⎠
  • 69. Leonhard Euler (1765) J. P. M. Binet (1843) A de Moivre (1730) The ith Fibonacci number is: ∞ 1 ⎛ i ⎛ 1 ⎞i ⎞ ∑ ⎜φ − ⎜ − ⎟ ⎟ 5⎜ i =0 ⎝ ⎝ φ⎠ ⎟⎠
  • 70. φ − FG −1IJ n FG −1IJ n HφK HφK n φ n Less than Fn = = − .277 5 5 5 Fn = closest integer to φ n = LM φ OP n 5 N 5Q
  • 71. φ − FG −1IJ n − FG −1IJ n HφK HφK n Fn φn = = + Fn−1 φ n −1 − FG −1IJ n −1 φ n −1 − FG −1IJ n −1 φ n−1− FG −1IJ n −1 HφK HφK HφK Fn lim n→∞ =φ Fn−1
  • 72. What is the coefficient of Xk in the expansion of: ( 1 + X + X 2 + X3 + X4 + . . . . ) n ? Each path in the choice tree for the cross terms has n choices of exponent e1, e2, . . . , en ¸ 0. Each exponent can be any natural number. Coefficient of Xk is the number of non-negative solutions to: e1 + e2 + . . . + en = k
  • 73. What is the coefficient of Xk in the expansion of: ( 1 + X + X 2 + X3 + X4 + . . . . ) n ? ⎛ n + k − 1⎞ ⎜ ⎟ ⎝ n -1 ⎠
  • 74. ( 1 + X + X 2 + X3 + X4 + . . . . ) n = 1 ∞ ⎛ n + k − 1⎞ k n = ∑⎜ ⎟X (1 − X ) k =0 ⎝ n -1 ⎠
  • 75. What is the coefficient of Xk in the expansion of: (a0 + a1X + a2X2 + a3X3 + …) ( 1 + X + X2 + X3 + . . . ) = (a0 + a1X + a2X2 + a3X3 + …) / (1 – X) ? a0 + a1 + a2 + .. + ak
  • 76. (a0 + a1X + a2X2 + a3X3 + …) / (1 – X) = i =k ∞ ⎛ ⎞ k ∑ ⎜ ∑ ai ⎟X k =0 ⎝ i =0 ⎠
  • 78. 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
  • 79. (1+X)/(1-X)3 outputs <1, 4, 9, ..> X(1+X)/(1-X)3 outputs <0, 1, 4, 9, ..> The kth entry is k2
  • 80. X(1+X)/(1-X)3 = ∑ k2Xk What does X(1+X)/(1-X)4 do?
  • 81. X(1+X)/(1-X)4 expands to : ∑ Sk Xk where Sk is the sum of the first k squares
  • 82. Aha! Thus, if there is an alternative interpretation of the kth 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.
  • 83. Using pirates and gold we found that: 1 ∞ ⎛ n + k − 1⎞ k n = ∑⎜ ⎟X (1 − X ) k =0 ⎝ n -1 ⎠ THUS: 1 ∞ ⎛k + 3⎞ k 4 = ∑⎜ ⎟X (1 − X ) k =0 ⎝ 3 ⎠
  • 84. Coefficient of Xk in PV = (X2+X)(1-X)-4 is the sum of the first k squares: 1 ∞ ⎛k + 3⎞ k 4 = ∑⎜ ⎟X (1 − X ) k =0 ⎝ 3 ⎠
  • 85. Polynomials give us closed form expressions
  • 86. REFERENCES Coxeter, 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.
  • 87. 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 Fn Study Bee Pirates and gold Sum of squares once again!