recurrences part 1
play

Recurrences, Part 1 Troy Vasiga Centre for Education in Mathematics - PowerPoint PPT Presentation

Recurrences, Part 1 Troy Vasiga Centre for Education in Mathematics and Computing Faculty of Mathematics, University of Waterloo cemc.uwaterloo.ca WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING Outline Short


  1. Mathematical Induction Mathematical induction is the mirror image of recursion. When we try to prove a result using induction, we need to do three things: 1. show the result holds for the base case(s): this is usually, but not always, easy 2. assume the result holds for all values ≤ k for some k which is at least as big as the base case(s) • this step is known as the inductive hypothesis • when we make this hypothesis, we are using strong induction • there is a variant known as weak induction where we assume the result holds only for one particular value of k 3. show the result holds for k + 1 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  2. Mathematical Induction Mathematical induction is the mirror image of recursion. When we try to prove a result using induction, we need to do three things: 1. show the result holds for the base case(s): this is usually, but not always, easy 2. assume the result holds for all values ≤ k for some k which is at least as big as the base case(s) • this step is known as the inductive hypothesis • when we make this hypothesis, we are using strong induction • there is a variant known as weak induction where we assume the result holds only for one particular value of k 3. show the result holds for k + 1 • this step is called the inductive step WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  3. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  4. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  5. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  6. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. Assume that for all values of n such that n ≤ k , the result holds. That is, for any n ≤ k , we know that a n = 5 n . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  7. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. Assume that for all values of n such that n ≤ k , the result holds. That is, for any n ≤ k , we know that a n = 5 n . We now prove the result for n = k + 1. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  8. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. Assume that for all values of n such that n ≤ k , the result holds. That is, for any n ≤ k , we know that a n = 5 n . We now prove the result for n = k + 1. We need to show that a k +1 = 5( k + 1). But, we know that a k +1 = 2 a k − a k − 1 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  9. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. Assume that for all values of n such that n ≤ k , the result holds. That is, for any n ≤ k , we know that a n = 5 n . We now prove the result for n = k + 1. We need to show that a k +1 = 5( k + 1). But, we know that a k +1 = 2 a k − a k − 1 = 2(5 k ) − 5( k − 1) WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  10. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. Assume that for all values of n such that n ≤ k , the result holds. That is, for any n ≤ k , we know that a n = 5 n . We now prove the result for n = k + 1. We need to show that a k +1 = 5( k + 1). But, we know that a k +1 = 2 a k − a k − 1 = 2(5 k ) − 5( k − 1) = 10 k − 5 k + 5 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  11. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. Assume that for all values of n such that n ≤ k , the result holds. That is, for any n ≤ k , we know that a n = 5 n . We now prove the result for n = k + 1. We need to show that a k +1 = 5( k + 1). But, we know that a k +1 = 2 a k − a k − 1 = 2(5 k ) − 5( k − 1) = 10 k − 5 k + 5 = 5 k + 5 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  12. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. Assume that for all values of n such that n ≤ k , the result holds. That is, for any n ≤ k , we know that a n = 5 n . We now prove the result for n = k + 1. We need to show that a k +1 = 5( k + 1). But, we know that a k +1 = 2 a k − a k − 1 = 2(5 k ) − 5( k − 1) = 10 k − 5 k + 5 = 5 k + 5 = 5( k + 1) WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  13. Our first inductive proof Prove: If a 0 = 0, a 1 = 5 and a n = 2 a n − 1 − a n − 2 , then a n = 5 n for all n ≥ 0. Proof: By (strong) mathematical induction. If n = 0, then 5 n = 0 = a 0 . If n = 1, then 5 n = 5 = a 1 . Thus, the result holds for the base cases. Assume that for all values of n such that n ≤ k , the result holds. That is, for any n ≤ k , we know that a n = 5 n . We now prove the result for n = k + 1. We need to show that a k +1 = 5( k + 1). But, we know that a k +1 = 2 a k − a k − 1 = 2(5 k ) − 5( k − 1) = 10 k − 5 k + 5 = 5 k + 5 = 5( k + 1) which proves the result. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  14. Exercise Suppose you have: a 0 = 1 a n = 2 a n − 1 + 1 (This is sometimes known as the Tower of Hanoi recurrence). Find a closed form, and prove that it is correct using mathematical induction. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  15. Solution Start with some values: a 0 = 1 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  16. Solution Start with some values: a 0 = 1 a 1 = WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  17. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  18. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 a 2 = WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  19. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 a 2 = 2(3) + 1 = 7 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  20. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 a 2 = 2(3) + 1 = 7 a 3 = WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  21. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 a 2 = 2(3) + 1 = 7 a 3 = 2(7) + 1 = 15 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  22. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 a 2 = 2(3) + 1 = 7 a 3 = 2(7) + 1 = 15 a 4 = WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  23. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 a 2 = 2(3) + 1 = 7 a 3 = 2(7) + 1 = 15 a 4 = 2(15) + 1 = 31 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  24. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 a 2 = 2(3) + 1 = 7 a 3 = 2(7) + 1 = 15 a 4 = 2(15) + 1 = 31 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  25. Solution Start with some values: a 0 = 1 a 1 = 2(1) + 1 = 3 a 2 = 2(3) + 1 = 7 a 3 = 2(7) + 1 = 15 a 4 = 2(15) + 1 = 31 We conjecture that a n = 2 n +1 − 1. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  26. Proof of closed form We only have one base case: a 0 = 1 = 2 (0+1) − 1 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  27. Proof of closed form We only have one base case: a 0 = 1 = 2 (0+1) − 1 Assume that for all n ≤ k ( k ≥ 0), we have a n = 2 n +1 − 1. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  28. Proof of closed form We only have one base case: a 0 = 1 = 2 (0+1) − 1 Assume that for all n ≤ k ( k ≥ 0), we have a n = 2 n +1 − 1. We need to show that the result holds when n = k + 1. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  29. Proof of closed form We only have one base case: a 0 = 1 = 2 (0+1) − 1 Assume that for all n ≤ k ( k ≥ 0), we have a n = 2 n +1 − 1. We need to show that the result holds when n = k + 1. a k +1 = 2 a k + 1 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  30. Proof of closed form We only have one base case: a 0 = 1 = 2 (0+1) − 1 Assume that for all n ≤ k ( k ≥ 0), we have a n = 2 n +1 − 1. We need to show that the result holds when n = k + 1. a k +1 = 2 a k + 1 2(2 k +1 − 1) + 1 = WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  31. Proof of closed form We only have one base case: a 0 = 1 = 2 (0+1) − 1 Assume that for all n ≤ k ( k ≥ 0), we have a n = 2 n +1 − 1. We need to show that the result holds when n = k + 1. a k +1 = 2 a k + 1 2(2 k +1 − 1) + 1 = 2 k +2 − 2 + 1 = WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  32. Proof of closed form We only have one base case: a 0 = 1 = 2 (0+1) − 1 Assume that for all n ≤ k ( k ≥ 0), we have a n = 2 n +1 − 1. We need to show that the result holds when n = k + 1. a k +1 = 2 a k + 1 2(2 k +1 − 1) + 1 = 2 k +2 − 2 + 1 = 2 k +2 − 1 = WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  33. Proof of closed form We only have one base case: a 0 = 1 = 2 (0+1) − 1 Assume that for all n ≤ k ( k ≥ 0), we have a n = 2 n +1 − 1. We need to show that the result holds when n = k + 1. a k +1 = 2 a k + 1 2(2 k +1 − 1) + 1 = 2 k +2 − 2 + 1 = 2 k +2 − 1 = which proves the result. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  34. Formalizing a formula Guessing a closed form seems like a not very extendible idea, even for very “simple” things like: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  35. Formalizing a formula Guessing a closed form seems like a not very extendible idea, even for very “simple” things like: f 0 = 0 f 1 = 1 f n = f n − 1 + f n − 2 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  36. Formalizing a formula Guessing a closed form seems like a not very extendible idea, even for very “simple” things like: f 0 = 0 f 1 = 1 f n = f n − 1 + f n − 2 A recurrence is called linear if each term of a sequence defined by the recurrence is linear function (i.e., only multiplied by a constant or has a constant added) of earlier terms in the sequence. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  37. Formalizing a formula Guessing a closed form seems like a not very extendible idea, even for very “simple” things like: f 0 = 0 f 1 = 1 f n = f n − 1 + f n − 2 A recurrence is called linear if each term of a sequence defined by the recurrence is linear function (i.e., only multiplied by a constant or has a constant added) of earlier terms in the sequence. So, something like q n = ( q n − 1 ) 2 + 4 is not a linear recurrence, but all the other recurrences we have seen so far are linear. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  38. More formalism A linear homogeneous recurrence relation of degree k is a relation of the form a n = c 1 a n − 1 + c 2 a n − 2 + . . . + c k a n − k where each c i is a real number and c k � = 0. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  39. More formalism A linear homogeneous recurrence relation of degree k is a relation of the form a n = c 1 a n − 1 + c 2 a n − 2 + . . . + c k a n − k where each c i is a real number and c k � = 0. Such a recurrence must include k initial conditions: a 0 = V 0 a 1 = V 1 a k = V k . . . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  40. Characteristic equation Let’s suppose that the closed form to a recurrence a n = c 1 a n − 1 + c 2 a n − 2 + · · · + c k a n − k looks like a n = r n for some constant r . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  41. Characteristic equation Let’s suppose that the closed form to a recurrence a n = c 1 a n − 1 + c 2 a n − 2 + · · · + c k a n − k looks like a n = r n for some constant r . That would mean: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  42. Characteristic equation Let’s suppose that the closed form to a recurrence a n = c 1 a n − 1 + c 2 a n − 2 + · · · + c k a n − k looks like a n = r n for some constant r . That would mean: r n = c 1 r n − 1 + c 2 r n − 2 + · · · + c k r n − k WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  43. Characteristic equation Let’s suppose that the closed form to a recurrence a n = c 1 a n − 1 + c 2 a n − 2 + · · · + c k a n − k looks like a n = r n for some constant r . That would mean: r n = c 1 r n − 1 + c 2 r n − 2 + · · · + c k r n − k which we could rewrite as: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  44. Characteristic equation Let’s suppose that the closed form to a recurrence a n = c 1 a n − 1 + c 2 a n − 2 + · · · + c k a n − k looks like a n = r n for some constant r . That would mean: r n = c 1 r n − 1 + c 2 r n − 2 + · · · + c k r n − k which we could rewrite as: r n − c 1 r n − 1 − c 2 r n − 2 − · · · − c k r n − k = 0 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  45. Characteristic equation Let’s suppose that the closed form to a recurrence a n = c 1 a n − 1 + c 2 a n − 2 + · · · + c k a n − k looks like a n = r n for some constant r . That would mean: r n = c 1 r n − 1 + c 2 r n − 2 + · · · + c k r n − k which we could rewrite as: r n − c 1 r n − 1 − c 2 r n − 2 − · · · − c k r n − k = 0 and then we could divide both sides by r n − k to get: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  46. Characteristic equation Let’s suppose that the closed form to a recurrence a n = c 1 a n − 1 + c 2 a n − 2 + · · · + c k a n − k looks like a n = r n for some constant r . That would mean: r n = c 1 r n − 1 + c 2 r n − 2 + · · · + c k r n − k which we could rewrite as: r n − c 1 r n − 1 − c 2 r n − 2 − · · · − c k r n − k = 0 and then we could divide both sides by r n − k to get: r k − c 1 r k − 1 − c 2 r k − 2 − · · · − c k = 0 This is the characteristic equation of the recurrence. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  47. A helpful theorem Suppose we have the characteristic equation r k − c 1 r k − 1 − c 2 r k − 2 − · · · − c k = 0 for the recurrence a n = c 1 a n − 1 + c 2 a n − 2 + · · · + c k a n − k and there are solutions r 1 , r 2 , . . . r m to the characteristic equation. Then, a n = α 1 r n 1 + α 2 r n 2 + · · · + α m r n m satisfies the recurrence. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  48. Using this theorem Recall the Fibonacci recurrence: f 0 = 0 f 1 = 1 f n = f n − 1 + f n − 2 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  49. Using this theorem Recall the Fibonacci recurrence: f 0 = 0 f 1 = 1 f n = f n − 1 + f n − 2 The characteristic equation is: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  50. Using this theorem Recall the Fibonacci recurrence: f 0 = 0 f 1 = 1 f n = f n − 1 + f n − 2 The characteristic equation is: r 2 − r − 1 = 0 . Using the quadratic formula we get: ( − 1) 2 − 4(1)( − 1) � 1 ± r = 2 √ 1 ± 5 = 2 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  51. Solving the Fibonacci recurrence Thus, we know that √ √ � n � n � � 1 + 5 1 − 5 f n = α 1 + α 2 2 2 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  52. Solving the Fibonacci recurrence Thus, we know that √ √ � n � n � � 1 + 5 1 − 5 f n = α 1 + α 2 2 2 What to do next? WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  53. Solving the Fibonacci recurrence Thus, we know that √ √ � n � n � � 1 + 5 1 − 5 f n = α 1 + α 2 2 2 What to do next? Notice that we haven’t used our initial conditions: those will help us solve for α 1 and α 2 . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  54. Solving the Fibonacci recurrence Thus, we know that √ √ � n � n � � 1 + 5 1 − 5 f n = α 1 + α 2 2 2 What to do next? Notice that we haven’t used our initial conditions: those will help us solve for α 1 and α 2 . f 0 = α 1 + α 2 = 0 which means that α 2 = − α 1 . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  55. Using the second base case We know: √ √ � � � � 1 + 5 1 − 5 f 1 = α 1 + α 2 = 1 2 2 but we also know that α 2 = − α 1 from the previous page. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  56. Using the second base case We know: √ √ � � � � 1 + 5 1 − 5 f 1 = α 1 + α 2 = 1 2 2 but we also know that α 2 = − α 1 from the previous page. So, we have √ √ � � � � 1 + 5 1 − 5 − α 1 = 1 α 1 2 2 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  57. Using the second base case We know: √ √ � � � � 1 + 5 1 − 5 f 1 = α 1 + α 2 = 1 2 2 but we also know that α 2 = − α 1 from the previous page. So, we have √ √ � � � � 1 + 5 1 − 5 − α 1 = 1 α 1 2 2 which implies WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  58. Using the second base case We know: √ √ � � � � 1 + 5 1 − 5 f 1 = α 1 + α 2 = 1 2 2 but we also know that α 2 = − α 1 from the previous page. So, we have √ √ � � � � 1 + 5 1 − 5 − α 1 = 1 α 1 2 2 which implies √ √ � � 1 + 5 − 1 − 5 = 1 α 1 2 2 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  59. Using the second base case We know: √ √ � � � � 1 + 5 1 − 5 f 1 = α 1 + α 2 = 1 2 2 but we also know that α 2 = − α 1 from the previous page. So, we have √ √ � � � � 1 + 5 1 − 5 − α 1 = 1 α 1 2 2 which implies √ √ � � 1 + 5 − 1 − 5 = 1 α 1 2 2 √ � � 2 5 1 and so α = 1, which implies α 1 = 5 . √ 2 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  60. Solution Thus, the Fibonacci sequence has closed form: √ √ � n � n � � 1 1 + 5 − 1 1 − 5 f n = √ √ 2 2 5 5 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  61. Golden ratio Notice that if we have a and b satisfying: a + b = a b b WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  62. Golden ratio Notice that if we have a and b satisfying: a + b = a b b then a b = ϕ , where √ ϕ = 1 + 5 2 . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  63. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  64. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. The characteristic polynomial is: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  65. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. The characteristic polynomial is: r 2 − 2 r − 1 = 0 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  66. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. The characteristic polynomial is: r 2 − 2 r − 1 = 0 which you can solve by factoring to get WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  67. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. The characteristic polynomial is: r 2 − 2 r − 1 = 0 which you can solve by factoring to get ( r − 1) 2 = 0. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  68. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. The characteristic polynomial is: r 2 − 2 r − 1 = 0 which you can solve by factoring to get ( r − 1) 2 = 0. Thus, r = 1 is a solution. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  69. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. The characteristic polynomial is: r 2 − 2 r − 1 = 0 which you can solve by factoring to get ( r − 1) 2 = 0. Thus, r = 1 is a solution. Problem: a n = α 1 (1) n + α 2 (1) n for FIXED α 1 and α 2 has no solution! WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  70. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. The characteristic polynomial is: r 2 − 2 r − 1 = 0 which you can solve by factoring to get ( r − 1) 2 = 0. Thus, r = 1 is a solution. Problem: a n = α 1 (1) n + α 2 (1) n for FIXED α 1 and α 2 has no solution! Fortunately, we can augment our theorem: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  71. Theorem isn’t exact enough yet Recall: a n = 2 a n − 1 + a n − 2 with a 0 = 0 and a 1 = 5. The characteristic polynomial is: r 2 − 2 r − 1 = 0 which you can solve by factoring to get ( r − 1) 2 = 0. Thus, r = 1 is a solution. Problem: a n = α 1 (1) n + α 2 (1) n for FIXED α 1 and α 2 has no solution! Fortunately, we can augment our theorem: If there is a root r i with multiplicity m + 1 (i.e., ( r − r i ) m +1 is a factor), then r n i , nr n i , . . . n m r n i are all solutions of the recurrence. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

Recommend


More recommend