14: Simple Interest

Example number 14.1, Page number 14.4

In [1]:
#importing modules
import math
from __future__ import division

#Variable declaration
P1=1000;    #principal(Rs)
R1=20;    #rate(%)
T1=4;     #time(years)
P2=600;    #principal(Rs)
R2=5;    #rate(%)
T2=4/12;     #time(years)
P3=200;    #principal(Rs)
R3=6*2;    #rate(%)
T3=3;     #time(years)
P4=500;    #principal(Rs)
R4=2*2;    #rate(%)
T4=5/2;     #time(years)
P5=400;    #principal(Rs)
R5=3*4;    #rate(%)
T5=2/12;     #time(years)
P6=730;    #principal(Rs)
R6=10;    #rate(%)
T6=120/365;     #time(years)

#Calculation
SI1=P1*T1*R1/100;     #simple interest in 1st case(Rs)
SI2=P2*T2*R2/100;     #simple interest in 2nd case(Rs)
SI3=P3*T3*R3/100;     #simple interest in 3rd case(Rs)
SI4=P4*T4*R4/100;     #simple interest in 4th case(Rs)
SI5=P5*T5*R5/100;     #simple interest in 5th case(Rs)
SI6=P6*T6*R6/100;     #simple interest in 1st case(Rs)

#Result
print "simple interest in 1st case is",SI1,"Rs"
print "simple interest in 2nd case is",SI2,"Rs"
print "simple interest in 3rd case is",SI3,"Rs"
print "simple interest in 4th case is",SI4,"Rs"
print "simple interest in 5th case is",SI5,"Rs"
print "simple interest in 6th case is",SI6,"Rs"
simple interest in 1st case is 800.0 Rs
simple interest in 2nd case is 10.0 Rs
simple interest in 3rd case is 72.0 Rs
simple interest in 4th case is 50.0 Rs
simple interest in 5th case is 8.0 Rs
simple interest in 6th case is 24.0 Rs

Example number 14.2, Page number 14.5

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
P1=100;    #principal(Rs)
R1=3;    #rate(%)
T1=2;     #time(years)
P2=500;    #principal(Rs)
R2=6;    #rate(%)
T2=4/12;     #time(years)
P3=400;    #principal(Rs)
R3=3.65;    #rate(%)
T3=150/365;     #time(years)
A4=540;    #amount(Rs)
R4=5;    #rate(%)
SI4=108;     #simple interest(Rs)
A5=1120;    #amount(Rs) 
R5=5;    #rate(%)
T5=12/5;     #time(years)

#Calculation
A1=P1*(1+(R1*T1/100));       #amount in 1st case(Rs) 
A2=P2*(1+(R2*T2/100));       #amount in 2nd case(Rs) 
A3=P3*(1+(R3*T3/100));       #amount in 3rd case(Rs) 
x=(A4/SI4)-1;
T4=100/(x*R4);      #time in 4th case(years)
y=(100/(R5*T5))+1;
SI5=A5/y;     #simple interest in 5th case(Rs)

#Result
print "amount in 1st case is",A1,"Rs"
print "amount in 2nd case is",A2,"Rs"
print "amount in 3rd case is",A3,"Rs"
print "time in 4th case is",T4,"years"
print "simple interest in 5th case is",SI5,"Rs"
amount in 1st case is 106.0 Rs
amount in 2nd case is 510.0 Rs
amount in 3rd case is 406.0 Rs
time in 4th case is 5.0 years
simple interest in 5th case is 120.0 Rs

Example number 14.3, Page number 14.6

In [3]:
#importing modules
import math
from __future__ import division

#Variable declaration
SI=810;     #simple interest(Rs)
R=9;    #rate(%)
T=6;     #time(years)

#Calculation
P=100*SI/(R*T);     #principal(Rs)

#Result
print "principal is",P,"Rs"
principal is 1500.0 Rs

Example number 14.4, Page number 14.6

In [8]:
#importing modules
import math
from __future__ import division
from fractions import Fraction

#Variable declaration
T=8;     #time(years)
N=2;    #number of times

#Calculation
R=100*(N-1)/T;     #rate(%)
x=R-int(R);

#Result
print "rate is",int(R),Fraction(x),"%"
rate is 12 1/2 %

Example number 14.5, Page number 14.6

In [9]:
#importing modules
import math
from __future__ import division

#Variable declaration
R=5/2;    #rate(%)
T=2;     #time(years)
A=630;   #amount(Rs)

#Calculation
P=A/(1+(R*T/100));     #principal(Rs)

#Result
print "principal is",P,"Rs"
principal is 600.0 Rs

Example number 14.6, Page number 14.6

In [10]:
#importing modules
import math
from __future__ import division

#Variable declaration
T1=2;     #time(years)
A1=720;    #amount(Rs)
T2=2+5;     #time(years)
A2=1020;    #amount(Rs)

#Calculation
P=((A1*T2)-(A2*T1))/(T2-T1);      #principal(Rs)
R=(A2-A1)*100/((A1*T2)-(A2*T1));     #rate(%)

