Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fibonacci Numbers, Polynomial Coefficients, and Vector Programs.

Similar presentations


Presentation on theme: "Fibonacci Numbers, Polynomial Coefficients, and Vector Programs."— Presentation transcript:

1

2 Fibonacci Numbers, Polynomial Coefficients, and Vector Programs.

3 Leonardo Fibonacci In 1202, Fibonacci proposed a problem about the growth of rabbit populations.

4 Inductive Definition or Recurrence Relation for the Fibonacci Numbers Stage 0, Initial Condition, or Base Case: Fib(0) = 0; Fib (1) = 1 Inductive Rule For n>1, Fib(n) = Fib(n-1) + Fib(n-2) n01234567 Fib(n)0112358 1313

5 Sneezwort (Achilleaptarmica) Each time the plant starts a new shoot it takes two months before it is strong enough to support branching.

6 Counting Petals 5 petals: buttercup, wild rose, larkspur, columbine (aquilegia) 8 petals: delphiniums 13 petals: ragwort, corn marigold, cineraria, some daisies 21 petals: aster, black-eyed susan, chicory 34 petals: plantain, pyrethrum 55, 89 petals: michaelmas daisies, the asteraceae family.

7 Pineapple whorls Church and Turing were both interested in the number of whorls in each ring of the spiral. The ratio of consecutive ring lengths approaches the Golden Ratio.

8

9

10 Definition of  (Euclid) Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. ABC

11 Pentagon

12 Expanding Recursively

13 Continued Fraction Representation

14

15 1,1,2,3,5,8,13,21,34,55,…. 2/1 =2 3/2=1.5 5/3=1.666… 8/5=1.6 13/8=1.625 21/13=1.6153846… 34/21=1.61904…  = 1.6180339887498948482045

16 How to divide polynomials? 1 1 – X ? 1 1 -(1 – X) X + X -(X – X 2 ) X2X2 + X 2 -(X 2 – X 3 ) X3X3 = 1 + X + X 2 + X 3 + X 4 + X 5 + X 6 + X 7 + … …

17 1 + X 1 + X 2 + X 3 + … + X n + ….. = 1 + X 1 + X 2 + X 3 + … + X n + ….. = 1 1 - X The Infinite Geometric Series

18 (1-X) ( 1 + X 1 + X 2 + X 3 + … + X n + … ) = 1 + X 1 + X 2 + X 3 + … + X n + X n+1 + …. - X 1 - X 2 - X 3 - … - X n-1 – X n - X n+1 - … = 1 1 + X 1 + X 2 + X 3 + … + X n + ….. = 1 + X 1 + X 2 + X 3 + … + X n + ….. = 1 1 - X

19 1 + X 1 + X 2 + X 3 + … + X n + ….. = 1 + X 1 + X 2 + X 3 + … + X n + ….. = 1 1 - X 1 – X1 1 -(1 – X) X + X -(X – X 2 ) X2X2 + X 2 + … -(X 2 – X 3 ) X3X3 …

20 X 1 – X – X 2 Something a bit more complicated 1 – X – X 2 X X 2 + X 3 -(X – X 2 – X 3 ) X 2X 3 + X 4 -(X 2 – X 3 – X 4 ) + X 2 -(2X 3 – 2X 4 – 2X 5 ) + 2X 3 3X 4 + 2X 5 + 3X 4 -(3X 4 – 3X 5 – 3X 6 ) 5X 5 + 3X 6 + 5X 5 -(5X 5 – 5X 6 – 5X 7 ) 8X 6 + 5X 7 + 8X 6 -(8X 6 – 8X 7 – 8X 8 )

21 Hence = F 0 1 + F 1 X 1 + F 2 X 2 +F 3 X 3 + F 4 X 4 + F 5 X 5 + F 6 X 6 + … X 1 – X – X 2 = 0  1 + 1 X 1 + 1 X 2 + 2X 3 + 3X 4 + 5X 5 + 8X 6 + …

