Recurrence Relations in Excel

Slides:



Advertisements
Similar presentations
Mathematics of Finance It’s all about the $$$ in Sec. 3.6a.
Advertisements

259 Lecture 7 Spring 2015 Population Models in Excel.
Recursion.
Exponential Growth.
1 Learning Objectives for Section 3.2 After this lecture, you should be able to Compute compound interest. Compute the annual percentage yield of a compound.
259 Lecture 3 Spring 2015 Finance Applications with Excel – Annuities an Amortization.
Exponential Functions and their Graphs
Applied Discrete Mathematics Week 9: Relations
5  Exponential Functions  Logarithmic Functions  Compound Interest  Differentiation of Exponential Functions  Exponential Functions as Mathematical.
Periodic Compound Interest. Annual Compound Interest.
Compound Interest 8.2 Part 2. Compound Interest A = final amount P = principal (initial amount) r = annual interest rate (as a decimal) n = number of.
13.2 Recursive Definitions Objective 1) Provide the recursive definition for sequences; 2) Identify the type of a sequence from a recursive definition.
259 Lecture 6 Spring 2013 Recurrence Relations in Excel.
Lecture#16 Discrete Mathematics. Recursion Now, 1 is an odd positive integer by the definition base. With k = 1, = 3, so 3 is an odd positive integer.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Introduction Logarithms can be used to solve exponential equations that have a variable as an exponent. In compound interest problems that use the formula,
5.2 Compound Interest.
Unit 8, Lesson 2 Exponential Functions: Compound Interest.
The Natural Base e An irrational number, symbolized by the letter e, appears as the base in many applied exponential functions. This irrational number.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
Chapter 5 Learning Objectives
Finance Applications with Excel – Annuities an Amortization
The Time Value of Money - The Basics
Chapter 21: Savings Models Lesson Plan
Chapter 4 EXPONENTIAL FUNCTIONS
5.1 Exponential Functions
Lecture 5: Time Value of Money
Time Value of Money 1: Analyzing Single Cash Flows
Section 6.7 Financial Models.
CHAPTER 8 Personal Finance.
Mathematics of Finance
Exponential Functions and Models
Graphing Exponential Growth Functions
Chapter 5: Inverse, Exponential, and Logarithmic Functions
Population Models in Excel
Chapter 2 Functions and Graphs
8.3 Compound Interest HW: (1-21 Odds, Odds)
(10 ) WARM UP Simplify the expression. 1. e –4x e12x ANSWER
5 MATHEMATICS OF FINANCE
Formulas for Compound Interest
Do Now:  .
Chapter 3 Mathematics of Finance
Do Now: Think about the function y = 2x. What do you think happens when x gets really big and positive? How about when x gets really big and negative?
Exponential Growth and Decay
INTRODUCTION TO THE FAMILY OF EXPONENTIAL FUNCTIONS
Introduction to Recurrence Relations
Mathematics of Finance
Exponential and Logarithmic Functions
Compound Interest.
9 The Mathematics of Spiral Growth
7-Chapter Notes Algebra 1.
6.1 Exponential Growth and Decay Functions
Copyright © Cengage Learning. All rights reserved.
Finance Applications with Excel – Simple and Compound Interest
Exponential Functions and Graphs
Chapter 4: The Time Value of Money
CHAPTER 8 Personal Finance.
Contemporary Engineering Economics
Finding Limits Graphically and Numerically
Exponential Growth & Decay and Compound Interest
Chapter 2 Bond Prices and Yields
Exponential Growth & Decay
Mathematical Explorations
6.1 Exponential Growth and Decay Functions
Mathematical Induction
Supplemental Material
C2D8 Bellwork: Fill in the table Fill in the blanks on the worksheet
C2 D6 Bellwork: Solve for x. Be able to give the exact and approximate answers. 2) 3) 1) total: +1.
§8.3, Compound Interest.
Presentation transcript:

Recurrence Relations in Excel 259 Lecture 6 Spring 2017 Recurrence Relations in Excel

Recurrence Relations Recall the idea of recurrence relation, which we saw briefly in Lecture 1. In Example 4, we found 1+2+…+n in Excel by letting x(1) = 1 and defining x(n) := x(n-1) + n for n ≥ 2. A recurrence relation (or recursive relation) is a function x defined on the non-negative integers such that x(n) = f(x(n-1), x(n-2), … , x(2), x(1), x(0)), i.e. the value of x at n is a function of the values of x at some or all of the non-negative integers less than n.

Example 1: Some Recurrence Relations (a) Factorial function x(0) = 1 x(n) = n*x(n-1) for n ≥ 1 Thus x(0) = 1 x(1) = 1*x(0) = 1*1 = 1 x(2) = 2*x(1) = 2*1 = 2 x(3) = 3*x(2) = 3*2 = 6 etc.

