Recurrence Relations

Similar documents
Definition: A sequence is a function from a subset of the integers (usually either the set

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

1 Recursive Algorithms

3.3 Accumulation Sequences

1 Examples of Weak Induction

Chapter 5: Sequences, Mathematic Induction, and Recursion

Recurrence Relations and Recursion: MATH 180

Sec$on Summary. Sequences. Recurrence Relations. Summations. Ex: Geometric Progression, Arithmetic Progression. Ex: Fibonacci Sequence

Section Summary. Sequences. Recurrence Relations. Summations Special Integer Sequences (optional)

Vocabulary. Term Page Definition Clarifying Example. arithmetic sequence. explicit formula. finite sequence. geometric mean. geometric sequence

Advanced Counting Techniques. 7.1 Recurrence Relations

SEQUENCES AND SERIES

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

Every subset of {1, 2,...,n 1} can be extended to a subset of {1, 2, 3,...,n} by either adding or not adding the element n.

12 Sequences and Recurrences

Sequences and Series. College Algebra

EECS 1028 M: Discrete Mathematics for Engineers

Discrete Structures Lecture Sequences and Summations

Algorithm Analysis Recurrence Relation. Chung-Ang University, Jaesung Lee

CS311H. Prof: Peter Stone. Department of Computer Science The University of Texas at Austin

Chapter 8: Recursion. March 10, 2008

Lesson 2: Recursive Formulas for Sequences

CS 2210 Discrete Structures Advanced Counting. Fall 2017 Sukumar Ghosh

5. Sequences & Recursion

Mathematical Induction

Ex. Here's another one. We want to prove that the sum of the cubes of the first n natural numbers is. n = n 2 (n+1) 2 /4.

Consider an infinite row of dominoes, labeled by 1, 2, 3,, where each domino is standing up. What should one do to knock over all dominoes?

CSC2100B Data Structures Analysis

Section Summary. Definition of a Function.

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Math.3336: Discrete Mathematics. Advanced Counting Techniques

Recurrence Relations

4.1 All in a Row (BC)

MEETING 9 - INDUCTION AND RECURSION

Exam 2 Solutions. x 1 x. x 4 The generating function for the problem is the fourth power of this, (1 x). 4

Lesson 24: True and False Number Sentences

COL106: Data Structures and Algorithms (IIT Delhi, Semester-II )

Solving Recurrence Relations 1. Guess and Math Induction Example: Find the solution for a n = 2a n 1 + 1, a 0 = 0 We can try finding each a n : a 0 =

Section 4.1: Sequences and Series

CMSC250 Homework 9 Due: Wednesday, December 3, Question: Total Points: Score:

MATH 3012 N Homework Chapter 9

Lesson 10: Solving Inequalities

Generating Functions and the Fibonacci Sequence

Number Representations

Fall 2017 Test II review problems

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

Outline. We will cover (over the next few weeks) Induction Strong Induction Constructive Induction Structural Induction

Learning Objectives

V. Adamchik 1. Recurrences. Victor Adamchik Fall of 2005

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

Lecture 6: Recurrent Algorithms:

Propositional Logic, Predicates, and Equivalence

Sequences A sequence is a function, where the domain is a set of consecutive positive integers beginning with 1.

Sequences. 1. Number sequences. 2. Arithmetic sequences. Consider the illustrated pattern of circles:

6.2 SOLVING EASY RECURRENCES

Homework 2 Solution Section 2.2 and 2.3.

Sequences and Summations

Assignment 16 Assigned Weds Oct 11

Section 2: Equations and Inequalities

16. . Proceeding similarly, we get a 2 = 52 1 = , a 3 = 53 1 = and a 4 = 54 1 = 125

Lesson 12.7: Sequences and Series

Legendre s Equation. PHYS Southern Illinois University. October 18, 2016

Sequences and Summations ICS 6D. Prof. Sandy Irani

Carmen s Core Concepts (Math 135)

Continuously Compounded Interest. Simple Interest Growth. Simple Interest. Logarithms and Exponential Functions

Convert the equation to the standard form for an ellipse by completing the square on x and y. 3) 16x y 2-32x - 150y = 0 3)

