In [1]:

```
# Given
E = 75 # energy of photon in eV
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in J
#Calculations
f = E * e / h
lamda = c / f
#Result
print "Frequency is %.2e Hz\nWavelength is %.1f A"%(f,lamda * 10**10)
```

In [2]:

```
# Given
P = 2e5 # radiated power in W
f = 98e6 # frequency in Hz
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
E = h * f
n = P / E
#Result
print "Number of quanta emitted per sec is %.2e"%n
```

In [3]:

```
# Given
lamda = 4e-7 # wavelength of spectral line in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
E = (h * c) / lamda
#Result
print "Energy of photon is %.3e J"%E
```

In [7]:

```
# Given
lamda = 5e-7 # wavelength of green light in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
P = 1. # energy in erg
#Calculations
E = ((h * c) / lamda) * (10**7)
n = P / E
#Result
print "Number of photons of green light emitted is %.2e"%n
```

In [8]:

```
# Given
E = 5e-19 # energy of photon in J
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
lamda = (c * h) / E
#Result
print "Wavelength is %.f A"%(lamda * 10**10)
#Incorrect answer in the textbook
```

In [9]:

```
# Given
lamda = 4.35e-7 # wavelength of green light in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
P = 1 # energy in erg
#Calculations
E = ((h * c) / lamda)
#Result
print "Energy of an electron is %.3e J"%E
```

In [14]:

```
# Given
lamda = 5.6e-7 # wavelength of light in meter
n = 120 # no. of photons per second
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
E = ((h * c) / lamda)
p = E * n
#Result
print "Energy received by the eye per second is %.3e W"%p
#Incorrect answer in the textbook
```

In [15]:

```
# Given
lamda = 5.5e-7 # wavelength of light in meter
E = 1.5 # energy in J
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
E_ = ((h * c) / lamda)
n = E / E_
#Result
print "Number of photons of yellow light = %.3e"%n
```

In [16]:

```
from math import *
# Given
lamda = 4.35e-7 # wavelength of light in meter
lambda_ = 5.42e-7 # threshold wavelength of photoelectron in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
w = ((h * c) / lambda_)
v = sqrt(((2 * h * c) / m) * (1 / lamda - 1 / lambda_))
V = m * v**2 / (2 * e)
#Result
print "Work function is %.3e J\nStopping potential is %.2f V\nMaximum velocity is %.3e m/sec"%(w,V,v)
```

In [17]:

```
# Given
f = 1.2e15 # frequency of light in Hz
f_ = 1.1e+15 # threshold frequency of photoelectron emission in copper in Hz
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
E = h * (f - f_) / e
#Result
print "Maximum energy of photoelectron is %.3f eV"%E
```

In [20]:

```
# Given
lamda = 6.2e-7 # threshold wavelength of photoelectron in first case in meter
lambda_ = 5e-7 # threshold wavelength of photoelectron in second case in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
w = ((h * c) / lamda) * (1 / e)
w_ = ((h * c) / lambda_) * (1 / e)
#Result
print "Work function for wavelength %.e A is %.f eV\nWork function for wavelength %.e A is %.2f eV"%(lamda,w,lambda_,w_)
```

In [23]:

```
# Given
lamda = 3.132e-7 # wavelength of light in meter
V = 1.98 # stopping potential in V
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
E = e * V
lambda_ = 1. / ((1. / lamda) - (E / (h * c)))
f = c / lambda_
w = ((h * c) / lambda_)
#Result
print "Work function is %.3e J\nMaximum energy is %.3e J\nThreshold frequency is %.3e Hz"%(w,E,f)
```

In [4]:

```
# Given
w = 4.8 # work function in eV
lambda1 = 5e-7 # wavelength of incident radiation in first case in meter
lambda2 = 2e-7 # wavelength of incident radiation in second case in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
E_k1 = h*c/lambda1
E_k2 = h*c / lambda2
#Result
print "The energy corresponding to wavelength 5000 A is %.2f which is found to be less than the work function 4.8 eV"%(E_k1/e)
print "The energy corresponding to wavelength 2000 A %.2f is found to be greater than the work function"%(E_k2/e)
```

In [29]:

```
# Given
lamda = 5.893e-7 # wavelength of light in meter
V = 0.36 # stopping potential for emitted electron in eV
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
E = h * c / lamda
w = ((h * c) / lamda) * (1 / e) - V
f = w * e / h
#Result
print "Maximum energy is %.2f eV\nWork function is %.2f eV\nThreshold frequency is %.2e cycles/sec"%(E/e,w,f)
```

In [30]:

```
# Given
lamda = 5.89e-7 # wavelength of light in meter
lambda_ = 7.32e-7 # threshold wavelength of photoelectron in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
E = (h * c) * (1 / lamda - 1 / lambda_)
V = E / e
#Result
print "Stopping potential is %.3f V\nMaximum kinetic energy is %.3e J"%(V,E)
```

In [31]:

```
# Given
E = 1.5 # maximum energy in eV
lambda_ = 2.3e-7 # threshold wavelength of photoelectron in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
lamda = 1 / ((E * e / (h * c)) + (1 / lambda_))
#Resuult
print "Wavelength of light is %.1f A"%(lamda * 1e10)
```

In [33]:

```
# Given
lamda = 1.5e-7 # wavelength of light in in meter
w = 4.53 # work function of tungsten in eV
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
E = ((h * c) / lamda) * (1 / e)
k = E - w
#Result
print "Energy of incident photon is %.2f eV,which is greater than the work function \nSo it causes photoelectric emission.\nKinetic energy of the emitted electron is %.2f eV"%(E,k)
```

In [34]:

```
# Given
w = 2.3 # work function of sodium in eV
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
lamda = ((h * c) / w) * (1 / e)
#Result
print "Longest wavelength required for photoemission is %.2f A"%(lamda * 1e10)
```

In [27]:

```
# Given
w = 2 # work function of sodium in eV
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
lamda = ((h * c) / w) * (1 / e)
#Result
print "Threshold wavelength for photo emission is %d A"%(lamda * 1e10)
```

In [35]:

```
# Given
k = 4 # maximum kinetic energy of electron in eV
w = 2.2 # work function of sodium in eV
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
lambda_ = ((h * c) / (w * e))
lamda = (1 / ((((k * e) / (h * c))) + (1 / lambda_)))
#Result
print "Threshold wavelength is %d A\nIncident electromagnetic wavelength is %.f A"%(lambda_ * 1e10,lamda * 1e10)
```

In [36]:

```
# Given
lamda = 3.5e-7 # wavelength of light in meter
i = 1 # intensity in W/m^2
p = 0.5 # percent of incident photon produce electron
a = 1 # surface area of potassium in cm^2
w = 2.1 # work function of potassium in eV
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
E = (((h * c) / lamda) * (1 / e) - w) * e
E_ = (p * a * 1e-4) / 100 # in W/cm^2
n = E_ / E
#Result
print "Maximum kinetic energy is %.3e J\nNumber of electrons emitted per sec from 1cm^2 area is %.2e"%(E,n)
```

In [37]:

```
# Given
lamda = 5.896e-7 # wavelength of first light in meter
lambda_ = 2.83e-7 # wavelength of second light in meter
V1 = 0.12 # stopping potential for emitted electrons for first light in V
V2 = 2.2 # stopping potential for emitted electrons for second light in V
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
#Calculations
h = (e * (V2 - V1) / c) / (1 / lambda_ - 1 / lamda)
#Result
print "Value of Planck constant is %.2e J-sec"%h
```

In [39]:

```
from math import *
# Given
lamda = 1e-10 # wavelength of light in meter
theta = 90 # angle at which scattered radiation is viewed in degree
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
delta_lambda = (h * (1 - cos(theta*pi/180))) / (m * c)
#Result
print "Compton shift is %.3f A"%(delta_lambda * 1e10)
```

In [41]:

```
from math import *
# Given
lamda = 1e-10 # wavelength of light in meter
theta = 90 # angle in degree
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
delta_lambda = (h * (1 - cos(theta*pi/180))) / (m * c)
E = (h * c) / delta_lambda
#Result
print "Compton shift is %.3f A\nEnergy of incident beam is %.3f MeV"%(delta_lambda * 1e10,E / 1.6e-13)
```

In [42]:

```
from math import *
# Given
E = 4 # enrgy of recoil electron in KeV
theta = 180 # scattered angle of photon in degree
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
p = sqrt(2 * E * 10**3 * e * m)
lamda = (2 * h * c) / (p * c + E * 10**3 * e)
#Result
print "Wavelength of incident beam is %.3f A"%(lamda * 1e10)
```

