Wednesday

1
Hands-On Exercises #5 (04 September 2013)
1.1
A – writing some functions
Test these with matrices with different dimensions.
PN
1. Write a function to compute k=1 k12 as a function of N .
2. Write a function to compute the trace of a (square) matrix
3. Write a function to compute |I + tV| (a determinant) for any matrix V
and any value of t.
4. Show that the derivative (wrto t) of |I+tV| evaluated at t = 0 is trace(V).
Show this by evaluating the function you wrote in (2) at t and t + δ (for
a small value of δ) and divide the difference by δ. This just showing some
basic calculus:
df (t)
f (t + δ) − f (t)
= limδ→0
.
dt
δ
1.2
B – Mortgages again
Now the mortgage payment formula from the first Hands-On Exercise can get
more complicated if you make extra payments. By reducing the principal, extra
payments can reduce the outstanding principal and shorten the time that it
takes to pay off the mortgage.
Let’s start with the formula for computing the payments:
M =P
r(1 + r)N
(1 + r)N − 1
where P is the Principal (amount you’re borrowing), r is the (monthly!) interest
rate, and N is the number of months that you will be paying. Note that interest
rates are usually given as an annual rate, so the practice is to divide by 12.
First, compute the mortgage payments for borrowing $250,000 at 4% (annual) for 120 months (10 years).
The formula for the principal Pk at month k from the previous Pk−1 follows
Pk = (1 + r)Pk−1 − M − Xk
where Xk is the extra payment in month k. Now suppose Suzie Andwoman
makes extra payments of $2000 at months 9, 10, 21, 22, 33, 34, 45, 46, ... (twice
each year). After how many months will Suzie pay off the mortgage?
jfm, 04 September 2013
1