or the number of bacteria in a colony after each hour, if the colony starts with one bacteria and each bacteria divides into two every hour

Lesson 14: Solving Inequalities

Discrete Mathematics -- Chapter 10: Recurrence Relations

10-1 Sequences as Functions. Determine whether each sequence is arithmetic. Write yes or no. 1. 8, 2, 12, 22

S.3 Geometric Sequences and Series

Lesson 26: Problem Set Sample Solutions

Mathematical Induction

JUST THE MATHS UNIT NUMBER 2.1. SERIES 1 (Elementary progressions and series) A.J.Hobson

Problem Set 5 Solutions

A SUMMARY OF RECURSION SOLVING TECHNIQUES

CS 220: Discrete Structures and their Applications. Mathematical Induction in zybooks

1 = k1 + k 2 2 = 3k 1 + 5k 2

2009 A-level Maths Tutor All Rights Reserved

Math Assignment 11

Applications. More Counting Problems. Complexity of Algorithms

Sequences and Series

(Infinite) Series Series a n = a 1 + a 2 + a a n +...

Lecture Notes 6: Dynamic Equations Part A: First-Order Difference Equations in One Variable

On Linear Recursive Sequences with Coefficients in Arithmetic-Geometric Progressions

GSE Algebra 1. Unit Two Information. Curriculum Map: Reasoning with Linear Equations & Inequalities

Algebra II. Table of Contents. Sequences and Series. Slide 1 / 153. Slide 2 / 153. Slide 3 /

The given pattern continues. Write down the nth term of the sequence {an} suggested by the pattern. 3) 4, 10, 16, 22, 28,... 3)

1.1 The Language of Algebra 1. What does the term variable mean?

Math 1 Exponential Functions Unit 2018

WORD: EXAMPLE(S): COUNTEREXAMPLE(S): EXAMPLE(S): COUNTEREXAMPLE(S): WORD: EXAMPLE(S): COUNTEREXAMPLE(S): EXAMPLE(S): COUNTEREXAMPLE(S): WORD:

Math 475, Problem Set #8: Answers

5 1 Worksheet MATCHING: For # 1 4, match each graph to its equation. Not all equations will be used. 1) 2) 3) 4)

Further Mathematics 2016 Core: RECURSION AND FINANCIAL MODELLING Chapter 5 - Recurrence Relations

Sequence. A list of numbers written in a definite order.

MATH 415, WEEKS 14 & 15: 1 Recurrence Relations / Difference Equations

Worksheets for GCSE Mathematics. Quadratics. mr-mathematics.com Maths Resources for Teachers. Algebra

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

Section 4.2: Mathematical Induction 1

Sequences and the Binomial Theorem

Transcription:

Recurrence Relations Recurrence Relations Reading (Epp s textbook) 5.6 5.8 1

Recurrence Relations A recurrence relation for a sequence aa 0, aa 1, aa 2, ({a n }) is a formula that relates each term a k to certain of its predecessors aa kk 1, aa kk 2,, aa kk ii (one or more of the previous terms of the sequence), where i is an integer with kk ii 0. In other words, a recurrence relation is like a recursively defined sequence, but without specifying any initial values (initial conditions). Therefore, the same recurrence relation can have (and usually has) multiple solutions. If both the initial conditions and the recurrence relation are specified, then the sequence is uniquely determined. 2

Recurrence Relations Example: Consider the recurrence relation a n = 2a n-1 a n-2 for n = 2, 3, 4, Is the sequence {a n } with a n = 3n a solution of this recurrence relation? For n 2 we see that 2a n-1 a n-2 = 2(3(n 1)) 3(n 2) = 3n = a n. Therefore, {a n } with a n = 3n is a solution of the recurrence relation. 3

Recurrence Relations Is the sequence {a n } with a n = 5 a solution of the same recurrence relation? For n 2 we see that 2a n-1 a n-2 = 2 5-5 = 5 = a n. Therefore, {a n } with a n =5 is also a solution of the recurrence relation. 4

