Golden Ratio and Fibonacci Number Series

Images from Unsplash

Golden Ratio

History

The Golden Ratio is used in the construction of the pyramids of Giza and many other buildings. It is also used in many artist’s work and designs. The Golden Ratio is used much in art and architecture, because it pleases the human eye. This is because the human eye can interpret pictures and structures which use the Golden Ratio much faster than ones which do not use the the Golden Ratio in their structure or artwork. For example take the Mona Lisa. If you’ve seen it you’ll know how pretty it looks. You think it is pretty because it uses the Golden Ratio in it at multiple levels. So it is easy for your eye to interpret it, which makes you think it is pretty.

But if you are thinking that only humans use the Golden Ratio you are completely wrong. The Golden Ratio can be found in nature just as much as it is found man-made structure and art.

Many mathematicians have published work on it geometrically even before mathematician Pythagoras’s time. Some have gone as far as saying that the Golden Ratio is the world’s most astonishing number.

A Greek mathematician named Hippasus (530 to 450 B.C.E) proved that the Golden Ratio was not a whole number nor a fraction but an irrational number.

Algorithm

Here is how you get the Golden ratio.

Draw a square shown by the red lines in the figure above. Suppose the length of each side is 1. Now draw the symmetrical line that cuts the square in half horizontally. Since the length of one side of the square is one, half of that side must be ½. Now you get two rectangles of length 1 and width ½.

Draw the diagonal of the upper rectangle, as shown by the arrow in the above figure. The length of the diagonal is the √5/2. Place the point of the compass on the bottom end of the diagonal and draw an arc of radius equal to the length of the diagonal. So, every point on the arc is at a distance of √5/2 from the bottom of the diagonal.

You then draw a rectangle with the longer side size 1 on top of the original square, sharing the square’s upper side. The shorter side of the rectangle is drawn by extending the line until it intersects with the arc as shown in the above figure. The red square and the blue rectangle together make up the golden rectangle. The shorter side of this rectangle is 1 and its longer side is √5/2 + ½, so the ratio of the longer side to the shorter side is √5/2 + ½. Now I will explain why.

Consider a rectangle with shorter side a and shorter side a+b. This would be the golden rectangle if, (a+b)/a = a/b. For such a rectangle, if ɸ = a/b, then:

ɸ2 – ɸ – 1 = 0.

There are 2 ways to find ɸ. One of them is solving the quadratic equation ɸ2ɸ – 1 = 0. Solving the quadratic equation yields one positive and one negative value for ɸ. The positive value is the Golden Ratio which is √5/2 + ½. And so, as you discussed at the begging of the section, the ratio of the longer and shorter side is indeed √5/2 + ½.

The other way, is to solve it graphically. Let us see how to do that.

My Analysis

To solve it graphically, I wrote a program. Here is the code.

print("Welcome to the Golden Ratio program. I am going to show you the resuts I get after doing quadratic equation that ives us the golden ratio with a certain number using varios numbers until we find the one that gives us the golden ratio")

def gold():

    upper_limit = input("Give me the upper limit.")
    lower_limit = input("Give me the lower limit.")
    acc = input("Choose the number of data points between 2 consecutive integers.")
    upper_limit = int(upper_limit)
    lower_limit = int(lower_limit)
    acc = int(acc)
    f = open(f"ggraph{acc}.txt" , "w")

    for x in range(lower_limit * acc, upper_limit * acc, 1):

        f.write(f"{x/acc}   {(x ** 2)/acc**2 - x/acc -1}")
        f.write("\n")
    f.close()

tryit = "y"
while tryit == "y":
    gold()
    tryit = input("Type y to try again.")

This code asks the user to input a range of numbers. It then asks the user how many data points they want between two consecutive integers. The code tries to solve quadratic equation ɸ2 – ɸ – 1 = 0.

The code evaluates the left side of the equation for the values of ɸ in the given range. To calculate the Golden Ratio you need to find the value of ɸ for which the left side of the equation is 0, so that the equation is satisfied.

After I wrote the program, I played around with the numbers a bit. Here is the first plot I made. The X axis in the plot represents the value of ɸ which the program plugs into the left side of the equation. The Y axis represents the number that you get from plugging the value of ɸ into the left side of the equation ɸ2 – ɸ – 1= 0 and evaluating it. In green you can see 0. And in purple you can see the results you get from running the program.

Plot of ɸ2 – ɸ – 1 as a function of ɸ

As you can see in the plot above, it is not very clear which point it reaches 0 at, as there are two thousand points along the line shown. So, I zoom relevant part of the plot. You can view the plot in the image below.

Plot of ɸ2 – ɸ – 1 as a function of ɸ

Even now you can seen many, many of points and they are hardly distinguishable from each other. So to find the Golden Ratio I zoomed in to the set of ɸ values for which the left side of the equation evaluates close to 0.

