In [1]:

```
import math
#to calculate ratio of intensity
#I1/I2=1/25
#formula is a1/a2=math.sqrt(I1/I2)=1/5
a2=5 #a2=5*a1
a1=1
I=((1+5)**2)/((1-5)**2)
print "ratio of intensity at the maxima and minima in the interference pattern is Imax/Imin=((a1+a2)**2)/((a1-a2)**2)=",((a1+a2)**2)/((a1-a2)**2),"unitless"
#answer is given in terms of ratio
```

In [2]:

```
import math
#to calculate ratio of intensity at this point to that at the centre of a bright fringe
#the intensity at any pont is I=a1**2+a2**2+2*a1*a2*cos del
#let a1=a2=a
#phase difference del is 0
#then I0=a**2+a**2+2*a*a*cos 0
#we get I0=4a**2
I0=4 #intensity
#path difference is lemda/8
#phase difference =2*math.pi/lemda*path difference=math.pi/4
#I1=a**2+a**2+2a*a*cos math.pi/4
#I1=3.414a**2
I1=3.414
intensity=I1/I0
print " ratio of intensity =",intensity,"unitless"
```

In [3]:

```
import math
#to calculate ratio of maximum intensity to minimum intensity
#formula is I1/I2=a1**2/a2**2=100/1
#a1/a2=10/1
a1=10 #a1=10*a2
a2=1
print "the ratio of maximum intensity to minmum intensity in the interference pattern Imax/Imin=((a1+a2)**2)/((a1-a2)**2)=",((a1+a2)**2)/((a1-a2)**2),"unitless"
#answer is given in terms of ratio in the book
```

In [1]:

```
import math
#to calculate relative intensities
#Imax/Imin=(a1+a2)**2/(a1-a2)**2+105/95
#(a1+a2)/(a1-a2)=1.051
#we get a1/a2=40
a1=40 #a1=40*a2
a2=1
print "the ratio of the intensities of interfering sources is I1/I2=a1**2/a2**2=",a1**2/a2**2,"unitless"
#answer is given in terms of ratio in the book
```

In [5]:

```
import math
#to calculate distance between the two coherent sources
lamda=5890*10**-10 #wavelength in m
omega=9.424*10**-4 #width of the fringes in m
D=.80 #distance in m
twod=D*lamda/omega
print "the distance between two coherent sources is twod=",twod,"m"
```

In [1]:

```
import math
#to calculate fringe width
mu=1.5 #refractive index (unitless)
alpha=math.pi/180 #refracting angle in radian
Y1=20*10**-2 #distance between the source and the biprism in m
Y2=80*10**-2 #distance in m
D=Y1+Y2 # distance in m
lamda=6900*10**-10 #wavelength in m
twod=2*(mu-1)*alpha*Y1
omega=D*lamda/twod
print "the fringe width is omega=",round(omega,7),"m"
```

In [7]:

```
import math
#to calculate wavelength of light
omega=1.888*10**-2/20 #in (m)
D=1.20 #distance of eye piece from the source in m
twod=0.00075 #distance between two virtual sources in m
lamda=omega*twod/D
print "the wavelength of light is lamda=",lamda,"m"
```

In [8]:

```
import math
#to calculate thickness of glass plate
n=3
mu=1.5 #refractive index (unitless)
lamda=5450*10**-10 #wavelength in m
t=n*lamda/(mu-1)
print "the thickness of glass plate is t=",t,"m"
```

In [9]:

```
import math
#to calculate refractive index of the sheet
t=6.3*10**-6 #thickness of thin sheet of transparent material in m
lamda=5460*10**-10 #wavelength in m
n=6
mu=(n*lamda/t)+1
print "the refractive index of the sheet is mu=",mu,"unitless"
```

In [11]:

```
import math
#to calculate refractive index of mica
t=1.2*10**-8 #thickness of thin sheet of mica in m
n=1
lamda=6*10**-7 #wavelength in m
mu=(n*lamda/t)+1
print "the refractive index of mica is mu=",mu,"unitless"
#answer is given wrong in the book=1.50
```

In [15]:

