uyhjjddddddddddd Web Optimisation, Maths and Puzzles: fibonacci

Header tag

Showing posts with label fibonacci. Show all posts
Showing posts with label fibonacci. Show all posts

Thursday, 30 June 2016

Revisiting Fibonacci Constants

In a previous post (four years ago), I explained the Fibonacci Series - where it comes from, how it originates, and how it can appear in nature.  I also talked about the golden ratio, which is the ratio between subsequent terms in the Fibonacci Series.

I've been doing some further reading and research on the Fibonacci Series, and have been doing some of my own calculations and investigations.

Firstly:  what happens if we extend the series, so that instead of just summing the two previous terms, we sum the three previous terms, or the four or five previous?

This has been done before (I wasn't too surprised), and these are known as the following:
Fibonacci - 2 terms
Tribonacci - 3 terms
Tetranacci (or quadranacci) - 4 terms
Quintanacci (or pentanacci) - 5 terms
Hexanacci - 6 terms


I struggled to find names for the higher-number terms, so I'm going to submit my own.

Heptanacci - 7 terms
Octanacci - 8 terms
Nonancci - 9 terms
Decanacci - 10 terms

I stopped at 10, as I found that the data I'd accumulated was enough to draw some interesting conclusions from.  Here are the first few terms of each of the series:

Fib:  0,1,1,2,3,5,8,13,21,34,55,89,144,233,377
Trib:  0,0,1,1,2,4,7,13,24,44,81,149,274,504,927
Tetra: 0,0,0,1,1,2,4,8,15,29,56,108,208,401,773
Quint: 0,0,0,0,1,1,2,4,8,16,31,61,120,236,464
Hex: ...0,0,1,1,2,4,8,16,32,63,125,248
Hept:  ...0,0,1,1,2,4,8,16,32,64,127
Oct: ...0,1,1,2,4,8,16,32,64,128,255,509,1016,2028,4048,8080,16128
Non:  ...0,1,1,2,4,8,16,32,64,128,256,511,1021,2040,4076,8144
Dec: ..,0,1,1,2,4,8,16,32,64,128,256,512,1023,2045,4088

Taking this raw data, I then started to look at the ratios between subsequent terms.  We've seen previously that the Fibonacci series has the golden ratio 1.61803... or (1+ sqrt(5))/2 but what about the other series?

Fib 1.61803
Trib 1.83929
Tetra 1.92756
Quint 1.965948
Hex 1.983583
Hept 1.991964
Oct 1.996031
Non 1.998029
Dec 1.999019

I haven't identified the expressions for each of these but have found from research that the tetranacci constant satisfies x + x-4 = 2.  

Plotting the number of terms being summed (or the n-number for the series) against the ratio gives this graph.
The question is:  will the ratio ever reach 2?  It looks like the line will head towards 2 as an asymptote, but will it reach 2 if N increases?

The answer is no, and my proof is as follows:


Take the N=10 series as an example:
0,1,1,2,4,8,16,32,64,128,256,512,1023,2045,4088

We can see after the initial 0 and 1, that the first few terms are exactly double the previous one.  This is because each term is the sum of all the previous non-zero terms, including both of the 1s.  1+1 = 2, 1+1+2 = 4, 1+1+2+4=8 etc.  In this case, the ratio of each term to its previous term is 2, each term is exactly double the previous one.

However, this doubling of terms eventually ends:  when the sum no longer includes all the previous terms, that is to say, when the sum no longer includes both of the 1s and all subsequent terms, then the ratio falls below 2.  In the N=10 example above, the ratio falls below 2 when we reach 1023.


1+1+2+4+8+16+32+64+128+256 = 512
1+2+4+8+16+32+64+128+256+512 = 1023

At this point, the ratio falls below 2 (1023/512 = 1.998.  This fall will occur for any and all series which follow the "sum of previous terms" pattern; as N increases, it just takes more terms, and the final ratio will get closer to 2, but will remain below it.  As an aside, Wikipedia states that the ratio for an n-nacci series tends to the solution, x, of the equation  (no proof given, although my data confirms it).

Next:  I will look at what happens when we sum the previous term and
half of the term before that...e.g.  N = 1.5, N= 2.5, N=3.5 etc.



Thursday, 8 March 2012

Maths: Fibonacci Series (Multiplying Rabbits)

Consider, for a moment, a pair of adult rabbits in the wild.  Rabbits reproduce very quickly, (let's say once every month), and let's suppose that each time a pair of rabbits reproduces, it produces two young rabbits, one male and one female.  After a month, the new young pair is capable of reproducing.  What would happen to the population of pairs of rabbits over a number of years?


At the start of the first month, there's one pair of rabbits.  =1
After the first month, there's one pair of rabbits (and one young pair) =2
After the second month, there are two pairs of rabbits (the original pair, and the young ones have now matured) plus one young pair (from the original couple) =3
After the third month, there are now three adult pairs, and two young pairs (from the two adult pairs) = 5
After the fourth month, there are five adult pairs (three old ones, plus the two from the last generation), and three young pairs (from the three mature pairs last time) = 8


Finally (for this discussion), after the fifth month, there are eight adult pairs (five plus the three new pairs) and five adult pairs = 13 pairs of rabbits.


Let's look at the sequence again...
To start with, we had 1.  Then 1 again, then 2, 3, 5, 8, 13.


This sequence is known as the Fibonacci series, after the Italian gentleman who first identified it (Leonardo Fibonacci, 1170-1230).  In simple terms:  to find the next number in the sequence, add together the previous two numbers.


1 + 1 = 2
1 + 2 = 3
2 + 3 = 5
3 + 5 = 8
5 + 8 = 13
8 + 13 = 21
13 + 21 = 34
21 + 34 = 55
34 + 55 = 89 and so on.


Fibonacci - Mathematics


This sequence grows very quickly - as the rabbit population would - and it has some interesting properties.  Firstly, though, it doesn't graph very well on a normal graph scale...



The large values for the later terms in the sequence completely overwhelm the smaller values, so that the first part of the graph looks like a horizontal line.  A logarithmic scale on the y-axis will help show the growth in a little more detail.  The vertical y-axis now counts 1, 10, 100, 1000 etc with equal spacing.


Which shows something I suspected - we can accurately describe the Fibonacci series as logarithmic.  

Let's look at how quickly the series increases, by dividing each term by the previous one.


We can see that the growth rate fluctuates for the first few terms, but after eight terms, settles down considerably, and then reaches a value of 1.618033988749890 after 40 terms.  This number is called the Golden Ratio, and it appears in various mathematical (and non-mathematical) situations.

Borrowing from Wikipedia, the Golden Ratio can be defined as...


Rectangle


The ancient Greeks knew of a rectangle whose sides are in the ratio of the Golden Ratio.
It also occurs naturally in some of the proportions of the Five Platonic Solids (the tetrahedron, cube, octahedron, dodecahedron and icosahedron).   This so-called Golden Rectangle appears in many of the proportions of that famous ancient Greek temple, the Parthenon, and in the Acropolis in Athens. However, there's no original documentary evidence that this was deliberately designed in.  A Golden Rectangle also has visually pleasing proportions, see the larger rectangle below.  The horizontal sides are length 1, the vertical sides are lenth 1.61803...

Spiral

The Fibonnaci series can be used to produce a spiral; the title link above shows how this is done.  However, to summarise, by drawing squares with sides equal to the terms of the Fibonacci series, adjacent to each other, and by proceeding in a clockwise (or anti-clockwise) manner, it's possible to draw up a connected series of squares.  Yes, I'm borrowing from Wikipedia again:

And then draw quarter-circular arcs using the corners of the squares, so that they trace out into a spiral.  The area in red below corresponds to the area shown above.

Fibonacci in Nature

Apart from unchecked rabbit populations, the Fibonacci series shows up in a number of natural places - in flower petalspine cones and so on.  My personal favourite is where the Fibonnaci spiral shows up in shells, and I've had this picture on the wall next to my desk for some time.  It reminds that even though numbers can get pretty ugly, they can also look remarkably beautiful.


The volume of each chamber within the shell follows the Fibonacci series, all the way out to 3,524,578.

Many other spirals also follow the Fibonacci series.  So we can see the Fibonacci series has a wide scope, from the huge to the tiny;overall, though, the Fibonacci series is as simple as 1, 1, 2, 3 :-)