-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath.tex
138 lines (108 loc) · 3.77 KB
/
math.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{commath}
\usepackage{mathtools}
% For multipage align*
\allowdisplaybreaks
\title{Math Notes for Compound Interest}
\author{}
\date{}
\begin{document}
\maketitle
\section{Basic Formula for Debt Owed}
First let's calculate the debt after a time period $t$ given a principal $P$, an
interest rate $r$, a compound frequency $n$, a cyclic payment $p$, and a payment
frequency $m$.
It is assumed that $n \geq m$.
\begin{align*}
a &= 1 + \frac{r}{n}\\
D_0 &= P\\
D_1 &= aP\\
D_2 &= a^2 P\\
&\vdots\\
D_{n/m} &= a^{n/m} P - p\\
D_{n/m+1} &= a (a^{n/m} P - p)\\
D_{n/m+2} &= a^2 (a^{n/m} P - p)\\
&\vdots\\
D_{2n/m} &= a^{n/m} (a^{n/m} P - p) - p\\
&= a^{2n/m} P - a^{n/m} p - p\\
&= a^{2n/m} P - (a^{n/m} + 1) p\\
&\vdots\\
D_{nt} &= a^{nt} P - p \sum_{i = 0}^{mt - 1} a^{in/m}\\
\end{align*}
Remember that we can find the solution to the finite exponential series as so
\begin{align*}
x &= \sum_{i = 0}^{n - 1} a^i\\
a x &= \sum_{i = 1}^{n} a^i\\
a x - a^n + 1 &= \sum_{i = 0}^{n - 1} a^i\\
a x - a^n + 1 &= x\\
(1 - a) x &= 1 - a^n\\
x &= \frac{1 - a^n}{1 - a}
\end{align*}
Plugging this in gives us our debt calculation.
\begin{align*}
D_{nt} &= a^{nt} P - p \frac{1 - a^{mt (n/m)}}{1 - a^{n/m}}\\
&= a^{nt} P - p \frac{1 - a^{nt}}{1 - a^{n/m}}
\end{align*}
\section{Calculating Parameters from Known Values}
For the following we will always assume $D_{nt} = 0$.
\subsection{Principal}
\begin{align*}
0 &= D_{nt}\\
0 &= a^{nt} P - p \frac{1 - a^{nt}}{1 - a^{n/m}}\\
P &= \frac{a^{-nt} - 1}{1 - a^{n/m}} p
\end{align*}
\subsection{Payments}
From here we can calculate the minimum payment needed to pay off all debts in
a certain time frame.
\begin{align*}
P &= \frac{a^{-nt} - 1}{1 - a^{n/m}} p\\
p &= \frac{1 - a^{n/m}}{a^{-nt} - 1} P
\end{align*}
Taking the limit of $t$ we can also find the minimum payment needed to maintain
debt.
\begin{align*}
p_\text{min} &= \lim_{t \to \infty} \frac{1 - a^{n/m}}{a^{-nt} - 1} P\\
&= \frac{1 - a^{n/m}}{-1} P\\
&= (a^{n/m} - 1) P
\end{align*}
\subsection{Time}
We can also calculate how long it will take to pay off all debts.
\begin{align*}
p &= \frac{1 - a^{n/m}}{a^{-nt} - 1} P\\
(a^{-nt} - 1) p &= (1 - a^{n/m}) P\\
a^{-nt} - 1 &= (1 - a^{n/m}) \frac{P}{p}\\
a^{-nt} &= (1 - a^{n/m}) \frac{P}{p} + 1\\
-nt &= \log_a\del{(1 - a^{n/m}) \frac{P}{p} + 1}\\
t &= -\frac{\log_a\del{(1 - a^{n/m}) \frac{P}{p} + 1}}{n}\\
\end{align*}
\section{Recommended Payment}
\begin{align*}
T &= mtp\\
\dod{T}{p} &= -\delta\\
mt &= -\delta\\
t &= -\frac{\delta}{m}\\
p &= \frac{1 - a^{n/m}}{a^{n\delta/m} - 1} P
\end{align*}
\section{Meeting a Specific Return on Investment}
Say that we want to only pay a specific amount of return on a debt.
For instance we only want to pay \$1200 back on a \$1000 dollar loan.
We can say $G$ is what we're willing to pay back, where $G > P$.
We then have
\begin{align*}
mtp &= G\\
t &= \frac{G}{mp}\\
p &= \frac{1 - a^{n/m}}{a^{-nt} - 1} P\\
&= \frac{1 - a^{n/m}}{a^{-nG/mp} - 1} P
\end{align*}
This is easily solvable, but we can use Newton's method to find an answer using
a calculator.
\begin{align*}
f(p) &= \frac{1 - a^{n/m}}{a^{-nG/mp} - 1} P\\
f'(p) &= -\frac{1 - a^{n/m}}{(a^{-nG/mp} - 1)^2} P \del{-\frac{nG \ln(a)}{mp} a^{-nG/mp}} \del{-\frac{1}{p^2}}\\
&= -\frac{1 - a^{n/m}}{p^2 (a^{-nG/mp} - 1)^2} \del{\frac{nG \ln(a)}{mp} a^{-nG/mp}} P\\
&= \frac{a^{n/m} - 1}{p^2 (a^{-nG/mp} - 1)^2} \del{\frac{nG \ln(a)}{mp} a^{-nG/mp}} P\\
p_{n + 1} &= p_n - \frac{f(p_n)}{f'(p_n)}
\end{align*}
\end{document}