```
import math
#to calculate intensity
mu=1.5 #refractive index(unitless)
t=1.5*10**-6 #thickness of thin glass plate in m
pathdifference=(mu-1)*t # in m
lamda=5*10**-7 #wavelength in m
#del=2*math.pi*pathdifference/lamda
#del=3*math.pi
a1=1
#where a1=a2=a
a2=1
#formula is I=a1**2+a2**2+2*a1*a2*cos del
# where cos 3math.pi=-1
I=a1**2+a2**2+2*a1*a2*(-1)
print "the intensity at the centre of the screen is I=",I,"unitless"
#to calculate lateral shift
D=1 #distance in m
twod=5*10**-4 #distance between two slits in m
mu=1.5 #refractive index (unitless)
t=1.5*10**-6 #thickness of thin glass plate in m
x0=D*(mu-1)*t/twod
print "the lateral shift of the central maximum is x0=",x0,"m"
```

In [2]:

```
import math
#to calculate spacing between the slits
lamda=6*10**-5 #wavelength in cm
omegatheta=0.1*math.pi/180 #angular width of a fringe in radians
twod=lamda/omegatheta
print "the spacing between the slits is twod=","{:.2e}".format(twod),"cm"
```

In [17]:

```
import math
#to calculate distance of the third bright fringe on the screen from the central maximum
lamda=6.5*10**-5 #wavelength in cm
twod=0.2 #distance between the slits in cm
D=120 #distance between the plane of the slits and the screen in cm
n=3
X3=D*n*lamda/twod
print "the distance of the third bright fringe from the central maximum is X3=",X3,"cm"
#to calculate the least distance from the central maximum
lamda1=6.5*10**-5 #wavelength in cm
lamda2=5.2*10**-5 #wavelength in cm
#Xn=Dnlamda1/2d=D(n+1)lamda2/2d
#we get,
n=lamda2/(lamda1-lamda2)
print "n=",n,"unitless"
Xn=D*n*lamda1/twod
print "the distance from the central maximum when the bright fringes due to both wavelengths coincide is Xn=",Xn,"cm"
```

In [3]:

```
import math
#to calculate refractive index
D=10 #distance in cm
twod=0.2 #distance detween the slits in cm
t=0.05 #thickness of transparent plate in cm
deltaX=0.5 #in cm
mu=(deltaX*twod/(D*t))+1
print "the refractive index of the transparent plate is mu=",mu,"unitless"
#to calculate order
n=10
lamda=7000*10**-8 #wavelength in cm
#path difference =n*lamda
n1=n*lamda/(5000*10**-8)
print "the order will be visible is n1=",n1,"unitless"
#to calculate distance between the two coherent sources
D=100 #distance in m
lamda=6000*10**-8 #wavelength in cm
omega=0.05 #distance between two consecutive bright fringes on the screen in cm
twod=D*lamda/omega
print "the distance between the coherent sources is twod=",twod,"cm"
#to calculate wavelength
Xn=1 #distance of fourth bright fringe from the central fringe in cm
twod=0.02 #distance between the two coherent sources in cm
n=4
D=100 #distance in cm
lamda=Xn*twod/(n*D)
print "the wavelength of light is lamda=",lamda,"cm"
#to calculate wavelength
#position of nth bright fringe from the centre of the central fringe is Xn=D*n*lamda/2d----eq(1)
#fringe width umega=D*lamda/2d---------------------eq(2)
#from eq(1) and eq(2) we get, Xn=n*omega
#for 11th bright fringe X11=11*omega
#position for nth dark fringe Xn'=(2n+1)D*lamda/4d
#X4'=(7/2)*omega
#distance between 11th and 4th dark fringe =0.8835 cm
#we get
omega=0.1178 #in cm
twod=0.05 #distance between slis in cm
D=100 # distance in cm
lamda=omega*twod/D
print "the wavelength of light is lamda=",lamda,"cm"
#to calculate changed fringe width
#X10-X0=10*omega
#given that X10-X0=14.73-12.34=2.39mm
omega=0.239 #in mm
lamda=6000 #wavelength in angstrom
lamda1=5000 #lamda'=5000 angstrom
omega1=omega*lamda1/lamda
print "the changed fringe width is omega1=",round(omega1,3),"mm"
#to calculate thickness of mica sheet
n=3
mu=1.6 #refractive index(unitless)
lamda=5.89*10**-5 #wavelength in cm
t=n*lamda/(mu-1)
print "the thickness of mica sheet is t=",t,"cm"
#answer of thickness is given wrong in the book =0.002945 cm
```

