#importing modules
import math
#Variable declaration
k=1.38*10**-23;
Ev=0.98; #energy in eV/atom
T1=900; #temperature in C
T2=1000;
A=6.022*10**26; #avagadro's constant
w=196.9; #atomic weight in g/mol
d=18.63; #density in g/cm^3
#Calculation
Ev=Ev*1.6*10**-19; #converting eV to J
d=d*10**3; #converting g/cm^3 into kg/m^3
N=(A*d)/w;
n=N*math.exp(-Ev/(k*T1));
#let valency fraction n/N be V
V=math.exp(-Ev/(k*T2));
#Result
print("concentration of atoms per m^3 is",N);
print("number of vacancies per m^3 is",n);
print("valency fraction is",V);
#importing modules
import math
#Variable declaration
k=1.38*10**-23;
A=6.022*10**26; #avagadro's constant
T=1073; #temperature in K
n=3.6*10**23; #number of vacancies
d=9.5; #density in g/cm^3
w=107.9; #atomic weight in g/mol
#Calculation
d=d*10**3; #converting g/cm^3 into kg/m^3
N=(A*d)/w; #concentration of atoms
E=k*T*math.log((N/n), ); #energy in J
EeV=E/(1.602176565*10**-19); #energy in eV
EeV=math.ceil(EeV*10**2)/10**2; #rounding off to 2 decimals
#Result
print("concentration of atoms per m^3 is",N);
print("energy for vacancy formation in J",E);
print("energy for vacancy formation in eV",EeV);
#importing modules
import math
#Variable declaration
A=6.022*10**26; #avagadro's constant
k=1.38*10**-23;
w1=39.1; #atomic weight of K
w2=35.45; #atomic weight of Cl
Es=2.6; #energy formation in eV
T=500; #temperature in C
d=1.955; #density in g/cm^3
#Calculation
Es=Es*1.6*10**-19; #converting eV to J
T=T+273; #temperature in K
d=d*10**3; #converting g/cm^3 into kg/m^3
N=(A*d)/(w1+w2);
n=N*math.exp(-Es/(2*k*T));
#Result
print("number of Schotky defect per m^3 is",n);
#answer given in the book is wrong by 3rd decimal point