import math
##Example 17.1
##calculation of probability
##given values
E=.01;##energy difference in eV
kT=.026;##temperture equivalent at room temp in e
##calculation
P=1/(1+(math.e**(E/kT)));
print'%s %.2f %s'%('interatomic spacing is',P,'');
import math
##Example 17.2
##calculation of velocity of e
##given values
e=1.6*10**-19.;##charge of e in C
E=2.1*e;##fermi level in J
m=9.1*10**-31.;##mass of e in kg
##calculation
v=math.sqrt(2.*E/m);
print'%s %.2f %s'%('velocity of e(in m/s)',v,'');
import math
##Example 17.3
##calculation of velocity of fraction of free electrons
##given values
E=5.5;##fermi level in eV
kT=.026;##temperture equivalent at room temp in e
##calculation
f=2.*kT/E;
print'%s %.4f %s'%('fraction of free electrone\s upto width kT on either side of Ef is',f,'');