In [4]:

```
import math
#to calculate the smallest thickness of the plate
mu=1.5 #refractive index(unitless)
r=60*math.pi/180 #angle of refraction in radians
lamda=5890*10**-10 #wavelength in m
n=1
#formula is t=n*lamda/(2*mu*cosr) where cosr=0.5
t=n*lamda/(2*mu*0.5)
print "the smallest thickness of the plate which will appear dark by reflection is t=","{:.3e}".format(t),"m"
```

In [20]:

```
import math
#to calculate least thickness of the film
lamda=5893*10**-10#wavelength in m
r=0 #in degree
mu=1.42 #refractive index
n=1
#the formula is t=n*lamda/(2*mu*cosr), where cos0=1
t=n*lamda/(2*mu*1)
print "the least thickness of the film that will appear black is t=",t,"m"
t=(2*n-1)*lamda/(2*mu*1*2)
print "the least thickness of the film that will appear bright is t=",t,"m"
```

In [5]:

```
import math
#to calculate thickness of the film
lamda1=6.1*10**-7 #wavelength in m
lamda2=6*10**-7 # wavelength in m
#the two dark consecutive fringes are overlapping for the wavelength lamda1 and lamda2 respectively
#then, n*lamda1=(n+1)*lamda2
#we get,
n=lamda2/(lamda1-lamda2)
sini=4.0/5
mu=4.0/3
#formula is mu=sini/sinr
sinr=0.6
cosr=math.sqrt(1-(sinr)**2)
t=n*lamda1/(2*mu*cosr)
print "the thickness of the film is t=","{:.2e}".format(t),"m"
```

In [6]:

```
import math
#to calculate thickness of the film
mu=1.33 #refractive index of soap film (unitless)
i=45*math.pi/180
#the formula is mu=sini/sinr
sinr=0.5317
cosr=math.sqrt(1-(sinr)**2)
#for destructive interference
lamda=5890*10**-10 #wavelength in m
n=1
t=n*lamda/(2*mu*cosr)
print "the thickness of the film is t=","{:.3e}".format(t),"m"
```

In [7]:

```
import math
#to calculate angle of the wedge
lamda=6000*10**-10 #wavelength in m
mu=1.4 #refractive index in unitless
omega=2*10.0**-3 #distance in m
theta=lamda/(2*mu*omega)
print "the angle of the wedge is theta =","{:.2e}".format(theta),"radians"
```

In [23]:

```
import math
#to calculate wavelength of light
theta=10*22.0/(7*60*60*180.0) #angle of wedge in radians
omega=5*10.0**-2 #distance between the successive fringes in m
mu=1.4 #refractive index
lamda=2.0*mu*theta*omega/(10e-10)
print "the wavelength of light is lamda=",round(lamda),"Angstrom"
```

In [8]:

```
import math
#to calculate wavelength of the light
D15=0.590*10**-2 #diamater of 15th ring in m
D5=0.336*10**-2 #diameter of 5th ring in m
p=1 # in m
R=1 #radius of plano convex lens in m
#formula is lamda=Dn+p**2-Dn**2/4pR
lamda=((D15**2)-(D5**2))/(4*p*R)/(10e-10)
print "the wavelength of the monochromatic light is lamda=",int(lamda),"Angstrom"
```

In [28]:

```
import math
#to calculate refractive index of the liquid
n=6
lamda=6000*10**-10 #wavelength in m
R=1 #radius of curvature of the curved surface in m
Dn=3.1*10**-3 #diameter of 6th bright ring in m
mu=2*(2*n-1)*lamda*R/Dn**2
print "the refractive index of the liquid is mu=",round(mu,3),"unitless"
```

In [10]:

```
import math
#to calculate radius of curvature
lamda=5900*10**-10 #wavelength in m
n=10
Dn=5*10**-3 # diameter of 10th dark ring in m
R=Dn**2/(4*n*lamda)
print "the radius of curvature of the lens is R=",round(R,3),"m"
#to calculate thichness
t=n*lamda/2
print "the thickness of the air film is t=",t,"m"
```

