1
$\begingroup$

I was trying to answer a programming challenge about interest, and my first thought was to model the situation using a single recurrence:

principal = (principal - payment) * interest_rate;

The question actually involved finding a payment amount that would produce an exact term... but on my way to figuring that out I was playing with the components of the equation to find clues.

First, I thought that

principal = principal - payment;

Would be a linear equation of the form

y = x - a;

Which I picture as a straight line offset from the y-axis by a units.

Next, I thought that

principal = principal * interest_rate;

Would be a linear equation of the form

y = x * a;

Which I picture as a straight line with slope a.

Now, my question is -- if the interest equation is composed of these linear sub-parts, how do these sub-parts combine to form a non-linear equation? Did I do the modeling wrong? I am a little worried I am confusing linear equations and recurrence relations.

  • 1
    if the rate of change of a quantity is proportional to the quantity, you get exponential behaviour2011-05-09

1 Answers 1

5

I think your confusion comes from thinking of the recurrence relation as if it were relating the $y$-value with the $x$-value. It is true that an equation of the form $y = 2x,$ for example, would lead to a straight line. But a recurrence relation is not relating a $y$-value (the vertical position) with the corresponding $x$-value (horizontal position). Instead, it relates a $y$-value with another $y$-value: $y(t+1) = 2y(t),$ (the value at time $t+1$ is twice the value at $t$). You are not graphing $y(t+1)$ vs. $y(t)$ (which would result in a straight line); you are graphing $y$ vs. $t$. The recurrence relation does not express the dependent variable in terms of the independent variable, it relates one value of the dependent variable to another value of the dependent variable.