In [1]:

```
#pg 493
#calculate the ratio required and Temperature
#Given :
import math
lambd = 6000.; #wavelength in A
k = 8.62*10**-5; # in eV/K
T = 300.; # Temperature in K
#calculations
#Equilibrium ratio = N2/N1 = exp[-(E2-E1)/k*T]
#(a)
E2_E1 = 12422./lambd; # energy in eV
Ratio = math.exp(-E2_E1/(k*T));
#(b)
T1 = (E2_E1)/(k*math.log(2)); # Temperature in K
#results
print "Ratio =",round(Ratio*10**35,1),"x 10^-35 "
print "T (K) = ",round(T1,0)
print 'Resuts obtained differ from those in texbook, because approximate value of k*T was considered'
```

In [2]:

```
#pg 497
#calculate the difference required
#Given :
L =8.;# in cm
lambd = 5330.; #wavelength in A
# lambd = 2*L/n
# 1 A = 1.0*10**-8 cm
#calculations
n= (2*L)/(lambd*10**-8); # allowed modes
#adjacent mode
n1 = round(n+1);
# 1 cm = 1.0*10**8 A
lambd1 = ((2*L)/n1)*10**8;# wavelength in A
D = lambd-lambd1; # difference in wavelengths in A
#results
print "Difference (A) = ",round(D,3)
```

In [3]:

```
#pg 505
#calculate the laser source and Ordinary source
import math
#Given :
tau_c = 10.**-5; # lifetime of lasing energy in s
tau_c1 = 10.**-8; # coherence time in s
lambd = 5000.; # wavelength in A
c = 3.*10**8;# light speed in m/s
# Ratio = delta_lambd/lambd = lambd/(c*tau_c)
# 1 A = 1.0*10**-10 m
#(a)Laser source
#calculations
Ratio = (lambd*10**-10)/(c*tau_c);
#(b)Ordinary source
Ratio1 = (lambd*10**-10)/(c*tau_c1);
#results
print "Laser source =",math.floor(Ratio*10**10),"x 10^-10"
print "Ordinary source =",math.floor(Ratio1*10**7),"x 10^-7"
print'Results obtained differ from those in textbook, beacuse only order of 10 was considered in the result.'
```

In [4]:

```
#pg 506
#calculate the intensity required
#Given :
P = 10.; # Power in W
lambd =5000.; # wavelength in A
SI = 7*10**3; # Sun's radiation intensity in W/cm^2
# 1 A = 1.0*10^-8 cm
#calculations
I = P/(lambd*10**-8)**2; #Intensity in W/cm^2
Ratio = (I)/SI;
#results
print "Intensity =",I*10**-9,"x 10^6 kW/cm^2 "
print "Intensity of this laser source is",round(Ratio*10**-6,0),"x 10^6 times the intensity of Sun radiation"
```

In [5]:

```
#pg 512
#calculate the Number of Telephone and Television conversations and programmes
#Given :
c = 3.*10**8;# light speed in m/s
#Visible range = 4000 A - 7000 A
lambd1 = 4000.; # wavelength in A
lambd2 = 7000.;# wavelength in A
#calculations
# 1 A = 1.0*10**-10 m
nu1 = c/(lambd1*10**-10); # frequency in Hz
nu2 = c/(lambd2*10**-10);# frequency in Hz
deltanu = nu1-nu2; # in Hz
#(a)Telephone conversations
f1 = 10**3; # frequency in Hz
n1 = deltanu/f1;
#(b)Television programmes
f2 = 10**7; # frequency in Hz
n2 = deltanu/f2;
#results
print " Number of Telephone conversations =",round(n1*10**-11),"x 10^11"
print " Number of Television programmes =",round(n2*10**-7),"x 10^7"
print 'The answers differ from textbook due to rounding off error'
```