How good is Stirling's approximation for ln(x!), and what does it give for the configurational entropy of mixing atoms and vacancies?
The entropy of a state is given by Boltzmann's relation, \(S = k\ln\omega\), where \(\omega\) is the number of microscopic arrangements. If \(N_A\) atoms of one kind and \(N_B\) of another (or \(N_B\) vacancies) are distributed over \(N = N_A + N_B\) lattice sites, the number of distinguishable arrangements is
For macroscopic \(N\) (of the order of \(10^{23}\)) the factorials cannot be evaluated directly. Stirling's approximation replaces them:
Substituting, the terms linear in \(x\) cancel because \(N = N_A + N_B\), and with the site fractions \(X_A = N_A/N\) and \(X_B = N_B/N\):
This is the ideal configurational entropy of mixing, the starting point for the thermodynamics of solutions and of point defects. The entropy is largest for \(X_A = X_B = 1/2\) and is zero for a pure material. Its infinite slope at \(X\to 0\) is the reason that a crystal always contains some vacancies at equilibrium.
The approximation has a relative error of about \(\ln(2\pi x)/(2x\ln x)\), which is large for small \(x\) and falls steadily. For \(x\) of a few hundred the error is already below 1%, and for the numbers of atoms in real materials it is negligible. The plots show the error directly.