from numpy import log10
from __future__ import division
#Given data :
n=1.5 #refractive index
R=((1-n)/(1+n))**2 #unitless
print "Reflected light = %0.f %% " %(R*100)
print "The remainder transmitted light = %0.f %% "%(100-R*100)
loss=-10*log10(1-R) #in dB
print "Transmission loss = %0.3f dB" %loss
#Given data :
n1=3.6 #refractive index
n2=1.48 #refractive index
R=((n1-n2)/(n1+n2))**2 #unitless
loss=-10*log10(1-R) #in dB
print "Transmission loss = %0.2f dB " %loss