22 Going the Other Way (1 - X- X 2 )  ( F 0 1 + F 1 X 1 + F 2 X 2 + … + F n-2 X n-2 + F n-1 X n-1 + F n X n + … F 0 = 0, F 1 = 1

23 Going the Other Way (1 - X- X 2 )  ( F 0 1 + F 1 X 1 + F 2 X 2 + … + F n-2 X n-2 + F n-1 X n-1 + F n X n + … = ( F 0 1 + F 1 X 1 + F 2 X 2 + … + F n-2 X n-2 + F n-1 X n-1 + F n X n + … - F 0 X 1 - F 1 X 2 - … - F n-3 X n-2 - F n-2 X n-1 - F n-1 X n - … - F 0 X 2 - … - F n-4 X n-2 - F n-3 X n-1 - F n-2 X n - … = F 0 1 + ( F 1 – F 0 ) X 1 F 0 = 0, F 1 = 1 = X

24 Thus F 0 1 + F 1 X 1 + F 2 X 2 + … + F n-1 X n-1 + F n X n + … X 1 – X – X 2 = = X/(1-  X)(1 – (-  ) -1 X)   -1 = 1,  -  -1 =1

25 X (1 –  X)(1- (-  ) -1 X) Linear factors on the bottom  n=0..∞ = XnXn ?

26 ( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 (1 – aX)(1-bX) Geometric Series (Quadratic Form) a n+1 – b n+1 a - b  n=0..∞ XnXn = =

27 1 (1 –  X)(1- (-  -1 X)) Geometric Series (Quadratic Form)  n+1 – (-  -1 ) n+1 √5√5√5√5  n=0.. ∞ = XnXn

28 X (1 –  X)(1- (-  -1 X) Power Series Expansion of F  n+1 – (-  - 1) n+1 √5√5√5√5  n=0.. ∞ = X n+1

29

30 The i th Fibonacci number is: Leonhard Euler (1765) J. P. M. Binet (1843) A de Moivre (1730)

31 ( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 (1 – aX)(1-bX) Let’s Derive This a n+1 – b n+1 a - b  n=0..∞ XnXn = =

32 1 + Y 1 + Y 2 + Y 3 + … + Y n + ….. = 1 + Y 1 + Y 2 + Y 3 + … + Y n + ….. = 1 1 - Y Substituting Y = aX …

33 1 + aX 1 + a 2 X 2 + a 3 X 3 + … + a n X n + ….. = 1 + aX 1 + a 2 X 2 + a 3 X 3 + … + a n X n + ….. = 1 1 - aX Geometric Series (Linear Form)

34 ( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 (1 – aX)(1-bX) Geometric Series (Quadratic Form)

35 ( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 + c 1 X 1 +.. + c k X k + … Suppose we multiply this out to get a single, infinite polynomial. What is an expression for C n ?

36 ( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 + c 1 X 1 +.. + c k X k + … a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0 c n = a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0

37 ( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 + c 1 X 1 +.. + c k X k + … a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0 If a = b then c n = (n+1)(a n ) a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0

38 a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0 (a-b) ( a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0 ) a 1 b n +… a i+1 b n-i … + a n b 1 + a n+1 b 0 = a 1 b n +… a i+1 b n-i … + a n b 1 + a n+1 b 0 a 0 b n+1 – a 1 b n … a i+1 b n-i … - a n-1 b 2 - a n b 1 - a 0 b n+1 – a 1 b n … a i+1 b n-i … - a n-1 b 2 - a n b 1 = - b n+1 + a n+1 = a n+1 – b n+1 a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0 = a n+1 – b n+1 a - b

39 ( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 + c 1 X 1 +.. + c k X k + … a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0 if a  b then c n = a 0 b n + a 1 b n-1 +… a i b n-i … + a n-1 b 1 + a n b 0 a n+1 – b n+1 a - b

40 ( 1 + aX 1 + a 2 X 2 + … + a n X n + ….. ) ( 1 + bX 1 + b 2 X 2 + … + b n X n + ….. ) = 1 (1 – aX)(1-bX) Geometric Series (Quadratic Form) a n+1 – b n+1 a - b  n=0..  XnXn = = XnXn or (n+1)a n when a=b

41 Sequences That Sum To n Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n. Example: f 5 = 5

42 Sequences That Sum To n Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n. Example: f 5 = 5 4 = 2 + 2 2 + 1 + 1 1 + 2 + 1 1 + 1 + 2 1 + 1 + 1 + 1

43 Sequences That Sum To n f1f1 f2f2 f3f3 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n.

44 Sequences That Sum To n f 1 = 1 0 = the empty sum f 2 = 1 1 = 1 f 3 = 2 2 = 1 + 1 2 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n.

45 Sequences That Sum To n f n+1 = f n + f n-1 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n.

46 Sequences That Sum To n f n+1 = f n + f n-1 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n. # of sequences beginning with a 2 # of sequences beginning with a 1

47 Fibonacci Numbers Again f n+1 = f n + f n-1 f 1 = 1 f 2 = 1 Let f n+1 be the number of different sequences of 1’s and 2’s that sum to n.

48 Visual Representation: Tiling Let f n+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.

49 Visual Representation: Tiling Let f n+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.

50 Visual Representation: Tiling 1 way to tile a strip of length 0 1 way to tile a strip of length 1: 2 ways to tile a strip of length 2:

51 f n+1 = f n + f n-1 f n+1 is number of ways to tile length n. f n tilings that start with a square. f n-1 tilings that start with a domino.

52 Let’s use this visual representation to prove a couple of Fibonacci identities.

53 Fibonacci Identities Some examples: F 2n = F 1 + F 3 + F 5 + … + F 2n-1 F m+n+1 = F m+1 F n+1 + F m F n (F n ) 2 = F n-1 F n+1 + (-1) n

54 F m+n+1 = F m+1 F n+1 + F m F nmn m-1n-1

55 (F n ) 2 = F n-1 F n+1 + (-1) n

56 n-1 F n tilings of a strip of length n-1

57 (F n ) 2 = F n-1 F n+1 + (-1) nn-1 n-1

58 n (F n ) 2 tilings of two strips of size n-1

59 (F n ) 2 = F n-1 F n+1 + (-1) n n Draw a vertical “fault line” at the rightmost position (<n) possible without cutting any dominoes

60 (F n ) 2 = F n-1 F n+1 + (-1) n n Swap the tails at the fault line to map to a tiling of 2 n-1 ‘s to a tiling of an n-2 and an n.

61 (F n ) 2 = F n-1 F n+1 + (-1) n n Swap the tails at the fault line to map to a tiling of 2 n-1 ‘s to a tiling of an n-2 and an n.

62 (F n ) 2 = F n-1 F n+1 + (-1) n-1 n even n odd

63 The Fibonacci Quarterly

64 Vector Programs Let’s define a (parallel) programming language called VECTOR that operates on possibly infinite vectors of numbers. Each variable V ! can be thought of as: 0 1 2 3 4 5.........

65 Vector Programs Let k stand for a scalar constant will stand for the vector = V ! + T ! means to add the vectors position-wise. + =

66 Vector Programs RIGHT(V ! ) means to shift every number in V ! one position to the right and to place a 0 in position 0. RIGHT( ) =

67 Vector Programs Example: V ! := ; V ! := RIGHT(V ! ) + ; V ! = V ! = Store V ! = V ! = V ! =

68 Vector Programs Example: V ! := ; Loop n times: V ! := V ! + RIGHT(V ! ); V ! = n th row of Pascal’s triangle. Store V ! =

69 X1 X1 X2 X2 + + X3 X3 Vector programs can be implemented by polynomials!

70 Programs -----> Polynomials The vector V ! = will be represented by the polynomial:

71 Formal Power Series The vector V ! = will be represented by the formal power series:

72 V ! = is represented by 0 is represented by k RIGHT(V ! ) is represented by (P V X) V ! + T ! is represented by (P V + P T )

73 Vector Programs Example: V ! := ; Loop n times: V ! := V ! + RIGHT(V ! ); V ! = n th row of Pascal’s triangle. P V := 1; P V := P V + P V X;

74 Vector Programs Example: V ! := ; Loop n times: V ! := V ! + RIGHT(V ! ); V ! = n th row of Pascal’s triangle. P V := 1; P V := P V (1+ X);

75 Vector Programs Example: V ! := ; Loop n times: V ! := V ! + RIGHT(V ! ); V ! = n th row of Pascal’s triangle. P V = (1+ X) n

76 Let’s add an instruction called PREFIXSUM to our VECTOR language. W ! := PREFIXSUM(V ! ) means that the i th position of W contains the sum of all the numbers in V from positions 0 to i.

77 What does this program output? V ! := 1 ! ; Loop k times: V ! := PREFIXSUM(V ! ) ; k’th Avenue 0 1 2 3 4

78 Al Karaji Perfect Squares Zero_Ave := PREFIXSUM( ); First_Ave := PREFIXSUM(Zero_Ave); Second_Ave :=PREFIXSUM(First_Ave); Output:= RIGHT(Second_Ave) + Second_Ave Second_Ave = <1, 3, 6, 10, 15,. RIGHT(Second_Ave) = <0, 1, 3, 6, 10,. Output = <1, 4, 9, 16, 25

79 Can you see how PREFIXSUM can be represented by a familiar polynomial expression?

80 W ! := PREFIXSUM(V ! ) is represented by P W = P V / (1-X) = P V ( 1+X+X 2 +X 3 + ….. )

81 Al-Karaji Program Zero_Ave = 1/(1-X); First_Ave = 1/(1-X) 2 ; Second_Ave = 1/(1-X) 3 ; Output = 1/(1-X) 2 + 2X/(1-X) 3 (1-X)/(1-X) 3 + 2X/(1-X) 3 = (1+X)/(1-X) 3

82 (1+X)/(1-X) 3 Zero_Ave := PREFIXSUM( ); First_Ave := PREFIXSUM(Zero_Ave); Second_Ave :=PREFIXSUM(First_Ave); Output:= RIGHT(Second_Ave) + Second_Ave Second_Ave = <1, 3, 6, 10, 15,. RIGHT(Second_Ave) = <0, 1, 3, 6, 10,. Output = <1, 4, 9, 16, 25

83 (1+X)/(1-X) 3 outputs outputs X(1+X)/(1-X) 3 outputs outputs The k th entry is k 2 The k th entry is k 2

84 X(1+X)/(1-X) 3 =  k 2 X k What does X(1+X)/(1-X) 4 do?

85 X(1+X)/(1-X) 4 expands to :  S k X k where S k is the sum of the first k squares

86 Aha! Thus, if there is an alternative interpretation of the k th coefficient of X(1+X)/(1-X) 4 we would have a new way to get a formula for the sum of the first k squares.

87 What is the coefficient of X k in the expansion of: ( 1 + X + X 2 + X 3 + X 4 +.... ) n ? Each path in the choice tree for the cross terms has n choices of exponent e 1, e 2,..., e n ¸ 0. Each exponent can be any natural number. Coefficient of X k is the number of non-negative solutions to: e 1 + e 2 +... + e n = k

88 What is the coefficient of X k in the expansion of: ( 1 + X + X 2 + X 3 + X 4 +.... ) n ?

89 ( 1 + X + X 2 + X 3 + X 4 +.... ) n =

90 Using pirates and gold we found that: THUS:

91 Vector programs -> Polynomials -> Closed form expression

92 REFERENCES Coxeter, H. S. M. ``The Golden Section, Phyllotaxis, and Wythoff's Game.'' Scripta Mathematica 19, 135-143, 1953. "Recounting Fibonacci and Lucas Identities" by Arthur T. Benjamin and Jennifer J. Quinn, College Mathematics Journal, Vol. 30(5): 359--366, 1999.


Download ppt "Fibonacci Numbers, Polynomial Coefficients, and Vector Programs."

Similar presentations


Ads by Google