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.