Renting Vs Buying?? Define Function? A family has $100,000 in savings accounts. They seek financial advice to develop a ten-year housing strategy. The two options are: continue renting the apartment or take a bank loan to buy a property.
(a) Assume that they spend USD1900 per annum on renting the apartment and put their $100,000 savings in a bank deposit at the interest rate 2% per annum compounded annually. Find the family net worth (calculated as the money on the deposit minus the rent paid, in thousand dollars) after t years. Define the function frent : [0, 10] → R by allowing t to be a real number in the expression for the net worth.
(b) Now assume that the family takes a bank loan of USD400,000 for the period of ten years to buy a property worth USD500,000. This is an interest only loan at 5% per annum so the total sum to be repaid to the bank after ten years is $600,000 (one and a half of the original amount). Suppose the loan is paid regularly so it is described by a linear function, whose value at t = 10 equals the total sum to be repaid to the bank. The property value is expected to grow at the rate of 2% per annum. Similarly to (a), define the function fbuy : [0, 10] → R corresponding to the family net worth (calculated as the property value minus the loan paid, in thousand dollars) after t years?
FYI, I've never done Personal finance math (I have CS background), anyone wants to shed a light on this math problem? Have no idea how to approach this problem. 
 A: At a) the family starts with $100,000$. This amount is compounded once. At the end of the year they pay $1900$. The net value after one year is therefore $NV_1=100,000\cdot 1.02-1900=100,100$. Now this value is compounded one year:
$(100,000\cdot 1.02-1900)\cdot 1.02=102,102$. Here we see that the rent is compounded as well. 
And the second rent is paid wich gives a net value of  $NV_2=102,102-1900=100,202$. This was an iterative method.
In general the net value after t years 
$$NV_t=100000\cdot (1.02)^t-1900\cdot \frac{1.02^t-1}{0.02}$$
Let´s check for $t=2$ if we get the same value as the value which was obtained by the iterative method.
$$NV_2=100000\cdot (1.02)^2-1900\cdot \frac{1.02^2-1}{0.02}=100,202 \ \checkmark$$
I hope it has become a little bit clearer why the formula is valid.

At b) the family has to pay back 10 times an annuity of $r$ which equals $600,000$ at $t=10$. Thus the equation is 
$$r\cdot \frac{1.05^{10}-1}{1.05-1}=600$$ 
I take $600$ here since it is required that the unit of the function is" in thousand dollars". After the value of $r$ has been calculated the function $f_{\text{buy}}$ is
$$f_{\text{buy}}(t)=500\cdot 1.02^t-r\cdot \frac{1.05^{t}-1}{1.05-1}$$
$$\textrm{property value - loan paid}$$
