Skip to content

Instantly share code, notes, and snippets.

@saulshanabrook
Last active April 18, 2024 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saulshanabrook/4331ba81e39e972f20b243ebea5f4a06 to your computer and use it in GitHub Desktop.
Save saulshanabrook/4331ba81e39e972f20b243ebea5f4a06 to your computer and use it in GitHub Desktop.
  • $l$: lifespan of the item in years
  • $a$: current age of the item
  • $p$: current price of item
  • $r$: inflation rate per year (as a number > 1 i.e. 1.03)
  • $f$: initial reserve for the item
  • $y_i$: amount set aside for the item at year $i$

We would like to have a capital improvements plan where our:

  1. Monthly savings for each improvement increase by the inflation rate each year: $y_{i+1}=y_i*r$
  2. After replacing the item the first time, the account is zeroed out: $f+\sum\limits_{i=1}^{l-a} y_i=p*r^{l-a}$
  3. After replacing it the second time, it is also zeroed out: $f+\sum\limits_{i=1}^{2l-a} y_i=p * r^{l-a} + p * r^{2l-a}$

For example, if our roof needs to be replaced next year ($l-a=1$) then our initial reserve plus how much we save in the first year should be equal to the cost next year of the item, which is the current price accounting for one year of inflation ( $f+y_1=p*r$ ).

We would like to calculate the initial reserve $f$ and a formula for the amount saved during the first year $y_1$.

We can use Wolfram Alpha to solve for these variables, which gives us:

$$f=\frac{p(r^a-1)r^{l-a}}{r^l-1}$$

and

$$y_1=\frac{p(r-1)r^l}{r^l-1}$$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment