lecture-02 - CMSC-16100 Lecture 2 Let's do something a bit...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CMSC-16100 Lecture 2 Let's do something a bit more interesting. .. Let's suppose you want to compute the monthly payment on a loan -- a house loan, a car loan, or perhaps even a student loan :-). There are a lot of ways we might approach this computationally, but we're going to do this the old fashioned way. We're going to think about it. .. What we want to do is to write a function payment years rateInPercent prinicipal Here we assume a standard loan, in which interest is compounded monthly. Let's try to discover an expression for the balance (b_n) after making the n-th payment, in terms of the monthly payment (m), the principal (p), and the interest rate (i). b_0 = p b_1 = p (1 + i/1200) - m b_2 = p (1 + i/1200)^2 - m (1 + i/1200) - m OK. The first thing we notice is that the term (1 + i/1200) occurs a lot. This is basically the result of converting the interest from percentage to unit-based, and from an incremental rate to a multiplier. So let's let j = (1 + i/1200) be the monthly interest multiplier. b_0 = p b_1 = p j - m b_2 = p j^2 - m j - m b_3 = p j^3 - m j^2 - m j - m = p j^3 - m (j^2 + j + 1) Now, at this point, we might recognize that m is being multiplied by a geometric series, and recall the identity j^k + j^(k-1) + . .. + j^2 + j + 1 = (j^(k+1) - 1)/(j-1) Note that this requires j != 1, i.e., a non-zero interest rate. So we might *conjecture* b_n = p j^n - m (j^n - 1) / (j-1) Now, when I was in college, induction from the first few examples was viewed as satisfactory for elementary education majors. I certainly don't mean to denegrate elementary education majors, but our mathematical standards are higher. Can we prove this? Yes, by induction.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/10/2009 for the course CMSC 16200 taught by Professor Kurtz during the Fall '09 term at UChicago.

Page1 / 4

lecture-02 - CMSC-16100 Lecture 2 Let's do something a bit...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online