Nature's code - a Fibonacci appreciation post
Tags: mathematics, fun, fibonacci, sequences
Published: 2020-07-04 02:23:05

---
title: Nature's code - a Fibonacci appreciation post
published: true
description: 
tags: mathematics, fun, fibonacci, sequences
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/kh9606h9s8njf72nlx86.jpg
---

Some of us were likely introduced to "Fibonacci sequence" in early Programming/Math classes. It is a Mathematical sequence that goes like this:

>1, 1, 2, 3, 5, 8, 13, 21...and so on

Fibonacci sequence, was just that, a sequence to me until recently, when I learnt about all the magic it beholds. My sister and I were having a conversation about patterns and somehow it veered towards the Fibonacci sequence. She told me that the fibonacci pattern can be widely observed in nature. This was totally news to me and I was low-key bummed I did not know this earlier. But hey, better late than never, right? So I looked this up online and this post distills how Fibonacci sequence serves as the nature's code.

###What is the Fibonacci pattern?

The pattern here is that each number in the sequence can be generated by adding up the previous 2 numbers.

####For example:

The 6th number in the sequence is 8 which can be generated as the sum of 5 and 3 which are the 5th and 4th numbers in the sequence respectively.

Thus the nth number in the sequence can be mathematically represented as: 

>x(n) = x(n-2) + x(n-1)

###Fibonacci sequence - visualized

To get a better idea of the picture, let us visualize the sequence in a pictorial format. The sequence can be visualized by stacking together boxes in the following way:

1. First let us start with a square-box of dimension 1
2. Move in anti-clockwise direction and stack another square-box along the length of the rectangle formed so far. The dimension of this new square-box should be the length of the rectangle formed so far.

####Let us go step by step:
1. We start with a square-box of dimension 1
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/sb7m5ovfojldj0f2gh81.png)
2. The length of the rectangle formed so far is 1. So we will stack a square-box of size 1 along the length of the rectangle formed so far.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jg0fzswkb6cs5azveziz.png)
3. The length of the rectangle formed so far is 2. So we will stack a square-box of dimension 2 along the length of the rectangle formed so far.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/u0qoarxa8zc1a6rbnwxy.png)
4. The length of the rectangle formed so far is 3. So we will stack a square-box of dimension 3 along the length of the rectangle formed so far.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ejldvh8g3rph66xo77gf.png)
5. The length of the rectangle formed so far is 5. So we will stack a square-box of dimension 5 along the length of the rectangle formed so far.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/sxykxap8w0hrowe0kj27.png)
6. And we can continue to stack boxes like this
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hnepvr8015qdxn1o3kob.png)

Let us note down the dimension of the squares stacked in this process:

1,1,2,3,5,8,13,21, .... The fibonacci sequence!

###The fibonacci spiral

Onto furthermore fun stuff. Let us trace a curve starting from the first square and move in the anti-clockwise direction covering the boxes along the way.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pb7rbgv3r4s0vo2lxc0a.jpg)

Does this curve look familiar? This is the fibonacci spiral and can be found in a lot of places such as :

1. [The Nautilus shell](https://www.goldennumber.net/nautilus-spiral-golden-ratio/)
2. [Pine Cones](https://www.khanacademy.org/math/math-for-fun-and-glory/vi-hart/spirals-fibonacci/v/doodling-in-math-spirals-fibonacci-and-being-a-plant-1-of-3)
3. [Romanesque broccoli](http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibnat.html#veg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/q6piqnrtrsr7tc8vcs17.png)

The fibonacci spiral is so ubiquitous in nature, that it is fondly referred to as *the nature's code*. For example, plants prefer that all their leaves get maximum exposure from the Sun. This can be ensured by growing leaves at non-repeating angles so that the leaves don't overlap as much and get a fair share of exposure to sunshine. Phi (φ) which is of the value ~1.618 is an irrational number that guarantees this. Thus leaves generally shoot up at this angle. Also, take the ratio between any two adjacent numbers in the fibonacci sequence and you can see we move closer to the Phi value. 

1/1 = 1

2/1 = 2

3/2 = 1.5

5/3 = 1.66

8/5 = 1.6

13/8 = 1.625

21/13 = 1.615

... and so on, getting closer and closer to the value of Phi (φ) which is ~1.618. 

This number is also called the ***'Golden ratio'*** and has it's applications in various stuff universally such as [photography](https://expertphotography.com/golden-ratio-photography/), [art, architecture](http://jwilson.coe.uga.edu/EMT668/EMAT6680.2000/Obara/Emat6690/Golden%20Ratio/golden.html) and more.


Though fibonacci sequence can be spotted in a lot of places, some folks have claimed that we exaggerate and tend to force fit the pattern on things that don't necessarily adhere to it. This follows the idea that once we see a pattern, we are likely to carve out the same pattern in other things as well. That being said, I had lot of fun revisiting fibonacci sequence and learning them through an entirely different lens, hope you did too.

And oh hey, since you've made it this far, here is a joke for ya: 

>Why was Jim bad at making Fibonacci jokes? Because his last two jokes didn't add up 😛

###References

If you are hooked, def check [this video](https://www.youtube.com/watch?v=lOIP_Z_-0Hs) that has an excellent explanation of Fibonacci patterns in plants