from math import log
#Variable declaration
#E=Ef+1% of Ef
k=1.38*1e-23;#boltzman constant
e=1.6*1e-19;#charge of electron
E=0.0555;
#calculations
#0.1=1/[(exp((E*e)/(k*T)))+1]
T=(E*e)/(k*log(9));#Temprature
#Result
print 'Temprature = %.f K'%T
#Incorrect answer in the textbook
from math import exp
#Variable declaration
sx=0.01 #in ev. where x=E-Ef
x1=sx*1.6*1e-19 #converting it in joule
T=200 #in kelvin
#calculation
Fe=1/(1+exp(x1/(1.38*1e-23*T)));#The value of F(E)
#Result
print 'The value of F(E) = %.2f'%Fe
#Variable declaration
density=7.13*1e3 #in kg/m^3
M=65.4
N=6.023*1e26 #avogedro number
#Calculations
n=(2*density*N)/M
n1=n**(2./3);
Ef=3.65*1e-19*n1; #in eV
Ef1=(3./5)*Ef #in eV
#Results
print 'fermi energy = %.1f eV'%Ef
print 'Mean energy at T=0K is %.f eV'%Ef1
#Incorrect answers in the textbook
#Variable declaration
Ef=5.51 #in eV
#calculation
E=(3./5)*Ef;#The average energy of a free electron in silver at 0k
#Result
print 'The average energy of a free electron in silver at 0k = %.3f eV'%E