9900990099009912020seeschoolsolutionformoreexamples

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: given year – Implement r w h i _ e r g o t _ a e , e r : got_nya(rwhrtsya) Where year = 0 is the first value in the list. This function returns the value of g o t _ a e n the rwhrtsi 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 rwhrtsb adjusted. For example if the original g o t _ a e ere [2.0,2.0,2.0,2.0] and we call rwhrtsw 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 nlto_rwhrts( rwhrts [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 xess according to g o t _ a e . To calculate what remain in your retirement fund each year after rwhrts retirement we can use the following table: Retirement fund End of year 1 F[0] = savings * (1+g o t _ a e [0]*0.01)­expenses rwhrts End of year 2 F[1] = F[0]*(1+g o t _ a e [1]*0.01)­expenses rwhrts End of year 3 F[2] = F[1]*(1+g o t _ a e [2]*0.01)­expenses rwhrts … Assignment 5 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.

Ask a homework question - tutors are online