#importing modules
import math
from __future__ import division
#Variable declaration
c=1; #assume
udash=0.9*c; #speed of 2nd rocket
v=0.6*c; #speed of 1st rocket
#Calculation
u1=(udash+v)/(1+(udash*v/(c**2))); #speed of 2nd rocket in same direction
u2=(-udash+v)/(1-(udash*v/(c**2))); #speed of 2nd rocket in opposite direction
#Result
print "speed of 2nd rocket in same direction is",round(u1,3),"*c"
print "speed of 2nd rocket in opposite direction is",round(u2,3),"*c"
#importing modules
import math
from __future__ import division
#Variable declaration
#given L0-L/L0=0.01.so L=0.99*L0
LbyL0=0.99;
c=1; #assume
#Calculation
v2=(c**2)*(1-(LbyL0)**2);
v=math.sqrt(v2); #speed
#Result
print "speed is",round(v,3),"*c"
#importing modules
import math
from __future__ import division
#Variable declaration
delta_tow=2.6*10**-8; #mean lifetime at rest(s)
d=20; #distance(m)
c=3*10**8; #speed of light(m/s)
#Calculation
#delta_t=d/v
v2=(c**2)/(1+(delta_tow*c/d)**2);
v=math.sqrt(v2); #speed of unstable particle(m/s)
#Result
print "speed of unstable particle is",round(v/10**8,1),"*10**8 m/s"
#importing modules
import math
from __future__ import division
#Variable declaration
delta_t=5*10**-6; #mean lifetime(s)
c=1; #assume
v=0.9*c; #speed of beam
#Calculation
delta_tow=delta_t*math.sqrt(1-(v/c)**2); #proper lifetime of particles(s)
#Result
print "proper lifetime of particles is",round(delta_tow*10**6,2),"*10**-6 s"
#importing modules
import math
from __future__ import division
#Variable declaration
c=1; #assume
m0bym=100/120; #ratio of masses
#Calculation
v=c*math.sqrt(1-(m0bym**2)); #speed of body
#Result
print "speed of body is",round(v,3),"*c"
#importing modules
import math
from __future__ import division
#Variable declaration
c=3*10**8; #speed of light(m/s)
deltaE=4*10**26; #energy of sun(J/s)
#Calculation
deltam=deltaE/c**2; #change in mass(kg)
#Result
print "change in mass is",round(deltam/10**9,2),"*10**9 kg"
#importing modules
import math
from __future__ import division
#Variable declaration
c=1; #assume
T=10; #kinetic energy(MeV)
m0c2=0.512; #rest energy of electron(MeV)
#Calculation
E=T+m0c2; #total energy(MeV)
p=math.sqrt((E**2)-(m0c2**2))/c; #momentum of electron(MeV/c)
v=c*math.sqrt(1-(m0c2/E)**2); #velocity of electron(c)
#Result
print "momentum of electron is",round(p,1),"MeV/c"
print "velocity of electron is",round(v,4),"*c"