#Result
print "principal is",P,"Rs"
print "rate is",R,"%"
principal is 600.0 Rs
rate is 10.0 %

Example number 14.7, Page number 14.6

In [11]:
#importing modules
import math
from __future__ import division

#Variable declaration
P=1;    #assume
SI=16*P/25;

#Calculation
#given T=R
R_2=SI*100;
R=math.sqrt(R_2);    #rate(%)
T=R;       #time(years)

#Result
print "rate is",R,"%"
print "time is",T,"years"
rate is 8.0 %
time is 8.0 years

Example number 14.8, Page number 14.7

In [13]:
#importing modules
import math
from __future__ import division

#Variable declaration
P=2500;    #principal(Rs)
SI=265;     #simple interest(Rs)
T=2;     #time(years)
r1=5;   #rate(%)
r2=7;   #rate(%)

#Calculation
Rm=100*SI/(T*P);     #rate of interest(%)
S1=r2-Rm;     #sum borrowed at 5%
S2=Rm-r1;     #sum borrowed at 7%
S_5=S1*P/(S1+S2);     #sum at 5%(Rs)
S_7=S2*P/(S1+S2);     #sum at 7%(Rs)

#Result
print "sum at 5% is",S_5,"Rs"
print "sum at 7% is",S_7,"Rs"
print "answer given in the book is wrong"
sum at 5% is 2125.0 Rs
sum at 7% is 375.0 Rs
answer given in the book is wrong

Example number 14.9, Page number 14.7

In [14]:
#importing modules
import math
from __future__ import division

#Variable declaration
p1=1/3;    #1st part
p2=1/6;    #2nd part
r1=3;      #rate(%)
r2=6;      #rate(%)
r3=8;      #rate(%)
SI=600;     #simple interest(Rs)
T=2;     #time(years)

#Calculation
p3=1-(p1+p2);    #rest part
R=(p1*r1)+(p2*r2)+(p3*r3);     #average rate(%)
P=100*SI/(R*T);     #principal(Rs)

#Result
print "principal is",P,"Rs"
principal is 5000.0 Rs

Example number 14.10, Page number 14.7

In [15]:
#importing modules
import math
from __future__ import division

#Variable declaration
M=4200;    #debt(Rs)
n=5;    #number of years
y=1;
r=10;   #rate(%)

#Calculation
x=n*(n-1)/2;
z=x*r/(100*y);
a=M/(n+z);       #annual installment(Rs)

#Result
print "annual installment is Rs",a,"per year"
annual installment is Rs 700.0 per year

Example number 14.11, Page number 14.7

In [16]:
#importing modules
import math
from __future__ import division

#Variable declaration
M=2;    #debt(Rs)
n=3;    #number of years
y=12;
a=1;   #annual installment(Rs)

#Calculation
x=n*(n-1)/2;
z=x*a/(100*y);
r=(-M+(n*a))/z;       #rate(%)

#Result
print "rate is",r,"%"
rate is 400.0 %

Example number 14.12, Page number 14.8

In [17]:
#importing modules
import math
from __future__ import division

#Variable declaration
R1=R2=1;     #assume
T1=3;     #time(years)
A1=95;    #amount(Rs)
T2=5;     #time(years)
P1=85;     #principal(Rs)
P2=102;     #principal(Rs)

#Calculation
A2=((A1-P1)*P2*T2*R2/(P1*R1*T1))+P2;       #amount(Rs)

#Result
print "amount is",A2,"Rs"
amount is 122.0 Rs

Example number 14.13, Page number 14.8

In [18]:
#importing modules
import math
from __future__ import division

#Variable declaration
R1_R2=2;       #change in rate(%)
SI1_SI2=56;     #change in simple interest(Rs)
T=4;      #time(years)

#Calculation
P=100*SI1_SI2/(R1_R2*T);     #principal(Rs)

#Result
print "principal is",P,"Rs"
principal is 700.0 Rs

Example number 14.14, Page number 14.8

In [19]:
#importing modules
import math
from __future__ import division

#Variable declaration
R1=8;     #rate(%)
R2=1/2;    #rate(%)
T1=5;     #time(years)
T2=15;     #time(years)
P=3800;    #principal(Rs) 

P1=T2;     #principal(Rs)
P2=2*R1*T1;     #principal(Rs)
P1=P1*P/(P1+P2);     #sum lent out(Rs)

#Result
print "sum lent out is",P1,"Rs"
sum lent out is 600.0 Rs

Example number 14.15, Page number 14.8

In [24]:
#importing modules
import math
from __future__ import division

#Variable declaration
R1=5;     #rate(%)
A1=80;    #amount(Rs)
R2=2;     #rate(%)
A2=40;    #amount(Rs)

#Calculation
P=((A1*R2)-(A2*R1))/(R2-R1);      #principal(Rs)
T=(A2-A1)*100/((A1*R2)-(A2*R1));     #time(years)

#Result
print "principal is",round(P,2),"Rs"
print "time is",T,"years"
principal is 13.33 Rs
time is 100.0 years