In [44]:

```
from math import *
# Given
lamda = 1e-10 # wavelength of light in meter
theta = 90 # angle in degree
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
delta_lambda = (h * (1 - cos(theta*pi/180))) / (m * c)
E = (h * c) * ((1 / lamda) - (1 / (lamda + delta_lambda)))
#Result
print "Compton shift is %.3e m\nKinetic energy is %.f eV"%(delta_lambda,E / 1.6e-19)
```

In [5]:

```
from math import *
# Given
lamda = 0.144e-10 # wavelength of x-ray in meter
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
theta = 180 # for maximum shift
d_lamda = (h * (1 - cos(theta*pi/180))) / (m * c)
E = (h * c) * ((1. / lamda) - (1. / (d_lamda+lamda)))
#Result
print "Maximum Compton shift is %.4f A\nKinetic energy is %.2f KeV"%(delta_lambda * 1e10,E / 1.6e-16)
```

In [7]:

```
from math import *
# Given
lamda = 0.2e-10 # wavelength of x-ray in meter
theta = 45 # scattered angle in degree
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
delta_lambda = (h * (1 - cos(theta*pi/180))) / (m * c)
E = (h * c) * ((1 / lamda) - (1 / (lamda + delta_lambda)))
theta_ = 180 # for maximum
delta_lambda_ = (h * (1 - cos(theta_*pi/180))) / (m * c)
lambda_ = lamda + delta_lambda_
E_k = h*c*(1/lamda - 1/lambda_)
#Result
print "Wavelength of x-ray is %.4f A\nMaximum kinetic energy %.2e J"%(lambda_ * 1e10,E_k)
```

In [8]:

```
# Given
h = 6.62e-34 # Planck constant in J-sec
v = 96 # speed of automobile in km/hr
e = 1.6e-19 # charge on an electron in C
m = 2e3 # mass of automobile in kg
#Calculations
v_ = v * (5. / 18)
lamda = h / (m * v_)
#Result
print "de-Broglie wavelength is %.2e m"%lamda
```

In [9]:

```
from math import *
# Given
v = 50 # potential differece in volt
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of an electron in kg
#Calculations
lamda = h / sqrt(2 * m * v * e)
#Result
print "de-Broglie wavelength is %.2f A"%(lamda * 1e10)
```

In [10]:

```
from math import *
# Given
t = 300 # temperature in K
k = 1.37e-23 # Boltzmann's constant in J/K
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of neutron in kg
#Calculations
lamda = h / sqrt(3 * m * k * t)
#Result
print "Wavelength of thermal neutron is %.3f A"%(lamda * 1e10)
```

In [11]:

```
# Given
v = 2e8 # speed of proton in m/sec
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of proton in kg
#Calculations
lamda = h / (m * v)
#Result
print "Wavelength of matter wave associated with proton is %.2e m"%lamda
```

In [12]:

```
# Given
lamda = 0.1e-10 # DE Broglie wavelength associated with electron in M
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
#Calculations
V = h**2 / (2 * m* e * lamda**2)
#Result
print "Potential difference is %.2f KV"%(V * 10**-3)
```

In [13]:

```
from math import *
# Given
v = 200 # potential differece in volt
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
q = 3.2e-19 # charge on an alpha particle in C
m = 4 * 1.67e-27 # mass of alpha particle in kg
#Calculations
lamda = h / sqrt(2 * m * v * q)
#Result
print "de-Broglie wavelength = %.2e m"%lamda
```

In [14]:

```
from math import *
# Given
t = 400 # temperature in K
k = 1.38e-23 # Boltzmann's constant in J/K
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 4 * 1.67e-27 # mass of helium atom in kg
#Calculations
lamda = h / sqrt(3 * m * k * t)
#Result
print "de-Broglie wavelength = %.4f A"%(lamda * 1e10)
```

In [15]:

```
# Given
v = 2000 # velocity of neutron in m/sec
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of neutron in kg
#Calculations
lamda = h / (m * v)
#Result
print "de-Broglie wavelength is %.2f A"%(lamda * 1e10)
```

In [18]:

```
# Given
lamda = 1e-10 # wavelength in m
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
m_ = 1.7e-27 # mass of neutron in kg
#Calculations
v = h / (m_ * lamda)
E = h**2 / (2 * m * lamda**2)
E_ = h**2 / (2 * m_ * lamda**2)
#Result
print "Energy for electron is %.f eV\nEnergy for neutron is %.3f eV"%(E / e,E_ / e)
```

In [20]:

```
from math import *
# Given
E1 = 500 # kinetic energy of electron in first case in eV
E2 = 50 # kinetic energy of electron in second case in eV
E3 = 1 # kinetic energy of electron in third case in eV
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
#Calculations
lambda1 = h / sqrt(2 * m * E1 * e)
lambda2 = h / sqrt(2 * m * E2 * e)
lambda3 = h / sqrt(2 * m * E3 * e)
#Result
print "de-Broglie wavelength of electron - \n(1) In first case is %.4f A \n(2) In second case is %.3f A \n(3) In third is %.3f A"%(lambda1*1e10,lambda2*1e10,lambda3*1e10)
```

In [22]:

```
from math import *
# Given
E1 = 1 # kinetic energy of neutron in first case in eV
E2 = 510 # kinetic energy of neutron in second case in eV
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of neutron in kg
#Calculations
lambda1 = h / sqrt(2 * m * E1 * e)
lambda2 = h / sqrt(2 * m * E2 * e)
r = lambda1 / lambda2
#Result
print "Ratio of de-Broglie wavelengths is %.2f:1"%r
```

In [24]:

```
from math import *
# Given
E = 20 # kinetic energy of proton in MeV
E2 = 510 # kinetic energy of neutron in second case in eV
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of proton in kg
m_ = 9.1e-31 # mass of electron in kg
#Calculations
lambda1 = h / sqrt(2 * m * 10**6 * E * e)
lambda2 = h / sqrt(2 * m_ * E * 10**6 * e)
r = lambda2 / lambda1
#Result
print "Ratio of de-Broglie wavelengths is 1:%.f"%r
```

In [26]:

```
from math import *
# Given
E = 1 # kinetic energy of proton in MeV
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of proton in kg
#Calculations
v = sqrt(2 * E * 1.6e-13 / m)
#Result
print "Velocity is %.2e m/sec"%v
```

In [27]:

```
# Given
r = 1. / 20 # ratio of velocity of proton to the velocity of light
c = 3e8 # velocity of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of proton in kg
#Calculations
v = r * c
lamda = h / (m * v)
#Result
print "de-Broglie wavelength is %.3e m"%lamda
```

In [37]:

```
# Given
lamda = 5.0e-7 # wavelength in m
c = 3.e8 # velocity of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of proton in kg
m_ = 9.1e-31 # mass of electron in kg
#Calculations
E1 = h**2 / (2 * m * lamda**2)
E2 = h**2 / (2 * m_ * lamda**2)
#Results
print 'kinetic energy of proton(in J) =%.3e'%E1
print 'kinetic energy of electron(in J) =%.2e'%E2
```

In [38]:

```
from math import *
# Given
n = 1 # no. of Bohr's orbit of hydrogen atom
c = 3e8 # velocity of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
#Calculations
E = (13.6 / n**2) * e
lamda = h / sqrt(2 * m * E)
#Result
print "de-Broglie wavelength is %.1f A"%(lamda*1e10)
```

In [39]:

```
from math import *
# Given
t = 300 # temperature in K
k = 1.376e-23 # Boltzmann's constant in J/K
c = 3e8 # velocity of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m_ = 4 * 1.67e-27 # mass of helium atom in kg
m = 1.67e-27 # mass of hydrogen atom in kg
#Calculations
lambda1 = h / sqrt(3 * m * k * t)
lambda2 = h / sqrt(3 * m_ * k * t)
r = lambda1 / lambda2
#Result
print "Ratio of de-Broglie wavelengths is %d:1"%r
```

In [41]:

```
# Given
lamda = 1.2e-10 # DE Broglie wavelength in m
c = 3e8 # velocity of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
#Calculations
v1 = h / (m * lamda)
v2 = h / (2 * m * lamda)
#Result
print "Group velocity is %.2e m/sec\nPhase velocity is %.2e m/sec"%(v1,v2)
```