from math import e

def pv(p, k, t):
  k = k / 100
  return p * e**(-k*t)
  
def fv(p, k, t):
  k = k / 100
  return p * e**(k*t)

def apv(r, k, t):
  k = k / 100
  return (r / k) * (1 - e**(-k*t))
  
def afv(r, k, t):
  k = k / 100
  return (r / k) * (e**(k*t) - 1)

Present Value of a Trust

In 18 years, Maggie Oaks is to receive $200,000 under the terms of a trust established by her grandparents. Assuming an interest rate of 5.8%, comopounded continuously, what is the present value of Maggie’s legacy?

pv(200000, 5.8, 18)
## 70408.73742039692

Salary Value

At age 35, Rochelle earns her MBA and accepts a position as vice president of a company. Assume she will retire at the age of 65, having received an annual salary of $95,000 and the that interest rate is 6% compounded continuously.

  • What is the present valye of her position?
  • What is the accumulated future value of her position?
years = 65 - 35

apv(95000, 6, years)
## 1321610.0936491548
afv(95000, 6, years)
## 7995275.151987163

Early Retirement

Lauren Johnson signs a 10-yr contract as a loan office for a bank, at a salary of $84,000 per year. After 7 yr, the bank offers her early retirement. What is the least amount the bank should offer Lauren, given that the going interest rate is 7.4%, compounded continuously?

total_comp = afv(84000, 7.4, 10)
earned_comp = afv(84000, 7.4, 7)

total_comp - earned_comp
## 473656.2012921268