Example 1: Some Recurrence Relations (cont.) (b) Fibonacci Sequence x(0) = 1 x(1) = 1 x(n) = x(n-1) + x(n-2) for n ≥ 2 Hence, x(2) = x(1) + x(0) = 1 + 1 = 2 x(3) = x(2) + x(1) = 2 + 1 = 3 x(4) = x(3) + x(2) = 3 + 2 = 5 x(5) = x(4) + x(3) = 5 + 3 = 8 etc.

Example 1: Some Recurrence Relations (cont.) (c) Compound Interest Invest principal P in an account earning interest rate i per period. Then the amount x(n) invested at time period n can be defined recursively by x(0) = P x(n) = (1+i)*x(n-1) for n ≥ 1 Given a principal P = $1000, find x(5) with compounding once per year and an annual interest rate 6%.

Example 1: Some Recurrence Relations (cont.)

Notes In order for a recurrence relation to make sense, some of the x(i)’s must be specified as initial conditions. The number of “time steps” a recurrence relation makes reference to is called its order. In Example 1(a) and 1(c), the order is 1. In Example 1(b), the order is 2. For recurrence relation x(n) = 3*x(n-4), the order is 4.

Closed-Form Solutions Suppose we want to know x(100) for a given recurrence relation. To do so, we need to compute x(99), which in turn requires x(98), … and so on, until we’ve found x(0). This means that a recurrence relation may be “hard” to work with for large values of non-negative integer n.

Closed-Form Solutions (cont.) Sometimes it is possible to rewrite a recurrence relation in an equivalent form that doesn’t require calculation of n function values to get x(n). Notice that for the Compound Interest recurrence relation in Example 1(c), x(1) = (1+i)*x(0) x(2) = (1+i)*x(1) = (1+i)*(1+i)*x(0)= (1+i)2 x(0) … x(n) = (1+i)n*x(0) This last expression can be shown to hold via induction …

Closed-Form Solutions (cont.) We call the expression x(n) = (1+i)n*x(0) a closed-form solution of the recurrence relation for Compound Interest. Compare this to the formula we saw in Lecture 2!! Thus to find x(5) in this example, we could have used the closed-form solution to get x(5) = (1+0.06)5*x(0) = (1.06)5*1000 = $1338.23.

Remarks Closed-form solutions can’t always be found this easily. The Fibonacci sequence recurrence relation also has a closed form: The closed-form solution for Compound Interest is an exponential function with base (1+i).

Exponential Growth A function x(n) = an, defined for integers n ≥ 0, grows exponentially if a > 1, decays exponentially if 0 < a < 1, is a damped oscillation if -1 < a < 0, is an undamped oscillation if a < -1, and is constant or oscillates between two points if a = 0, 1 or -1.

Example 2: A “bad” investment! We invest P dollars in the Jurassic Pickle company’s stock, hoping to strike it rich! At the advice of our Fredward Smith investment advisor, we also dollar-cost average by purchasing h dollars of stock at the end of each month. Unfortunately, the Jurassic Pickle stock loses i% of its value each month. Find a recurrence relation to describe this investment.

Example 2 (cont.) For this investment, Let x(0) = P x(n) = (1-i)*x(n-1) + h for n ≥ 1 If i = 5% and h = 5 dollars, what happens in the “long run” to an initial investment of P = 50, 75, 100, 125, 150 dollars?

Example 2 (cont.)

Example 2 (cont.)

Example 2 (cont.) Notice that for each choice of principal P, the stock investment value appears to approach the same value of $100, as n gets larger and larger!

Fixed Points If a recurrence relation’s values eventually “settle down” to a fixed value X as n gets larger and larger, then we say X is a fixed point of the recurrence relation. A fixed point of a recurrence relation of order one, x(n) = f(x(n-1)), is a number X, such that f(X) = X.

Fixed Points (cont.) The recurrence relation in Example 2, has X = 100 as a fixed point. In general, fixed points of first order recurrence relations x(n) = f(x(n-1)) can be found by solving X = f(X) for X. If a recurrence relation has a fixed point, it may need to be found numerically! For the relation in Example 2, we find from X = (1-i)*X+ h, that X = h/i = 5/0.05 = 100.

Example 3: Another investment! Repeat Example 2 with an investment that pays 5% interest compounded monthly, with an allowance of $5 removed at the end of each month. This time, the recurrence relation is x(0) = P x(n) = (1+i)*x(n-1) - h for n ≥ 1

Example 3 (cont.)

Example 3 (cont.)

Example 3 (cont.) Again, there is a fixed point for this recurrence relation, namely X = 100.

Stability of Fixed Points We call the fixed point X = 100 for Example 2 a stable fixed point. We call the fixed point X = 100 for Example 3 an unstable fixed point.

References A Course in Mathematical Modeling by Douglas Mooney and Randall Swift.