As shown in the plot above, for ɸ = 1.61803 the number you calculate by evaluating the left side of the equation, is a negative number closest to 0. For ɸ = 1.61804 the number you calculate by evaluating the left side of the equation, is a positive number closest to 0. Since the first of these two consecutive ɸ values yields a negative value for the expression ɸ2 – ɸ – 1 and the other one yields a positive value, the ɸ value for which ɸ2 – ɸ – 1 = 0 must lie between them, i.e. 1.61803 < ɸ < 1.61804. Therefore ɸ = 1.6180 up to an accuracy of 4 decimal places.

We can use this method to calculate ɸ up to a higher accuracy by increasing the number of data points calculated by the code, between two consecutive integers.

Now I am going to tell you about the Fibonacci number series.

Fibonacci Number Series

The Fibonacci number series is an addition number series.

History of the Fibonacci

The Fibonacci number series has been found in Indian history especially when people used to speak in Sanskrit. According to Wikipedia some letters in Sanskrit are written is such a way that the Fibonacci series is embedded into them. Although the sequence was not used in Indian mathematics intentionally, Indians was the first in world to use the series. Mostly, the Fibonacci numbers were found in poetry with two syllables of different lengths. Some recorded work on the Fibonacci number series date back to even before 200 B.C.E. This was discovered because an Indian historian named Pingala was trying to read Sanskrit poetry.

Outside India, the sequence first appeared in a book by Fibonacci and that is how the sequence got its name. In the book, it is used to calculate the growth of the population of rabbits in year 1202 A.D..

Nature

The Fibonacci sequence is found in nature. Some examples are the core of a yellow chamomile, the spikes of a pine apple, the arrangement of leaves on the stems of some plants and many other things.

Algorithm

Start with values 0 and 1. The Fibonacci number sequence says that you have to add the previous two integers in the sequence to generate the next one. For example take the first three numbers of the Fibonacci number series. The first one is 0, the second is 1 and the third you need to calculate. To get the third number you add 0 and 1. 0 + 1 = 1. To get the fourth number you add 1 and 1 as they are the 2nd and 3rd terms of the sequence, the two before the fourth term. 1 + 1 = 2 so the 4th term is 2. In this way you can keep going forever.

My Analysis

I wrote a program, that outputs all the numbers of the Fibonacci numbers, up till a limit given by the user.

print("Welcome to the Fibonacci sequence program")

def loop():

    num1 = 0
    num2 = 1
    num3 = 0
    steps = 0
    series = [0, 1]
    i = 0

    limit = input("Give the number you want me to print the Fibonacci sequence till.")
    f = open(f"fb{limit}.txt" , "w")

    limit = int(limit)

    while num3 < limit:

        steps = steps + 1
        num3 = num1 + num2
        print(f"{steps} {num1} {num2} {num3}")
        num1 = num2
        num2 = num3
        series.append(num3)

    for i in range(0,steps + 2):
        f.write(f"{i + 1}   {series[i]}")
        f.write(f"\n")
    print(f" The number of steps less the limit is: {steps - 1}")
    f.close()
tryit = "Y"
while tryit == "Y":
    loop()
    tryit = input("Type Y to explore another Fibonacci series")

This program allowed me to plot the Fibonacci number series up till any number and see how it rises. I played with it. Here are some of the plots I made. In these plots, the y axis corresponds to the numbers in the Fibonacci series while x axis denotes their position in the series. 0 is the first number in Fibonacci series, so on an x-y plane it is x = 1, y = 0. Similarly number 49 is the 8th number in the sequence so on the x-y plane it is x = 8, y = 49. In the plot below I have shown the Fibonacci sequence for numbers till 12,345, which includes 20 terms.

Fibonacci numbers till 12,345

The shape that you can see in the plot is an exponential curve. Did you know that whatever range of numbers you use, you will always get this same shape, meaning, the curve will always look similar. Here are some plots to demonstrate this point. This one shows the Fibonacci numbers from 0 to 3,000,000. This plot includes 32 terms.

4th till 32nd term of the Fibonacci series

Now we will see it in parts. The first part includes numbers from the 4th to the 18th terms of the series.

Fourth till the eighteen term of the Fibonacci series

Here is the next part of the plot which includes all the terms from the 18th term to 32nd term.

18th till 32nd term of the Fibonacci series

In both the parts of the plot and the whole plot you can see that the shapes of the curves are very similar.

Fibonacci Squares

Here we will see how we can layout the Fibonacci number series in squares.

To start we need graph paper. Define the length of the side of a single square cell as length 1. Next draw a square with sides of length 1. Assume the value of length of each side of the square is the Fibonacci number represented by that square. So we get 1. We do not draw 0 as length 0 is length nothing, so it is not shown in the graph.

