Jump to content

Fibonacci sequence: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
mNo edit summary
No edit summary
Line 1: Line 1:
The '''Fibonacci numbers''' were invented by [[Leonardo of Pisa]] (ca. 1200), aka. Fibonacci, to describe the growth of a rabbit population. They form a [[sequence]] defined [[recursion definition|recursively]] by the following equations:
The '''Fibonacci numbers''' were invented by [[Leonardo of Pisa]] (ca. 1200), aka. Fibonacci, to describe the growth of a rabbit population. They form a [[sequence]] defined [[recursion definition|recursively]] band [[Prime number|primality]] proving.
* ''F''(1) = 1
* ''F''(2) = 1
* ''F''(''n'' + 2) = ''F''(''n'') + ''F''(''n'' + 1).
The first
\\sequence is also applied more generally to any [[function]] ''g'' where ''g''(''n'' + 2) = ''g''(''n'') + ''g''(''n'' + 1). These functions are precisely those with the form ''g''(''n'') = ''aF''(''n'') + ''bF''(''n'' + 1) for some ''a'', ''b'', so the Fibonacci sequences form a [[vector space]] with the functions ''F''(''n'') and ''F''(''n'' + 1) as a basis.

As was pointed out by [[Johannes Kepler]], the growth rate of the Fibonacci numbers, that is, ''F''(''n'' + 1) / ''F''(''n''), converges to the [[golden mean]], denoted &phi; (phi);. This is the positive root of the quadratic x<sup>2</sup> - x - 1, so &phi;<sup>2</sup> = &phi; + 1. If we multiply both sides by &phi;<sup>''n''</sup>, we get &phi;<sup>''n''+2</sup> = &phi;<sup>''n''+1</sup> + &phi;<sup>''n''</sup>, so the function &phi;<sup>''n''</sup> is a Fibonacci sequence. The negative root of the quadratic, 1 - &phi;, can be shown to have the same properties, so the two functions &phi;<sup>''n''</sup> and (1-&phi;)<sup>''n''</sup> form another basis for the space.

This gives us a formula for the normal Fibonacci sequence:

: ''F''(''n'') = &phi;<sup>''n''</sup>/&radic;5 - (1-&phi;)<sup>''n''</sup>/&radic;5

As ''n'' goes to infinity, the second term converges to zero, so the Fibonacci numbers approach the exponential &phi;<sup>''n''</sup> / &radic;5, hence their convergent ratios. In fact the second term starts out small enough that the Fibonacci numbers can be obtained from the first term alone, by rounding to the nearest integer.

=== Computing Fibonacci numbers ===

Computing Fibonacci numbers by computing powers of the golden mean is not very practical except for small values of ''n'', since rounding errors will accrue and [[floating point]] numbers usually don't have enough precision.

The straightforward recursive implementation of the Fibonacci sequence definition is also not advisable, since it would compute many values repeatedly (unless the [[programming language]] has a feature which allows the storing of previously computed function values). Therefore, one usually computes the Fibonacci numbers "from the bottom up", starting with the two values 1 and 1, and then repeatedly replacing the first number by the second, and the second number by the sum of the two.

For huge arguments and if a [[bignum]] system is being used, a faster way to calculate Fibonacci numbers uses the following [[matrix]] equation:
/ 1 1 \<sup>n</sup> / F(n+1) F(n) \
\ 1 0 / = \ F(n) F(n-1)/
and employs [[exponentiating by squaring]].

=== Applications ===

The Fibonacci numbers are important in the run-time analysis of [[Euclidean algorithm|Euclid's algorithm]] to determine the [[greatest common divisor]] of two integers.

Matiyasevich was able to show that the Fibonacci numbers can be defined by a Diophantine equation, which led to his original solution of [[Matiyasevichs theorem|Hilbert's tenth problem]].

The Fibonacci numbers occur in a formula about the diagonals of Pascal's triangle (see [[binomial coefficient]]).

An interesting use of the Fibonacci sequence is for converting miles to kilometers. For instance, if you want to know about how many kilometers 5 miles is, take the Fibonacci number (5) and look at the next one (8). 5 miles is about 8 kilometers. This works because it so happens that the conversion factor between miles and kilometers is roughly equal to &phi;.

A [[logarithmic spiral]] can be approximated as follows: start at the origin of the cartesian coordinate system, move F(1) units to the right, move F(2) units up, move F(3) units to the left, move F(4) units down, move F(5) units to the right etc. This is similar to the construction mentioned on the [[golden mean]] article. Fibonacci number often occur in nature when logarithmic spirals are built from discrete units, such as in sun flowers or in pine cones.

=== Generalizations ===

A generalization of the Fibonacci sequence are the [[Lucas sequence]]s. One kind can be defined thus:

* ''L''(0) = 0
* ''L''(1) = 1
* ''L''(''n''+2) = ''PL''(''n''+1) + ''QL''(''n'')

where the normal Fibonacci sequence is the special case of ''P'' = ''Q'' = 1. Another kind of Lucas Sequence begins with ''L''(0) = 2, ''L''(1) = ''P''. Such sequences have applications in number theory and [[Prime number|primality]] proving.

Revision as of 14:44, 7 December 2002

The Fibonacci numbers were invented by Leonardo of Pisa (ca. 1200), aka. Fibonacci, to describe the growth of a rabbit population. They form a sequence defined recursively band primality proving.