10: Chain Rule

Example number 10.1, Page number 10.2

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

#Variable declaration
N1=120;     #number of men
N2=150;     #number of men
D1=100;     #number of days

#Calculation
D2=N1*D1/N2;    #number of days

#Result
print "number of days is",D2
number of days is 80.0

Example number 10.2, Page number 10.2

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

#Variable declaration
N1=18;     #number of men
D1=8;     #number of days
D2=6;     #number of days
R1=5;     #number of hours
R2=8;     #number of hours

#Calculation
N2=N1*D1*R1/(D2*R2);    #number of men

#Result
print "number of men is",N2
number of men is 15.0

Example number 10.3, Page number 10.2

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

#Variable declaration
N1=1000;     #number of men
D1=12;     #number of days
N2=200;     #number of men joined

#Calculation
D2=N1*D1/(N1+N2);      #number of days

#Result
print "number of days is",D2
number of days is 10.0

Example number 10.4, Page number 10.3

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

#Variable declaration
N1=4;     #number of men
D1=30;     #number of days
D2=12;     #number of days
W1=40;     #number of acres
N2=18;     #number of men

#Calculation
W2=N2*D2*W1/(D1*N1);    #number of acres

#Result
print "number of acres is",W2
number of acres is 72.0

Example number 10.5, Page number 10.3

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

#Variable declaration
N1=12;     #number of men
D1=25;     #number of days
N2=20;     #number of men
W1=100*3*0.5;     #volume of wall
W2=60*4*0.25;     #volume of wall

#Calculation
D2=N1*D1*W2/(W1*N2);    #number of days

#Result
print "number of days is",D2
number of days is 6.0

Example number 10.6, Page number 10.3

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

#Variable declaration
N1=15;     #number of men
D1=21;     #number of days
N2=14;     #number of men
R1=8;     #number of hours
R2=6;     #number of hours

#Calculation
D2=N1*D1*R1/(N2*R2);    #number of days

#Result
print "number of days is",D2
number of days is 30.0

Example number 10.7, Page number 10.3

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

#Variable declaration
N1=100;     #number of men
D2=40-35;     #number of days
N2=100;     #number of men joined

#Calculation
D=(N1+N2)*D2/N1;
D1=D-D2;    #number of days

#Result
print "number of days is",D1
number of days is 5.0

Example number 10.8, Page number 10.4

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

#Variable declaration
N1=104;     #number of men
D1=30;     #number of days
D=56;     #number of days
R1=8;     #number of hours
R2=9;     #number of hours
W1=2/5;   #fraction of work

#Calculation
D2=D-D1;    #number of days
W2=1-W1;    #rest of the work
N=N1*D1*R1*W2/(D2*R2*W1);
N2=N-N1;    #number of additional men

#Result
print "number of additional men is",N2
number of additional men is 56.0

Example number 10.9, Page number 10.4

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

#Variable declaration
M1=10;     #number of men
D1=40;     #number of days
M2=4;      #number of men
M3=6;      #number of men
D3=50;     #number of days

#Calculation
D2=((M1*D1)-(M3*D3))/M2;     #number of days

#Result
print "number of days is",D2
number of days is 25.0

Example number 10.10, Page number 10.4

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

#Variable declaration
N1=4;     #number of lorries
D1=8;     #number of days
R1=4;     #number of tons
R2=3;     #number of tons
W1=128;   #number of tons
N2=6;     #number of lorries
W2=540;   #number of tons

#Calculation
D2=N1*D1*R1*W2/(N2*R2*W1);
N2=N-N1;    #number of days

#Result
print "number of days is",D2
number of days is 30.0

Example number 10.11, Page number 10.4

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

#Variable declaration
N=250;     #number of students
D=30;      #number of days 
N_1=25;     #number of students added
D1=10;     #number of days

#Calculation
N1=N+N_1;       #number of students
N2=N;      #number of students
D2=((N*D)-(N1*D1))/N2;     #number of days

#Result
print "number of days is",D2
number of days is 19.0

Example number 10.12, Page number 10.5

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

#Variable declaration
N1=3000;     #number of men
D1=25-11;    #number of days
R1=900;     #rate per head
D2=10;      #number of days
R2=840;     #rate per head

#Calculation
N=N1*D1*R1/(D2*R2);     
N2=N-N1;    #number of men

#Result
print "number of men is",N2
number of men is 1500.0

Example number 10.13, Page number 10.5

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

#Variable declaration
N1=6;     #number of diesel engines
D1=5;     #number of hours
R1=1/5;   
R2=1/8;  
W1=900;   #number of litres
N2=9;     #number of diesel engines
D2=8;     #number of hours

#Calculation
W2=N2*D2*R2*W1/(N1*R1*D1);     #required diesel(litres)

#Result
print "required diesel is",W2,"litres"
required diesel is 1350.0 litres

Example number 10.14, Page number 10.5

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

#Variable declaration
N1=2;     #number of machines
D1=8;     #number of days
R1=12;     #number of hours/day
E2=80/100;    #efficiency  
E1=90/100;   #efficiency
W1=9000;     #tonnes of coal
N2=3;     #number of machines
D2=6;     #number of days
W2=12000;    #tonnes of coal

#Calculation
R2=N1*D1*R1*E1*W2/(N2*D2*E2*W1);      #number of hours/day

#Result
print "each machine should work",R2,"h/day"
each machine should work 16.0 h/day

Example number 10.15, Page number 10.5

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

#Variable declaration
N1=1;     #number of persons
D1=5/2;     #number of days
R1=50;      #amount(Rs)   
R2=42.50;   #amount(Rs)  
W2=340;   #amount(Rs)
N2=1;     #number of persons
D2=10/3;     #number of days

#Calculation
W1=N1*D1*R1*W2/(N2*R2*D2);     #amount charged(Rs)

#Result
print "amount charged is",W1,"Rs"
amount charged is 300.0 Rs