Recurrence Relations Fibonacci Numbers: Consider the recurrence relation FF kk = FF kk 1 + FF kk 2 for all integers kk 2 Initial conditions FF 0 = 1, FF 1 = 1. Compute FF 2, FF 3 and so forth through FF 9. The method of Iteration. FF 2 = FF 1 + FF 0 = 1 + 1 = 2 FF 3 = FF 2 + FF 1 = 2 + 1 = 3 FF 4 = FF 3 + FF 2 = 3 + 2 = 5 FF 5 = FF 4 + FF 3 = 5 + 3 = 8 FF 6 = FF 5 + FF 4 = 8 + 5 = 13 FF 7 = FF 6 + FF 5 = 13 + 8 = 21 FF 8 = FF 7 + FF 6 = 21 + 13 = 34 FF 9 = FF 8 + FF 7 = 21 + 34 = 55 5

Modeling with Recurrence Relations Example: Someone deposits $10,000 in a savings account at a bank yielding 5% per year with interest compounded annually. How much money will be in the account after 30 years? Solution: Let P n denote the amount in the account after n years. How can we determine P n on the basis of P n-1? We can derive the following recurrence relation: P n = P n-1 + 0.05P n-1 = 1.05P n-1. 6

Modeling with Recurrence Relations The initial condition is P 0 = 10,000. Then we have: P 1 = 1.05P 0 P 2 = 1.05P 1 = (1.05) 2 P 0 P 3 = 1.05P 2 = (1.05) 3 P 0 P n = 1.05P n-1 = (1.05) n P 0 We now have an explicit formula to calculate P n for any natural number n and can avoid the iteration. Let us use this formula to find P 30 under the initial condition P 0 = 10,000: P 30 = (1.05) 30 10,000 = 43,219.42 7

Explicit Formulas A sequence a0, a1, a2,... is called an arithmetic sequence if, and only if, there is a constant d such that aa nn = aa 0 + dd nn, for all integers n 0. A sequence a0, a1, a2,... is called a geometric sequence if, and only if, there is a constant r such that aa nn = aa 0 rr nn, for all integers n 0. 8

Correctness of an Explicit Formula Check the Correctness of an explicit formula by a Mathematical Induction!! Example: Let c0, c1, c2,... be the sequence defined as follows: cc kk = 2cc kk 1 + kk for all integers k 1, cc 0 = 1. Suppose your calculations suggest that c0, c1, c2,... satisfies the following explicit formula: Is this formula correct? cc nn = 2 nn + nn for all integers n 0. 9

Solving Recurrence Relations In general, we would prefer to have an explicit formula to compute the value of a n rather than conducting n iterations. For one class of recurrence relations, we can obtain such formulas in a systematic way. Those are the recurrence relations that express the terms of a sequence as linear combinations of previous terms. 10

Solving Recurrence Relations Definition: A linear homogeneous recurrence relation of degree k with constant coefficients is a recurrence relation of the form: a n = c 1 a n-1 + c 2 a n-2 + + c k a n-k, Where c 1, c 2,, c k are real numbers, and c k 0. 11

Solving Recurrence Relations Examples: The recurrence relation P n = (1.05)P n-1 is a linear homogeneous recurrence relation of degree one. The recurrence relation f n = f n-1 + f n-2 is a linear homogeneous recurrence relation of degree two. The recurrence relation a n = a n-5 is a linear homogeneous recurrence relation of degree five. 12

Solving Recurrence Relations Examples Which of these are linear homogenous recurrence relations with constant coefficients? aa nn = aa nn 1 + 2aa nn 5 aa nn = 2aa nn 2 + 5 aa nn = aa nn 1 + nn aa nn = aa nn 1 aa nn 2 aa nn = nn aa nn 1 Yes; with coefficients 1 and 2 (degree 5) No; not homogenous No; not homogenous No; not linear No; no constant coefficients. 13

