This preview shows page 1. Sign up to view the full content.
Unformatted text preview: given year –
Implement r w h i _ e r g o t _ a e , e r :
Where year = 0 is the first value in the list. This function returns the value of g o t _ a e n the
given year. In case of a year not in the list return None 4.2 Inflation matters. The market changed dramatically after inflation. Given a list of growth rates and
inflation factors, one need to know what is the value of growth_list during the inflation. inflation should be
adjusted for all years there is both an inflation factor and growth factor. inflation is defined as
100*((100+g)/(100+i)1) where g is growth in that year and i is the inflation.
Implement n l t o _ r w h r t s g o t _ a e , n l t o _ a t r )that
ifaingot_ae(rwhrtsifainfcos returns a NEW list with the same length as g o t _ a e ut during the inflation years the rates are
For example if the original g o t _ a e ere [2.0,2.0,2.0,2.0] and we call
i f a i n g o t _ a e g o t _ a e , [1.0,1.0]) then the returned list will be
[0.990099009900991, 0.990099009900991, 2.0, 2.0]. See school solution for more examples.
It is very important that you won’t change the values in the original list and create a new one; we will test
you for that. After retirement, one must withdraw amount of money each year for living expenses.
Now, we want to model, how much money one can withdraw from his account after retirement. Once
again we will assume simplified model – where there is no inflation at all so your annual expenses are
constant – e p n e . The complication here is that the money in your account will continue to growth
according to g o t _ a e . To calculate what remain in your retirement fund each year after
retirement we can use the following table:
End of year 1 F = savings * (1+g o t _ a e *0.01)expenses
rwhrts End of year 2 F = F*(1+g o t _ a e *0.01)expenses
rwhrts End of year 3 F = F*(1+g o t _ a e *0.01)expenses
Implement p s _ e i e e t which takes three arguments: an initial amount on...
View Full Document
This document was uploaded on 03/20/2014 for the course CMSC 67101 at Hebrew University of Jerusalem.
- Spring '14