Miranda Coulter Tushar Das MATH 2700 11 May 2010 Solving Fibonacci: Determining the nth Term in the Fibonacci Sequence Purpose The purpose of this paper is to use Linear Algebra to determine the nth term in the Fibonacci sequence without prior knowledge of the previous two terms. History In the late twelfth century, the mathematician currently known as Fibonacci was born as Leonardo of Pisa, or Leonardo Pisano in Italian. The name Fibonacci came from the shortening of the Latin “filius Bonacci” or son of Bonacci. Known as the greatest European mathematician of the Middle Ages, he was one of the first to introduce the Hindu-Arabic number system to number system (the numbering system we use today) to Europe. Fibonacci’s writing of Liber Abaci, or The Book of Calculations, persuaded many western European scholars and mathematicians to use the Hindu-Arabic system over the Roman Numeral system, greatly simplifying the manner in which even basic arithmetic can be approached. It was in this same book, that the pattern that would later come to be known as the Fibonacci Sequence was recorded. Although not created by the mathematician, this sequence still bears his name today. The Problem From Fibonacci’s Liber Abaci, Chapter 12, How Many Pairs of Rabbits Are Created by One Pair in One Year A certain man had one pair of rabbits together in a certain enclosed place, and one wishes to know how many are created from the pair in one year when it is the nature of them in a single month to bear another pair, and in the second month those born to bear also. … Because the above written pair in the first month bore, you will double it; there will be two pairs in one month. One of these, namely the first, bears in the second month, and thus there are in the second month 3 pairs; of these in one month two are pregnant and in the third month 2 pairs of rabbits are born, and thus there are 5 pairs in the month; ... there will be 144 pairs in this [the tenth] month; to these are added again the 89 pairs that are born in the eleventh month; there will be 233 pairs in this month. To these are still added the 144 pairs that are born in the last month; there will be 377 pairs, and this many pairs are produced from the abovewritten [sic] pair in the mentioned place at the end of the one year. (404-405) The problem above assumes two things: 1) that the man is in possession of two fully mature rabbits capable of producing offspring the first month and 2) that there are no deaths throughout the year. Although Fibonacci clearly outlines the pairs through the first year, how could he determine the number of pairs years later, once simple addition was no longer practical, if this pattern continued? For the purposes of this paper, we too will make two assumptions: 1) the man is in possession of two newborn rabbits incapable of reproducing until after the second month and 2) that there are no deaths. The preceding image depicts the question posed by Fibonacci. After the second month, the first pair of rabbits produces another pair of rabbits capable of producing offspring each month. After their second month, each new pair of rabbits also produces another pair of rabbits. n fn n fn n fn n fn n fn 1 1 6 8 11 89 16 987 21 10946 2 1 7 13 12 144 17 1597 22 17711 3 2 8 21 13 233 18 2584 23 28657 4 3 9 34 14 377 19 4181 24 46368 5 5 10 55 15 610 20 6765 25 75025 The above table allows us to quickly see the first 25 values of n and to verify that ππ = ππ−1 + ππ−2 . In order to solve fn, however, the previous two terms in the sequence must already be known. Although simple enough, this procedure of adding the two previous terms together to identify the desired term quickly becomes impractical. Applying Linear Algebra To begin, pairs of n values should be written as vectors and the 2x2 matrix A identified. π 1 [ 1] = [ π2 1 1 π0 1 ][ ] = [ π 0 1 1 1 1 ] [ ] = π΄π 0 0 By raising A to the nth power, the nth and (n+1)th term of the sequence can be found. [ ππ+1 1 1π 1 ]=[ ] [ ] = π΄π π₯ ππ 1 0 0 Although this equation seems simple enough at first glance, determining An can be both difficult and time consuming. By utilizing more Linear Algebra techniques, An can be simplified and a precise definition of fn found. Diagonalization To simplify An, a technique known as Diagonalization must be used. A matrix is said to be diagonalizable when it can written in factored form as PDP-1. With this method An can be written using the matrices P, P-1, and D (a diagonal matrix). Although several calculations must first be performed before these three matrices can be identified, expressing An in this form will ultimately allow for a much simpler expression of fn. π΄ = ππ·π−1 π π·=[ 0 0 0 ] π1 π΄2 = ππ·π−1 ππ·π −1 = ππ·πΌπ·π −1 = ππ·2 π−1 π΄π = ππ·π π −1 π·π = [ ππ0 0 0 ] π1π To determine the λ values in D, we must now find the eigenvalues and eigenvectors of A. Eigenvalues and Eigenvectors We must first determine the eigenvalues of A. An eigenvalue can be defined as a scalar λ such that the equation π΄π = ππ has a solution for some nonzero vector x. To determine the eigenvalue, we set the determinant of (π΄ − ππΌ) equal to zero and solve for λ. 0 = det(π΄ − ππΌ) 1 1 1 = det ([ ] −λ[ 1 0 0 = det ([ 0 ]) 1 1 1 λ 0 ]−[ ]) 1 0 0 λ 1−π =| 1 1 | −π = π2 − π − 1 π= 1 ± √5 2 After obtaining the two eigenvalues, calculations for the two eigenvectors, the nonzero vector x such that π΄π = ππ for some scalar λ, can now be determined. π0 = 1− 0 [ ]= 0 [ 1 + √5 2 1 1 + √5 2 1 − √5 π₯+π¦ π₯ 2 [π¦ ] = 1 + √5 1 + √5 − π₯− π¦] ] [ 2 2 1 −π¦ = π₯= 1 − √5 π₯ 2 1 + √5 π¦ 2 π₯0 = [ 1 + √5 2 ] 1 Because there were two eigenvalues, the calculations must be repeated for the second scalar and a second eigenvector obtained. 1 − √5 2 π1 = 1− 0 [ ]= 0 [ 1 − √5 2 1 1 + √5 π₯+π¦ π₯ 2 [ ]= 1 − √5 π¦ 1 − √5 − π₯ − π¦] [ 2 ] 2 1 −π¦ = π₯= 1 + √5 π₯ 2 1 − √5 π¦ 2 π₯1 = [ 1 − √5 2 ] 1 With values for λ, we can now construct P, P-1, and D. Final Calculations After applying the diagonalization technique and obtaining both the eigenvalues and eigenvectors of matrix A, the matrices P, P-1, and D can now be constructed. With these matrices, a simplified value for π΄π can be obtained and a statement expressing the nth term in the Fibonacci sequence formulated. π΄π = ππ·π π −1 1 + √5 2 π·= 0 [ 0 1 − √5 2 ] π 0 0 1 − √5 ( ) 2 ] π 1 + √5 ( ) 2 π· = π [ 1 + √5 1 − √5 π=[ 2 2 ] 1 1 π−1 = 1 √5 1 [−1 1 − √5 2 1 + √5 ] 2 − With the above matrices we can obtain a statement for the diagonalizable An. π 1 + √5 ( ) 1 + √5 1 − √5 1 2 π΄π = [ 2 2 ] √5 1 1 0 [ π+1 = 1 + √5 ( ) 1 2 √5 π 1 + √5 ( ) 2 [ π+1 = 1 + √5 ( ) 1 2 √5 0 1 π 1 − √5 ( ) [−1 2 ] 1 − √5 2 1 + √5 ] 2 − π+1 1 − √5 ( ) 2 1 − √5 2 1 + √5 ] 2 1 − π 1 − √5 ( ) [−1 2 ] π+1 π 1 − √5 −( ) 2 π π 1 + √5 1 − √5 ( ) −( ) 2 2 π π+1 1 + √5 1 − √5 ( ) −( ) 2 2 [ 1 + √5 ( ) 2 π+1 1 − √5 −( ) 2 ] By inserting the matrix An into the original equation, a value for fn for any n greater than or equal to three is finally obtained. [ ππ+1 1 1π 1 ]=[ ] [ ] = π΄π π₯ ππ 1 0 0 π+1 [ 1 + √5 ( ) 1 2 ππ+1 ]= ππ √5 π+1 1 − √5 −( ) 2 π π 1 + √5 1 − √5 ( ) −( ) 2 2 [ π+1 = 1 + √5 ( ) 1 2 √5 π π π 1 + √5 1 − √5 ( ) −( ) 2 2 π+1 1 + √5 ( ) 2 −( π+1 1 − √5 −( ) 2 π 1 + √5 1 − √5 ( ) −( ) 2 2 [ ] 1 [ ] 0 π+1 1 − √5 ) 2 ] π 1 π 1 + √5 1 − √5 ππ = [( ) −( ) ] 2 2 √5 The above equation holds true for any n in the Fibonacci sequence when π 0 [ 0 ] = [ ]. π1 1 The equation can be simply altered, however, to accommodate any two starting values within the sequence. For example, a precise expression of Fibonacci’s exact riddle would involve a starting point of π 1 [ 0] = [ ] π1 2 and a final equation of ππ = 1 √5 1+√5 [( 2 π+2 ) 1−√5 −( 2 π+2 ) ]. Conclusion The Fibonacci sequence is a relatively simple sequence to solve by simple addition, at least for the first twenty or so values. With careful application of Linear Algebra techniques, however, a relatively simple expression for the nth term in the sequence can be found. References Fibonacci, Leonardo. "Here Begins Chapter Twelve." Fibonacci's Liber Abaci: a Translation into Modern English of Leonardo Pisano's Book of Calculation. Trans. L. E. Sigler. New York: Springer, 2002. 404-05. Print. Hendel, Russell J. "Approaches to the Formula for the nth Fibonacci Number." The College Mathematics Journal 25.2 (1994): 139-42. JSTOR. Web. 27 Apr. 2010. Lay, David C. "Eigenvalues and Eigenvectors." Linear Algebra and Its Applications. Boston: Pearson/Addison-Wesley, 2006. 301-71. Print.