import math
from __future__ import division
#initialisation of variables
l=10**-4; #lambda in m
v=0.25; #velocity in m/sec
#CALCULATIONS
f=v/l; #calculating frequency
#RESULTS
print"Frequency in Hz =",round(f,3);
import math
from __future__ import division
#initialisation of variables
v=5020; #/velocity in ft/sec
f=256; #frequency in Hz
#CALCULATIONS
l=v/f; #calculatin lamda
#RESULTS
print"Wavelength in ft =",round(l,3);
import math
from __future__ import division
#initialisation of variables
f=1/4; #frequency in Hz
l=30; #wavwlength in metre
#CALCULATIONS
v=f*l; #calculating velocity
#RESULTS
print"Velocity in m/sec =",round(v,3);
import math
from __future__ import division
#initialisation of variables
l=3.2*10**-2; #/lambda in m
v=3*10**8; #velocity in m/sec
#CALCULATIONS
f=v/l; #calculating frequency
#RESULTS
print"Frequency in Hz =",'%.3E'%f;
import math
from __future__ import division
#initialisation of variables
c=3*10**8; #velocity in m/sec
n=2.42; #refractive index
#CALCULATIONS
v=c/n; #calculating velocity
#RESULTS
print"Velocity in m/sec =",'%.3E'%v;
import math
from __future__ import division
#initialisation of variables
v=343; #velocity in m/sec
vs=20; #velocity in m/sec
fs=500; #original frquency
#CALCULATIONS
f1=(fs*v)/(v-vs); #doppler effect
#RESULTS
print"Percieved frequency in Hz =",round(f1,3);
import math
from __future__ import division
#initialisation of variables
v1=-20; #velocity in m/sec
vs=0; #velocity in m/sec
fs=500; #original frquency
#CALCULATIONS
f1=(fs*(v+v1))/(v-vs); #doppler effect
#RESULTS
print"Percieved frequency in Hz =",round(f1,3);
import math
from __future__ import division
#initialisation of variables
v=343; #velocity in m/sec
fs=800; #original frquency
f1=750; #percieved frquency
#CALCULATIONS
vs=v*(1-(fs/f1)); #calculating velocity
#RESULTS
print"Trains velocity in m/sec =",round(vs,3);
import math
from __future__ import division
#initialisation of variables
l=0.1; #l=(v/c)
#CALCULATIONS
f=math.sqrt((1-l)/(1+l)); #ratio of frquencies f=(f/fs)
f1=f*100;
#RESULTS
print"Percent shift =",round(f1,3);