23: Clocks

Example number 23.1, Page number 23.4

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

#Variable declaration
H=3;     #initial position of hour hand
A=0;    #required angle(degrees)

#Calculation
T=(2/11)*((H*30)+A);    #required time(minutes)

#Result
print "required time is",round(T,2),"minutes past",H
required time is 16.36 minutes past 3

Example number 23.2, Page number 23.4

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

#Variable declaration
H=4;     #initial position of hour hand
A=90;    #required angle(degrees)

#Calculation
T1=(2/11)*((H*30)+A);    #required time(minutes)
T2=(2/11)*((H*30)-A);    #required time(minutes)

#Result
print "one timing is",round(T1,2),"minutes past",H
print "another timing is",round(T2,2),"minutes past",H
one timing is 38.18 minutes past 4
another timing is 5.45 minutes past 4

Example number 23.3, Page number 23.5

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

#Variable declaration
H=7;     #initial position of hour hand
A=90;    #required angle(degrees)

#Calculation
T1=(2/11)*((H*30)+A);    #required time(minutes)
T2=(2/11)*((H*30)-A);    #required time(minutes)

#Result
print "one timing is",round(T1,3),"minutes past",H
print "another timing is",round(T2,3),"minutes past",H
one timing is 54.545 minutes past 7
another timing is 21.818 minutes past 7

Example number 23.4, Page number 23.5

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

#Variable declaration
H=7;     #initial position of hour hand
A=180;    #required angle(degrees)

#Calculation
T=(2/11)*((H*30)-A);    #required time(minutes)

#Result
print "required time is",round(T,2),"minutes past",H
print "answer given in the book is wrong"
required time is 5.45 minutes past 7
answer given in the book is wrong

Example number 23.5, Page number 23.5

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

#Variable declaration
H=5;     #initial position of hour hand
A=42;    #required angle(degrees)

#Calculation
T1=(2/11)*((H*30)+A);    #required time(minutes)
T2=(2/11)*((H*30)-A);    #required time(minutes)

#Result
print "one timing is",round(T1,3),"minutes past",H
print "another timing is",round(T2,3),"minutes past",H
one timing is 34.909 minutes past 5
another timing is 19.636 minutes past 5

Example number 23.6, Page number 23.5

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

#Variable declaration
Ti=6-1;      #time interval(hours)
h=1/60;    #hour gained(hour)


#Calculation
Tti=Ti/(1+h);     #true time interval(hours)
Tt=1+Tti;       #true time(hours)
H=int(Tt);      #hour hand(p.m)
m=(Tt-H)*60;    #true time(minutes)

#Result
print "true time is",round(m,2),"minutes past",H,"p.m"
true time is 55.08 minutes past 5 p.m

Example number 23.7, Page number 23.6

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

#Variable declaration
H=2;     #initial position of hour hand
A=90;    #required angle(degrees)

#Calculation
T1=(2/11)*((H*30)+A);    #required time(minutes)
T2=(2/11)*((H*30)-A);    #required time(minutes)

#Result
print "required time is",round(T1,2),"minutes past",H,"and at",H+1,"o' clock"
required time is 27.27 minutes past 2 and at 3 o' clock

Example number 23.8, Page number 23.6

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

#Variable declaration
T=12;    #time(hours)
x=65;    #time(minutes)
y=65+(5/11);     #time interval(minutes)

#Calculation
Ttg=(T*60)*(y-x)/x;      #total time gained(minutes)

#Result
print "total time gained is",round(Ttg,3),"minutes"
total time gained is 5.035 minutes

Example number 23.9, Page number 23.6

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

#Variable declaration
H=0;     #initial position of hour hand
A=90;    #required angle(degrees)

#Calculation
T1=(2/11)*((H*30)+A);    #required time(minutes)
T2=(2/11)*(360+(H*30)-A);    #required time(minutes)

#Result
print "required time is",round(T1,2),"minutes and",round(T2,2),"minutes past 12"
required time is 16.36 minutes and 49.09 minutes past 12