In [11]:

```
import math
#to calculate the distance from the apex of the wedge at which the maximum due to the two wavelengths first coincide
#condition for maxima for normal incidence air film is 2t=(2n+1)lamda/2
#let nth order maximum due to lamda1 coincides with (n+1)th order maximum due to lamda2
#we get , n=(3lamda2-lamda1)/2(lamda1-lamda2)
# we also get, 2t=lamda1*lamda2/(lamda1-lamda2)
#t=X*theta
lamda1=5896*10**-8 #wavelength in cm
lamda2=5890*10**-8 #wavelength in cm
theta=0.3*math.pi/180 #angle of wedge
X=lamda1*lamda2/(2*(lamda1-lamda2)*theta)
print "the distance from the apex of the wedge is X=",round(X,2),"cm"
```

In [13]:

```
import math
#to calculate radius of curvature
n=10.0
Dn=0.50 #diameter of 10th ring in cm
lamda=6000*10**-8 #wavelength in cm
R=Dn**2/(4*n*lamda)
print "the radius of curvature of the lens is R=",round(R,3),"cm"
#answer is given wrong in the book =106 cm
#to calculate thickness of the film
t=Dn**2/(8*R)
print "the thickness of the film is t=","{:.1e}".format(t),"cm"
```

In [14]:

```
import math
#to calculate diameter
#the difference of (n+p)th and nth dark ring is Dn+p**2-Dn**2=4nRlamda
N=12 #where N=n+p
n=4
D12=0.7 #diameter of 12th dark ring in cm
D4=0.4 #diameter of 4th dark ring in cm
#D12**2-D4**2=4pRlamda where p=8 ----eq(1)
#D20**2-D4**2=4pRlamda where p=16 -----eq(2)
#divide eq(2) by eq(1) ,we get
D20=math.sqrt((2*D12**2)-D4**2)
print "the diameter of 20th dark ring is D20=",round(D20,1),"cm"
```

In [15]:

```
import math
#to calculate diameter
lamda1=6*10**-5 #wavelength in cm
lamda2=4.5*10**-5 #wavelength in cm
R=90 #radius of curvature of the curved surface in cm
#Dn**2=4nRlamda1 -------eq(1)
#Dn+1**2=4(n+1)Rlamda2-------eq(2)
#the nth dark ring due to lamda1 coincides with (n+1)th dark ring due to lamda2
#from eq(1) and eq(2)-4nRlamda1=4(n+1)Rlamda2
# we get,
n=lamda2/(lamda1-lamda2)
Dn=math.sqrt(4*n*R*lamda1)
print "the diameter of nth dark ring for lamda1 is Dn=",round(Dn,3),"cm"
```

In [17]:

```
import math
#to calculate the difference of square of diameters for nth and (n+p)th ring when light of wavelength lamda is changed to lamda'
lamda=6*10**-5 #wavelength in cm
lamda1=4.5*10**-5 #wavelength in cm
#Let D=(D**2-Dn**2)=0.125 cm**2
D=0.125
#formula is D'(n+p)**2-D'n**2=lamda'*(D(n+p)**2-Dn**2)/lamda
print "the difference of square of diameters is D1(n+p)**2-D1n**2=(lamda1*D)/lamda=",round((lamda1*D)/lamda,4),"cm**2"
#to calculate difference of square of diamaters when liqquid of refractive index mu' is introduced
mu=1 #refractive index (unitless)
mu1=1.33 # mu'=1.33
#formula is D'(n+p)**2-D'n**2=(mu/mu')*(D(n+p)**2-Dn**2)
print "the difference of square of diameters is D1(n+p)**2-D1n**2=(mu*D)/mu1=",round((mu*D)/mu1,3),"cm**2"
#to calculate difference of square of diameters when radius of curvature of convex surface of the plano convex lens is doubled
R1=2 #radius of curvature is R'=2R
R=1
#formula is D'(n+p)**2-D'n**2=(R'/R)*(D(n+p)**2-Dn**2)
print "the difference of square of diameters is D1(n+p)**2-D1n**2=(R1*D)/R=",(R1*D)/R,"cm**2"
```