Box with side length 1

Now on the right side of the square draw another square, the same size as the previous one. From the figure below you can see they share a common side. Since the 1st square has sides of length 1, and both squares are the same size, each side of the second square will also be length 1. So the next number in the series is again 1.

Boxes with side length 1

But after that, if you combine the two squares, you get a rectangle with longer side 1 + 1 and shorter side 1. At first you only had a square with the length of it’s sides 1. So the largest square you could make, which shared a common side with the previous one was a square that was length 1. But now that is not the case. Instead of dealing with a square you are dealing with a rectangle. To make the largest possible square, sharing a side with the rectangle, you need to make from the longer side of the rectangle which is length 1+ 1. 1 + 1 = 2, so the next Fibonacci number is 2.

Rectangle with shorter side length 1 and longer side length 1 + 1 and square with side length 2

Similarly, now you have a rectangle with longer side 2+1 and shorter side length 1+1. Now to get the largest square possible you need to use length 2 + 1 as that is longer than 1 + 1. 2 + 1 = 3. So the next number in the sequence is 3.

Rectangle with shorter side length 2 and longer side length 2 + 1 and square with side length 2 + 1

If you the rules of the process, and you will keep generating Fibonacci numbers . At each step, you make a square, with the longer side of the largest rectangle. Here is a graph that shows the squares for numbers till 21.

Fibonacci numbers represented as squares
Image source Wikipedia

Relation Between the Fibonacci Number Series and the Golden Ratio

Remember how I mentioned two ways to find the value of the Golden Ratio, which are, solving the quadratic equation ɸ2ɸ – 1 = 0 and the other way is to solve it graphically. Let us find the connection between Fibonacci number series and the Golden Ratio.

When you divide each term of the Fibonacci series by the previous term of the sequence, the result will oscillate around the value of Golden Ratio.

I wrote a program that outputs the number you get by dividing a Fibonacci term by the previous one.

import math

def loop():

    num1 = 0.0
    num2 = 1.0
    num3 = 0.0
    steps = 0
    gold = 1.0
    golden = []
    ratio = math.sqrt(5.0)/2.0 + 1.0/2.0
    i = 0
    print(f" The golden ratio is {ratio}")
    limit = input("Give the number you want me to print the Fibonachhi sequence till.")
    f = open(f"goldif{limit}.txt" , "w")

    limit = float(limit)
    num1 = float(num1)
    num2 = float(num2)
    num3 = float(num3)
    gold = float(gold)

    while num3 < limit:

        steps = steps + 1
        num3 = num1 + num2
        gold = num3/num2
        print(f"{gold}")
        golden.append(gold)

        if gold > ratio:
            f.write(f"{steps}   {gold - ratio}")
            f.write("\n")
        else:
            f.write(f"{steps}   {ratio - gold}")
            f.write("\n")
        num1 = num2
        num2 = num3

    print(f" The number of steps less the limit is: {steps - 1}")
    f.close()
tryit = "Y"
while tryit == "Y":
    loop()
    tryit = input("Type Y to explore another Fibonacci series")

The plots below show the output of the code for the first 8 terms, compared to the Golden Ratio.

In green, is the value of the Golden Ratio and in purple is the output of the code.

Comparison of the results of the code and the Golden Ratio

As the series progresses the ratio of two consecutive Fibonacci numbers (larger number divided by smaller number) will get closer to the value of the Golden Ratio. So we are going to zoom in to the last 3 points of the plot, as they will be closest to the Golden Ratio.

Comparison of the results of the code and the Golden Ratio

You can see that none of the points actually touch the line which shows the Golden Ratio, but they come really close to touching it. In this plot, the Fibonacci term that comes closest to the Golden Ratio, is 8th term as only 8 terms have been shown.

Golden Spiral

If you draw the squares whose side length represent the Fibonacci numbers, following the procedure explained in the section titled Fibonacci Squares, and you draw the arc that is tangential to 2 adjacent sides as shown in the figure below, then the shape you get is called the Golden Spiral.

Image of the Golden Spiral

Golden Spiral in Nature

The Golden Spiral can be found in nature. Some examples of such an occurrence are, the arrangement of leaves on trees, the seed arrangement in the pollen of some flowers, and more.

We have shown a connection between two fascinating ideas in mathematics, the Golden Ratio and the Fibonacci number series. I was amazed when I found out that math and art had something in common even though it is not often not considered connected.

3 thoughts on “Golden Ratio and Fibonacci Number Series

  1. Wow! Brilliant! – Dada G needs a lecture from Prof Kinara Goyal to understand all this. let me know when the prof is free for a zoom call!

    Like

  2. Is it Euclid in the making with a paint brush and a touch of John Von Neumann.
    The stuff was lot of knowledge for me,. keep it up

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s