In [3]:

```
#Example 25_1
import math
#To find out how long does a particle lives when shooted
l=2.6*10**-8 #units in sec
t=0.95 #units in c
life=l/math.sqrt(1-t**2) #units in sec
print "The particle lves by a time of="
print round(life,10),"Sec"
```

In [4]:

```
#Example 25_2
import math
#How log it would take according to earth clockfor a space ship to make a round trip
fac=0.9990 #Units in c
relfactor=math.sqrt(1-fac**2) #units in constant
time1=4.5 #Units in Years
time=2*time1 #Units in Years
oritime=relfactor*time #Units in years
print "The original time that is required to complete a round trip is=",round(oritime,1)," Years or ",round(12*oritime)," Months"
```

In [1]:

```
#Example 25_3
import math
#To graph the relativistic factor and explain why we do not observe relativistic time delaton n everyfay phenomena
print "In every day life our clocks never come any where close to such high speeds. The electrons in a beam such as that in television tube are easily accelerated to relativistic speeds"
```

In [2]:

```
#Example 25_4
import math
#To find out what does the women notice about the length of the stick as she starts rotating
print "She notices there is no change in stick. The length contraction effect concerns objects moving at high speed relative to observer. The meter stick is at rest relative to observer."
```

In [3]:

```
#Example 25_5
import math
#To compare the energy that obtained by changing all mass to energy
m=0.1 #units in Kg
c=3*10**8 #Units in meters/sec
e=m*c**2 #units in J
print "The energy that is obtained by changing all mass to energy is E="
print e
print "J"
```

In [12]:

```
#Example 25_6
import math
#To find the apparent mass of a high speed electron
rati=1/3.0 #units in constant
mo=9.6*10**-31 #units in Kg
m=mo/(math.sqrt(1-rati**2)) #Units in Kg
print "The apparent mass of High speed electron is mo="
print m
print "Kg"
#In textbook answer printed wrong as m=9.*10**-31 Kg the correct answer is m=1.018*10**-30
```

In [4]:

```
#Example 25_7
import math
#To find the energy of the photon in a beam
h=6.626*10**-34 #units in J
c=3*10.0**8 #units in meters/sec
lamda=1240*10**-9 #units in meters
e=(h*c)/lamda #units in J
e=e/(1.6*10**-19) #Units in eV
print "The energy of photon is E=",round(e)," eV"
```

In [5]:

```
#Example 25_8
import math
#To find the energy of photonn each case
dist1=1240.0*10**-9 #units in meters
lamda1=100.0 #units in meters
e1=dist1/lamda1 #Units in eV
dist2=1240.0 #units in nano meters
lamda2=550.0 #units in meters
e2=dist2/lamda2 #Units in eV
dist3=1240.0 #units in nano meters
lamda3=0.2 #units in meters
e3=dist3/lamda3 #Units in eV
print "The energy with radio waves is E1="
print e1
print "eV\n"
print "The energy with green light is E2="
print e2
print "eV\n"
print "The energy with photon is E3="
print e3
print "eV\n"
```

In [6]:

```
#Example 25_9
import math
#To find the value of work function for material
h=6.63*10**-34 #units in J
c=3*10.0**8 #units in meters/sec
lamda=5*10.0**-7 #units in meters
vo=0.6 #units in V
e=1.6*10**-19 #units in eV
phi=((h*c)/lamda)-(vo*e) #Units in J
phi=phi/(1.6*10**-19) #units in eV
print "The value of work function for material is Phi=",round(phi,2)," eV"
```

In [7]:

```
#Example 25_10
import math
#To calculate the be-broglies wavelength
h=6.63*10**-34 #units in J
c=5*10**7 #units in meters/sec
m=9.1*10**-31 #Units in Kg
lamda=h/(m*c) #units in meters
print "The be-broglies wavelength is lamda="
print lamda
print "Meters"
```

In [9]:

```
#Example 25_11
import math
#To describe the diffraction pattern that would be obtained by shooting bullet
h=6.63*10**-34 #units in J
m=10**-4 #Units in Kg
c=200 #units in meters/sec
p=m*c #units in Kg meter/sec
lamda=h/p #units in meters
width=0.2*10**-2 #units in meters
sintheta=lamda/width #units in radians
print "The diffraction pattern that would be obtained by shooting bullet is "
print sintheta
print "Radians\n The diffraction angles are so small that the particles will travel essentially straight through the slit"
```