In [7]:

```
#initiation of variable
print "Few steps are as follows : ";
print "Step 1 : The estimated future requirementt per year in terms of todays rupees from his age 61 through 70 is Rs. 24000.";
print "Step 2 : The formula which is given below is used to get future equivalent of Rs. 24000 with the inflation of 9% per year.";
print "Formula : P*(1+IR)^n";
P=24000.0;#in Rs.
IR=9.0;#in % per year
Age=61.0;#in years
for n in range(21,31) :
IV=P*(1+IR/100)**n;#in Rs
print "Age in years : ",Age,". ""Inflated value of Rs. 24000 at end of year : ",n," in Rs. ",round(IV);
Age=Age+1;#in Years
PW=0;#For initialising
n=21.0;#in years
for m in range(10) :
A=P*(1+IR/100)**n;#in Rs
n=n+1;
i=15.0;#in % per year
PW=PW+A/(1+i/100)**(m+1);
#result
print "Present equivalent of withdrawls in Rs. : ",round(PW,3);
#The annual equivalent amount :
i=15.0;#in % per year
n=20.0;#in years
#Formula : (A/F,i,n) : (i/100)/(((1+i/100)^n)-1)
A=PW*(i/100)/(((1+i/100)**n)-1);#in Rs.
print "The annual equivalent amount in Rs. : ",round(A,3);
print"RECOMMENDATION : The person has to invest an amount of Rs. ",round(A,3)," at the end of every year starting from his age 41 through 60 which will enable him to make a withdrawl at the end of every year starting from his age 61 through 70.";
```

In [9]:

```
#initiation of variable
print"The method of finding the economic life of the machine witha discounting factor of 20% at zero inflation rate is summarized in table below. From the table it is clear that total annual cost is minimum if the machine is used for 14 years. Hence the economic life of the machine is 14 years.";
print"End of year Op_cost Main_cost Op+Main P/F,i,n PW Cummulative Salvage PW_S TPW A/P,i,n AEM";
i=20.0;#in per year
Cum=0.0;#initialising
Op_cost=40000.0;#in RS.
Main_cost=60000.0;#in Rs.
OpMain=Op_cost+Main_cost;#in Rs.
S=400000.0;#in Rs.
for n in range (1,16) :
PF=1/((1+i/100)**n);
PW=OpMain*PF;#in Rs.
Cum=Cum+PW
PW_S=PF*S;#in RS.
TPW=500000.0+Cum-PW_S;#in Rs.
AP=((i/100)*(1+i/100)**n)/(((1+i/100)**n)-1);
AEM=TPW*AP;#in RS
print " ",n," ",Op_cost," ",Main_cost," ",OpMain," ",PF," ",PW," ",Cum," ",S," ",PW_S," ",TPW," ",AP," ",AEM;
Op_cost=Op_cost+5000.0;#in Rs.
Main_cost=Main_cost+6000.0;#in Rs.
S=S-50000.0;#in Rs.
```

In [12]:

```
#initiation of variable
IR=5.0;#in % per year
i=15.0;#in % per year
#Machine X :
Ppx=1500000.0;#in Rs.
n=7.0;#in years
S=200000.0;#in Rs.
AMC=300000.0;#in Rs.
print "End of year AMC InflationFactor InflatedAmount P/F PW";
Pw=0;#For initialising
for n in range (1,8) :
FP=(1+IR/100)**n
IA=AMC*FP;#in Rs.
PF=1/((1+i/100)**n);
PW=IA*PF;#in Rs.
Pw=Pw+PW;#in Rs.
print" ",n," ",AMC," ",FP," ",IA," ",PF," ",PW;
print "Present worth of inflated annual operating and maintenance cost in Rs. : ",round(Pw,3);
PWX=Ppx+Pw-S*1/((1+i/100)**n);
print "Present worth of machine X in Rs. : ",round(PWX,3);
#Machine Y
Ppy=2000000.0;#in Rs.
n=7.0;#in years
S=300000.0;#in Rs.
AMC=250000.0;#in Rs.
print "End of year AMC InflationFactor InflatedAmount P/F PW";
Pw=0;#For initialising
for n in range (1,8) :
FP=(1+IR/100)**n
IA=AMC*FP;#in Rs.
PF=1/((1+i/100)**n);
PW=IA*PF;#in Rs.
Pw=Pw+PW;#in Rs.
print " ",n," ",AMC," ",FP," ",IA," ",PF," ",PW;
PWY=Ppy+Pw-S*1/((1+i/100)**n);
#result
print "Present worth of inflated annual operating and maintenance cost in Rs. : ",round(Pw,3);
print "Present worth of machine Y in Rs. : ",round(PWY,3);
print "Since the present worth of Machine X is less than Machine Y, select Machine X"
print " Calculations are not accurate in the book"
```

In [19]:

```
#initiation of variable
IR=6.0;#in % per year
i=18.0;#in % per year
AFR=5000000.0;#in Rs.
n=7.0;#in years
AI=500000.0;#in Rs.
print"End of year AFR InflationFactor InflatedAmount P/F PW";
TPW=0;#Initialising
for n in range (1,6) :
IF=(1+IR/100)**n;
IA=IF*AFR;#in Rs.
PF=1/((1+i/100)**n);
PW=PF*IA;#in Rs.
TPW=PW+TPW;#in Rs.
print" ",round(n)," ",round(AFR,3)," ",round(IF,3)," ",round(IA,3)," ",round(PF,3)," ",round(PW,3);
AFR=AFR+AI;#in Rs.
#result
print "The value of the single deposit to be made now to recieve the specified series for the next five years is Rs. : ",round(TPW,3)
```