Dyalog Programming Contest 2010 - Formulae
The bank loan is amortized though equal payments over the entire term, using the following formulas:
BANKMR = Bank monthly mortgage rate
= BANKRATE/12
BANKPMT = Bank monthly payment
= BANKAMT x BANKMR/(1-(1+BANKMR)^-TERM)
BANKBAL[0] = Initial bank loan balance
= BANKAMT
BANKINT[I] = Bank mortgage interest in month I
= BANKBAL[I-1] x MORATE
BANKPRN[I] = Bank principal repaid in month I
= BANKPMT - BANKINT[I]
BANKBAL[I] = Bank loan balance after month I
= BANKBAL[I-1] - BANKPRN[I]
Formulae for the following five items are parallel to the above formulas:
DADMR = Parent monthly mortgage rate
DADPMT = Parent monthly payment
DADBAL = Parent loan balance
DADINT = Parent mortgage interest
DADPRN = Parent principal repaid
The remaining values are computed as follows:
HOMEVAL[0] = Initial value of home
HOMEVAL[I] = Value of home after month I
= HOMEVAL[I-1] x ((1+INFL)^(1/12))
(Home value appreciates at inflation rate)
PROPTAX[I] = Property taxes paid during month I
= HOMEVAL[I-6] x PROPRATE/2
(for months 6, 18, 30, 42,...)
= HOMEVAL[I-12] x PROPRATE/2
(for months 12, 24, 36, 48,...)
(Property taxes are computed annually and
paid semiannually)
TAXSAVE[I] = Mortgage tax savings during month I
= BANKINT[I] x TAXRATE
(Interest portion of bank mortgage payments are
tax-deductible; payments to parents are not)
SAVEOWN[0] = Initial savings while owning
= 0
SAVEOWN[I] = Savings while owning, through month I
= (SAVEOWN[I-1] x (SAVRATE/12) x (1-TAXRATE))+
TAXSAVE[I] - (PROPTAX[I] + BANKPMT + DADPMT)
HOMECASH[I] = Home cashout value, after month I
= HOMEVAL[I] + SAVEOWN[I] -
(BANKBAL[I] + DADBAL[I])
MORENT[0] = Initial monthly rent payment
= INITRENT
MORENT[I] = Monthly rent payment
= MORENT[I-1] x (1+INFL)
(for months 13, 25, 37, 49,...)
= MORENT[I-1]
(for all other months)
(Rent increases once a year, at inflation rate)
SAVERENT[0] = Initial savings while renting
= (PRICE + COSTS) - (BANKAMT + DADAMT)
(This amount is saved by not buying)
SAVERENT[I] = Savings while renting, through month I
= (SAVERENT[I-1] x (SAVRATE/12) x (1-TAXRATE))
- MORENT
ADVAN[I] = Advantage (disadvantage) of buying
= HOMECASH[I] - SAVERENT[I] |