#importing modules
import math
from __future__ import division
#Variable declaration
bt=9; #beat time(sec)
st=0; #start time(sec)
bd=36; #beat distance(m)
sd=0; #start distance(m)
L=1000-36; #loser's distance(m)
#Calculation
At=(bt+st)*L/(bd+sd); #A's time over the course(sec)
#Result
print "A's time over the course is",At,"sec"
#importing modules
import math
from __future__ import division
#Variable declaration
V=1; #assume
A=4/3; #speed of A relative to B
d=30; #distance(m)
#Calculation
L=d/(V-(1/A)); #length of race of winning post(m)
#Result
print "length of race of winning post is",L,"m"
#importing modules
import math
from __future__ import division
#Variable declaration
bt=0; #beat time(sec)
st=10; #start time(sec)
bd=0; #beat distance(m)
L=250; #loser's distance(m)
W=1000; #winner's distance(m)
#Calculation
x=L/W;
sd=((bt+st)/x)-bd; #start distance(m)
#Result
print "start distance is",sd,"m"
#importing modules
import math
from __future__ import division
#Variable declaration
bt=10; #beat time(sec)
st=0; #start time(sec)
sd=0; #start distance(m)
L=300; #loser's distance(m)
W=100; #winner's distance(m)
#Calculation
x=L/W;
bd=((bt+st)/x)-sd; #beat distance(m)
#Result
print "beat distance is",round(bd,2),"m"
print "answer given in the book is wrong"
#importing modules
import math
from __future__ import division
#Variable declaration
L=100; #length of race(m)
x12=2; #A beats C by(m)
x13=4; #A beats B by(m)
#Calculation
x23=L*(x13-x12)/(L-x12); #C would beat B by(m)
#Result
print "C would beat B by",round(x23,2),"m"
#importing modules
import math
from __future__ import division
#Variable declaration
L=1000; #length of race(m)
x12=50; #A beats C by(m)
x13=69; #A beats B by(m)
#Calculation
x23=L*(x13-x12)/(L-x12); #C would beat B by(m)
#Result
print "C would beat B by",x23,"m"
#importing modules
import math
from __future__ import division
#Variable declaration
Ad=100; #distance of A(m)
Bd=Ad-4; #distance of B(m)
As=2; #speed of A(m/s)
bt=10; #beat time(sec)
st=0; #start time(sec)
#Calculation
t=bt+st;
Bs=Bd/(t+(Ad/As)); #speed of B(m/s)
#Result
print "speed of B is",Bs,"m/s"
#importing modules
import math
from __future__ import division
#Variable declaration
Bd=330; #distance of B(m)
Bt=44; #time of B(sec)
sd=30; #start distance(m)
A=41; #time taken for A(sec)
#Calculation
B=Bt*(Bd-sd)/Bd; #time taken for B(sec)
T=A-B; #B wins by(s)
#Result
print "B wins by",T,"s"
#importing modules
import math
from __future__ import division
#Variable declaration
L=200; #length of race(m)
x12=40; #A beats C by(m)
x13=50; #A beats B by(m)
Tc=2; #time for C(sec)
#Calculation
x23=L*(x13-x12)/(L-x12); #C would beat B by(m)
C=Tc*L/x23; #time taken for C(sec)
B=C-Tc; #time taken for B(sec)
A=B*(L-x12)/L; #time taken for A(sec)
#Result
print "time taken for A is",A,"sec"
print "answer given in the book is wrong"
print "time taken for B is",B,"sec"
print "time taken for C is",C,"sec"
#importing modules
import math
from __future__ import division
#Variable declaration
L=1000; #length of race(m)
x12=40; #A beats C by(m)
x23=25; #A beats B by(m)
#Calculation
x13=(x23*(L-x12)/L)+x12; #A can give C a start of(m)
#Result
print "A can give C a start of",x13,"m"
#importing modules
import math
from __future__ import division
#Variable declaration
L=400; #length of race(m)
L1=600; #full length of race(m)
L2=500; #length of another race(m)
x12=60; #A beats B by(m)
x23=25; #A beats C by(m)
#Calculation
x12=x12*L/L1; #A beats B by(m)
x23=x23*L/L2; #A beats C by(m)
x13=(x23*(L-x12)/L)+x12; #A will beat C by(m)
#Result
print "A will beat C by",x13,"m"
#importing modules
import math
from __future__ import division
#Variable declaration
L=400; #length of race(m)
Bt1=50/7; #time taken by B more than A(sec)
Bt2=5; #time taken by B with lesser distance(sec)
d=15; #lesser distance(m)
#Calculation
Bt=Bt1-Bt2; #time taken for B(sec)
Bs=d/Bt; #speed of B(m/s)
VA=L/((L/Bs)-Bt1); #speed of A(m/s)
#Result
print "speed of A is",VA,"m/s"
print "speed of B is",Bs,"m/s"