Solving Recurrence Relations Cook-book recipe for solving linear homogenous recurrence relations with constant coefficients. We try to find solutions of the form a n = r n, where r is a constant. a n = r n is a solution of the recurrence relation a n = c 1 a n-1 + c 2 a n-2 + + c k a n-k if and only if r n = c 1 r n-1 + c 2 r n-2 + + c k r n-k. Divide this equation by r n-k and subtract the right-hand side from the left: r k - c 1 r k-1 - c 2 r k-2 - - c k-1 r - c k = 0 This is called the characteristic equation of the recurrence relation. 14

Solving Recurrence Relations The solutions of this equation are called the characteristic roots of the recurrence relation. Let us now consider linear homogeneous recurrence relations of degree two. Theorem: Let c 1 and c 2 be real numbers. Suppose that r 2 c 1 r c 2 = 0 has two distinct roots r 1 and r 2. Then the sequence {a n } is a solution of the recurrence relation a n = c 1 a n-1 + c 2 a n-2 if and only if a n = C r 1 n + D r 2 n for n = 0, 1, 2,, where C and D are constants. See pp. 321 and 322 for the proof. 15

Example: Solving Recurrence Relations What is the solution of the recurrence relation a n = a n-1 + 2a n-2 with a 0 = 2 and a 1 = 7? Solution: The characteristic equation of the recurrence relation is r 2 r 2 = 0. Its roots are r = 2 and r = -1. Hence, the sequence {a n } is a solution to the recurrence relation if and only if: a n = C 2 n + D (-1) n for some constants C and D. 16

Solving Recurrence Relations Given the equation a n = C 2 n + D (-1) n and the initial conditions a 0 = 2 and a 1 = 7, it follows that a 0 = 2 => C + D = 2 a 1 = 7 => C 2 + D (-1) = 7 Solving these two equations gives us C = 3 and D = -1. Therefore, the solution to the recurrence relation and initial conditions is the sequence {a n } with a n = 3 2 n (-1) n. 17

Example: Solving Recurrence Relations Give an explicit formula for the Fibonacci numbers. Solution: The Fibonacci numbers satisfy the recurrence relation f n = f n-1 + f n-2 with initial conditions f 0 = 1 and f 1 = 1. The characteristic equation of the recurrence relation is r 2 r 1 = 0. Its roots are: r 1 1+ 5 =, r 2 2 1 = 2 5 18

Solving Recurrence Relations Therefore, the Fibonacci numbers are given by f n 1+ 5 = C 2 n 1 + D 2 5 n f 0 = 0 => C + D = 1 f 1 = 1 => f 1+ 5 1 = C + 2 D 2 1 = The unique solution to this system of two equations and two variables is: 5 1+ 5 1 5 C =, D = 2 5 2 5 1 19

Solving Recurrence Relations So finally we obtained an explicit formula for the Fibonacci numbers: 20 1 1 2 5 1 5 1 2 5 1 5 1 + + + = n n f n

Solving Recurrence Relations But what happens if the characteristic equation has only one root? How can we then match our equation with the initial conditions a 0 and a 1? Theorem: Let c 1 and c 2 be real numbers with c 2 0. Suppose that r 2 c 1 r c 2 = 0 has only one root r 0. A sequence {a n } is a solution of the recurrence relation a n = c 1 a n-1 + c 2 a n-2 if and only if a n = C r 0 n + D n r 0n, for n = 0, 1, 2,, where C and D are constants. 21

Solving Recurrence Relations Example: What is the solution of the recurrence relation a n = 6a n-1 9a n-2 with a 0 = 1 and a 1 = 6? Solution: The only root of r 2 6r + 9 = 0 is r 0 = 3. Hence, the solution to the recurrence relation is a n = C 3 n + D n3 n for some constants α 1 and α 2. To match the initial condition, we need a 0 = 1 => C = 1 a 1 = 6 => C 3 + D 3 = 6 Solving these equations yields C = 1 and D = 1. Consequently, the overall solution is given by a n = 3 n + n3 n. 22