Statistical Mechanics
Chapter 2: Boltzmann statistics (1):
Statistics
Yongle Li
物理系 & 量子与分子结构国际中心
上海大学
2025 年 7 月 8 日
1 Basic assumptions
1. Microstates and macrostates
Microscopic variables: m, ⃗v , ⃗x, ε
Macroscopic variables: U , V , S, T
2. Thermodynamic limit (in modern physics, there would be situation
named many-body localization, that is, even the system reaches the
TL, there is no equilibrium state at all!):
V →∞
N →∞
N
ρ= is finite.
V
3. The a priori equal probability assumption
4. Distribution Ω({Ei })
5. The most probable distribution can represent the summation of pos-
sible distributions
1
6. Lagrange multiplier and Stirling approximation
2 Counting of the microstates
We use Ω(Ei ) to denote the number of states for a given Ei . For all
Ei ≤ E, we can define the summation of states:
∑
Σ(E) = Ω(Ei ), Ei ≤ E
i
For counting the number of states in the energy range E, E + ∆E,
( dΣ )
∆E
dE
2.1 Example 1: two hydrogen atoms
13.6eV
En = −
n2
1) E = 2E1 , only 2 × 2 = 4 choices: ms = ± 21
2) E = E1 +E2 , there are 2!×(2×2×[(2×0+1)+(2×1+1)]) = 32 different
choices. Since there are two distinguishable H atoms, the permutation
is 2! = 2. The ground state H atom has two possible spins, providing
degeneracy as 2. And the 1st excited state of H atom can be with
l = 0, 1, contributing two possibilities. If l = 0, m = 0, there is only one
possibility. But if l = 1, m = 0, ±1, there are 2 × 1 + 1 = 3 possibilities.
Again multiply the contribution from spin, 2 × [1 + 3] = 8 possibilities.
So in total there are 2! × (2 × 8) = 32 possibilities.
3) E = 2E2 , Exercise!
2.2 Example 2: two particles in 1-D square potential well
π 2 h̄2 n2
En = = ε ∗ n2
2mL2
Known condition:
E = 102 ε∗ , N =2
2
How many choices?
Example code in Python 3
f o r i in range ( 1 0 ) :
f o r j in range ( 1 0 ) :
i f i ∗∗2 + j ∗∗2 = = 1 0 0 :
print ( i , j )
2.3 Generalization: Permutation and Combination
Known condition:
1) Energy level: ε1 , ε2 , ε3 , · · ·
2) Number of particles in each energy level: n1 , n2 , n3 , · · ·
A set of the number of particles in each energy level, {ni }, named
a distribution (different from the terminology used in probability). Each
distribution corresponds to a number of choices, Ωi .
An example:
εi = i ∗ ε ∗
E = 5ε∗ , N =3
There are two possibilities:
distribution 1 : n1 = 1, n2 = 2, n3 = 0
distribution 2 : n1 = 2, n2 = 0, n3 = 1
So, Ω1 has C31 × C22 = 3 choices, and Ω2 has also C32 × C11 = 3 choices.
Ω1 = C31 × C22 = 3
Ω2 = C32 × C11 = 3
Finally,
Σ = Ω 1 + Ω2 = 6
3
But for large N , it’s impossible to enumerate like that.
2.4 Counting the large number: most probable distribu-
tion
The other name of this method is maximum-term mathod.
What we need: The summation of states:
∑
Σ= Ωi
i
To calculate it, we use the assumption (Ω∗ is the maximum term, and
corresponding to the most probable distribution {n∗i }):
∑
Σ= Ωi ≈ Ω ∗
i
4
Proof (McQuarrie 2000, and T. L. Hill 1987):
∑
M
Σ= Ωi
i
⇒Ω∗ ≤ Σ ≤ M Ω∗
log Ω∗ ≤ log Σ ≤ log Ω∗ + log M
Generally speaking, the log M is always much less than log Ω∗ .
An example: 2100 has 101 terms, so M = 101. The value of
this summation is about 1.3 × 1030 , and the maximum term is
100!/(50!50!) ≈ 1.0 × 1029 .
We can see:
log Ω∗ ≤ log Σ ≤ log Ω∗ + log M
29 log 10 + log 1.0 ≤ 30 log 10 + log 1.3 ≤ 29 log 10 + log 1.0 + log 101
66.8 ≤ 69.3 ≤ 66.8 + 4.6 = 71.4
So actually the accuracy for this approximation is not quite good,
with the accuracy O(eM ). But since in the statistical mechanics, the
Σ is always used in the form log Σ, this accuracy is acceptable.
Surely this is a rough estimation, and we can discard it after we have
learned ensemble theory.
2.5 Using permutation to calculate the number of states
Suppose there are N particles in total, and the distribution {ni } is
known
1) Classical distinguishable particles:
1.1. Full permutation of such particles: N !.
1.2. But the permutation in each energy level does not give new state.
∏
We need to divide i ni !.
Example: Suppose there are four particles a, b, c and d, two energy
levels E1 and E2 , and the distribution {ni } = (2, 2). So there are 4! = 24
5
different permutations in total, but the permutations in each energy
level such as: ([ab], [cd]), ([ba], [dc]), ([ab], [dc]), ([ba], [cd]) do not give new
permutations, so that we need to divide these possibilities.
∏
1.3. We need to multiply the degree of degeneracy i gin1
∏ g ni
i
Ω = N!
i
ni !
2) Classical indistinguishable particles:
One needs to use combination instead of permutation.
∏ g ni
i
Ω=
i
n i!
(Optional) Other distributions from Boltzmann statistical method
1) Identical boson:
There can be infinite particles at each energy level. That is, the
number of particles at given energy level is unlimited.
This is equivalent to the combination of ni with (gi − 1).
∏ ∏ (ni + gi − 1)!
Ω= Cnnii+gi −1 =
i i
ni !(gi − 1)!
2) Identical fermion:
There is at most 1 particles at each energy level.
If the degeneracy ≫ number of particles
∏ ∏ gi !
Ω= Cgnii =
i i
ni !(gi − ni )!
2.6 Lagrange multipliers
We only consider the classical particles.
Two additional constraints:
1) The number of particles is reserved:
∑
ni = N
i
6
2) The total energy is reserved:
∑
E= ni ε i
i
∏ g ni
i
log Ω = log N !
i
ni !
∑
= log N ! + (ni log gi − log ni !)
i
Construct a Lagrange multiplier (Here why the functional form of lo-
gorithm is chosen can not be answered in Boltzmann statistics, we see again
the Boltzmann statistics is a rough theory, need to upgrade):
∑ ∑
L = log Ω − α( ni − N ) − β( ni εi − E)
i i
To reach the maximum value of L, there are conditions:
∂L ∂2L
= 0, and <0
∂ni ∂n2i
We also need Stirling formula:
log ni ! ≈ n log n − n
log gi − log ni − α − βεi = 0
That is:
ni = gi e−α−βεi
Now the second order derivative of Lagrangian becomes
∂2L 1
=−
∂n2i ni
eα+βεi
=− < 0,
gi
and hence the extreme value we found is really a maximum of ni , so
that the log Ω.
7
The value of log Ω∗ is:
∑ gi
log Ω∗ = N log N + ni log
i
ni
Once the particles are indistinguishable, that is, the quantum mechanic
correction is considered, the number of states becomes combination, so the
full permutation is divided.
∏ g ni
i
Ω=
i
ni !
∑ gi
∗
log Ω = ni log +N
i
ni
2.7 Discussions about the result: α and partition function
Consider an adiabatic system is divided into two subsystems by a total
permeable wall. Condition:
图 1: Illustration of the system under consideration.
∑ ∑
E = E ′ + E ′′ = n′i ε′i + n′′i ε′′i
i i
∑ ∑
′ ′′
N =N +N = n′i + n′′i
i i
′
n′i = gi′ e−α−βεi
′′
n′′i = gi′′ e−α−βεi
So at the thermal equilibrium, both of the subsystems share the same
α and β. So we can note α = α(µ, T ).
From the first restraint, we can obtain
∑
ni = N
i
∑
−α
e gi e−βεi = N
i
8
We can introduce a partition function (This is the partition function
in Boltzmann statistics, or more precisely it should be called single-particle
partition function. We will discuss this in following part of statistical en-
semble.): ∑
Z= gi e−βεi
i
So we can obtain the first Lagrange multiplier, α:
N
e−α =
Z
Further discussion about the partition function Z in Boltzmann
statistics
From here we can go even further to see the meaning of the partition
function. We set the zero point of energy as the ground energy,
ε0 = 0, then we can obtain:
n 0 + n 1 + n2 + · · · = N
−βε1
n0 + n0 e + n0 e−βε2 + · · · = N
N
Z ≡ (1 + e−βε1 + e−βε2 + · · · ) =
n0
So we can find the partition function is the ratio between the number
of total particles to the number of the particles at the ground state:
N
e−α = = n0
Z
And
ni = n0 e−βεi
This is no more than the statement: the higher energy level is, the less
particles at that. And the ratio follows the Boltzmann distribution.
For further discussions, please see: Frank C. Andrews, Equilibrium
Statistical Mechanics, John Wiley & Sons, Inc. (1st ed. 1963, 2nd
ed. 1975)
Note One must pay attention to the zero point energy here. Other-
wise one would have Z < 1, then obtain a nonsense relation n0 > N !
9
3 Discussions about the result: inner energy
From ∑
ni ε i = E
i
N∑
U ≡E= εi gi e−βεi
Z i
N∑
=− gi (−εi )e−βεi
Z i
N ∂Z
=−
Z ∂β
∂ log Z
= −N
∂β
4 Discussions about the result: β
Let’s consider an adiabatic system divided by a diabatic wall. This wall
divides the system into two equal parts.
图 2: Illustration of the system under consideration.
Condition:
∑ ∑
E = E ′ + E ′′ = n′i ε′i + n′′i ε′′i
i i
∑
′
N = n′i
i
∑
′′
N = n′′i
i
′ ′
n′i = gi′ e−α −βεi
′′
−βε′′
n′′i = gi′′ e−α i
10
At thermal equilibrium, both of the subsystems share the same β. And
from the zeroth law, both the subsystems share the same temperature T .
This suggests β = β(T ). From matching the dimension, we can see β must
with the dimension of inverse energy. And we have already know kB T is with
the same dimension of energy in Thermal Physics (热学), we can conclude
β = (kB T )−1 . The detailed discussion is in the next section.
(Optional) From here we can obtain the expression of ln Ω∗ .
[ ∗ ]
∏ g ni
ln Ω∗ = ln N ! i
i
n∗i !
(Using Stirling′ s formula)
∑ ( ) ∑
∗ gi
= N ln N − N + ni ln + ni
i
ni i
∑N ( )
−βεi gi Zeβεi
= N ln N + gi e ln
i
Z N gi
∑N ( )
−βεi Z
= N ln N + gi e ln + βεi
i
Z N
∑ N gi e−βεi εi
= N ln Z + β
i
Z
= N ln Z + βU
∂ ln Z
= N ln Z − β
∂β
Actually, if we use Boltzmann’s principle of entropy, we can imme-
diately obtain the expression of entropy:
U
S = kB ln Ω∗ = N kB ln Z + βkB U = N kB ln Z +
T
∂ ln Z
= N kB ln Z − βkB
∂β
11
(Optional) Bose-Einstein distribution To proceed we need the
following approximations:
n i + g i − 1 ≈ ni + g i
gi − 1 ≈ gi
ni + g i ≫ 1
gi ≫ 1
And setup the Lagrangian:
∏ (ni + gi )! ∑ ∑
L = log − α( ni − N ) − β( ni εi − E)
i
ni !gi ! i i
Take the partial differential, and use the Stirling formula:
∂L
=0
∂ni
[ ]
∂ ∑
⇒ (ni + gi ) log(ni + gi ) − ni log ni − α − βεi = 0
∂ni i
ni + g i
log = α + βεi
ni
gi
ni = α+βεi
e −1
12
(Optional) Fermi-Dirac distribution
To proceed we need the following approximations:
ni ≫ 1
gi ≫ 1
g i − ni ≫ 1
And setup the Lagrangian:
∏ gi ! ∑ ∑
L = log − α( ni − N ) − β( ni εi − E)
i
ni !(gi − ni )! i i
Take the partial differential, and use the Stirling formula:
∂L
=0
∂ni
[ ]
∂ ∑
⇒ log gi ! − ni log ni + ni − (gi − ni ) log(gi − ni ) + (gi − ni )
∂ni i
− α − βεi = 0
g i − ni
log = α + βεi
ni
gi
ni = α+βεi
e +1
5 Entropy
The entropy is the measure of elemental chaos in the experiments. Con-
sidering the experiments taken at finite temperature, any observable is the
average value of observation. This is true not only in mechanics, but also
in electrodynamics: the initial values and boundary values are all averages
from given distributions.
In thermodynamics, it also comes from the fact the number of particles
is of the order of magnitude as 1023 .
13
5.1 Deducing the functional form of entropy
First, we can deduce, the entropy is related to some probability of the
system. So the probability, denoted as W , must obey multiplication rule:
Suppose there are two systems A and B which have reached equilibrium
with each other. If we use C to denote the combination of systems A and
B:
C = A + B, ⇒ WC = WA WB
In another hand, the entropy must be a state function, so if S = f (W ),
we must have:
f (WA WB ) = f (WA ) + f (WB )
WB f ′ (WA WB ) = f ′ (WA ) Differentiate both sides with WA .
f ′ (WA WB ) + WB WA f ′′ (WA WB ) = 0 Differentiate both sides with WB .
⇒ f ′ (WC ) + WC f ′′ (WC ) = 0
xy ′′ (x) + y ′ (x) = 0
To solve this second order ordinary differential equation:
1
xy ′′ (x) + y ′ (x) = 0 ⇔ y ′′ (x) + y ′ (x) = 0
[∫ ] )′ x
( 1
y ′ (x) exp dt =0
t
y ′ (x) = C1 exp [− ln x ]
1
y ′ (x) = C1
x
y(x) = C1 ln(x) + C2
So this is the historical appearance of the functional form of entropy.
There are two undetermined constants, C1 and C2 . From classical statistical
mechanics, only C1 can be determined as Boltzmann’s constant, kB . From
the semi-classical correction of entropy, the C2 can be found as
C2 = −N ln N + N
For further details, one can resort to Max Planck, The theory of heat
radiation, 1914. The discussion here can be found on pages 118-121.
14
5.2 The microscopic explanation of entropy
When we take the total derivative of the inner energy U , we have two
parts:
∑ ∑
dU = d (ni Ei ) = ni dEi + Ei dni
i i
From physical consideration, we can see the first term is the changing
of each eneryg level, so that this part should be done via work. Since if
we suppose a small change of the generalized displacement dxj occurs, then
the generalized work environment done to the system can be calculated
correspondingly:
∑ ∑ ∑ ∑ ( ∂Ei ) ∑
đW = − ni Yj dxj = −
i
ni − dxj = ni dEi
i j i j
∂xj i
And the second part stands for the changing of the number of particles
in each energy level, and this change should be done via heat.
So, ∑
đQ = Ei dni
i
Then the entropy from its definition is:
∑
đQ Ei dni
dS = = i
T T ( )
dS ∑
= β(dU ) + U (dβ) − β ni dEi − U dβ
kB i
N ∑ −βEi
= d(βU ) − gi e (β dEi + Ei dβ)
Z i
= d(βU ) + d {N ln Z}
U
⇒S= + N kB ln Z + S0
T
In classical statistics, one cannot obtain the S0 a priori. After we have
learnt quantum statistics, all things can be solved.
5.3 (Optional) The finding of β
(This discussion is somewhat advanced, one can go to next chapter for
a easier discussion of β.)
15
For detailed discussion of β = (kB T )−1 , one can refer to Schrodiner’s
Statistical Thermodynamics, Chapter 2. Here we give a brief discussion.
Set F = −βF = ln Z
Then
∂F ∑ ∂F
dF = dβ + dEi
∂β i
∂Ei
U β ∑
= − dβ − ni dEi
N N i
Introduce a Legendre transform:
βU
F+ =G
N
Now we have: ( )
1 1 ∑
dG = β dU − ni dEi
N N i
And now we find that β is an integrating factor of the quantity:
( )
1 ∑
dU − ni dEi
N i
And from our discussion, this term is no more than the heat đQ per
particle. So we can see β is another integral factor as 1/T . From the related
《常微分方程(第二版)》,第二章
mathematical theories (丁同仁,李承治,
习题 2-5 第四题), we can condlude:
1/T 1
= = ϕ(G )
β Tβ
And from the total differential of G , we can find:
đQ
N ϕ(G ) dG = = dS
T
Since G is a function of S, we can suppose G = χ(S)
Now we try to find χ(S).
Suppose there are two systems A and B. for χ(S), there should be:
χA (SA ) + χB (SB ) = χAB (SAB )
And since S is extensive:
16
SA + SB = SAB
χA (SA ) + χB (SB ) = χAB (SA + SB )
Take differentiate for SA and SB separately, we can have:
dχA (SA ) ∂χAB (SAB ) ∂SAB ∂χAB (SAB )
= =
dSA ∂SAB ∂SA ∂SAB
dχB (SB )
∂χAB (SAB ) ∂SAB ∂χAB (SAB )
= =
dSB ∂SAB ∂SB ∂SAB
So, we have:
dχA (SA ) dχB (SB )
=
dSA dSB
This result means the dχ(S)/ dS must be a constant. We can set it as
(N kB )−1 . So χ(S) = S/(N kB ).
Now ( )
S
N ϕ(G ) d = dS
N kB
⇒ ϕ(G ) = kB
So, we can have β:
1/T 1
= = ϕ(G ) = kB
β Tβ
1
⇒β=
kB T
6 Derivation of pressure in Boltzmann statis-
tics
From the fundamental equation of thermodynamics, we change the
variable as S and V :
dU = T dS − p dV
1 p
dS = dU + dV
T T
17
So, the pressure p is:
( )
p ∂S
=
T ∂V U
( )
∂[U /T + N kB ln Z]
=
∂V U
Here from equipartition theorem of energy, E ∝ T , the first part is
zero. ( )
∂ ln Z
p = N kB T
∂V U
Since till now we have not show how to calculate the partition function for
ideal gas, we cannot calculate the final expression of pressure yet.
7 Example 1: Unwinding of DNA
The unwinding of a double-stranded DNA molecule can be modeled
as the unwinding of a zipper. There are N links, each of which can be in
one binary mode: closed with energy ε = 0, or open with energy ε = ∆.
(Kerson Huang, Lectures on Statistical Physics and Protein Folding, World
Scientific, 2005, pp. 24, ff. )
Only if a link has an open neighbor, it has a chance to open. Otherwise,
it is always closed. Now let’s find its average number of open links n̄.
∑
N
1 − e−β(N +1)∆
ZN = e−βn∆ =
n=0
1 − e−β∆
∑N
ne−βn∆
n=0
n̄ =
ZN
1 ∂ ln ZN
=−
∆ ∂β
1 (N + 1)
= β∆ −
e − 1 eβ(N +1)∆ − 1
Let’s have a brief discussion of such a result.
1. At low temperature, β∆ ≫ 1, the open links are quite few:
n̄ ≈ e−β∆
18
2. At high temperature, β∆ ≪ 1, we need to calculate the limit:
{ }
1 (N + 1)
lim n̄ = lim −
β∆→0 β∆→0 eβ∆ − 1 eβ(N +1)∆ − 1
{ (N +1)x }
e − (N + 1)ex + N
= lim
x→0 (ex − 1)(e(N +1)x − 1)
{ }
(N + 1)e(N +2)x − (N + 1)ex
= lim
x→0 (N + 2)e(N +1)x − ex − e(N +1)x (N + 1)
{ }
(N + 1)eN x − (N + 1)
= lim
x→0 (N + 2)eN x − 1 − eN x (N + 1)
{ }
(N + 1)N eN x
= lim
x→0 (N + 2)(N + 1)e(N +1)x − eN x N (N + 1)
N
=
2
19
8 Example 2: Multiple states of a protein
(K. Dill and S. Bromberg, Molecular Driving Forces, 2nd Ed. 2010,
pp. 191)
图 3: Illustration of six states of the given protein.
We are interested in:
1. The probability p(i) for finding the protein in state i.
2. The probability p(E) for finding the protein having energy E.
3. Use the previous expressions of p, find: 1) p(State B), 2) p(State A),
3) p(State D) 4) p(1 kcal/mol), and 5) p(−5 kcal/mol)
4. The average energy of the ensemble of conformations.
RT = 1.987 cal · mol−1 · K−1 × 300 K = 0.5961 kcal · mol−1
∑
Z= e−Ei /(RT )
i
−2.0/0.5961
=e + e−1.0/0.5961 × 2 + e3.0/0.5961 × 2 + e5.0/0.5961
= 4700.49
20
e−Ei /(RT )
p(i) =
Z
g(E)e−E/(RT )
p(E) =
Z
Here we need to find the degree of degeneracy of each energy.
g(−2 kcal · mol−1 ) = 1
g(−1 kcal · mol−1 ) = 2
g(3 kcal · mol−1 ) = 2
g(5 kcal · mol−1 ) = 1
1. p(State B) = e−EB /RT /Z = e−(−3.0)/0.5961 /4700.49 = 0.0326
2. p(State A) = e−EA /RT /Z = e−(−5.0)/0.5961 /4700.49 = 0.935
3. p(State D) = e−ED /RT /Z = e−(1.0)/0.5961 /4700.49 = 3.975 × 10−5
4. p(1 kcal/mol) = g(E = 1 kcal/mol)e−1.0/RT /Z = 2.0×e−1.0/0.5961 /4700.49 =
7.949 × 10−5
5. p(−5 kcal/mol) = g(E = −5 kcal/mol)e−(−5.0)/RT /Z = 1.0×e5.0/0.5961 /4700.49 =
0.935
So our discussion for Boltzmann statistics ends here. Actually it can
be used in some of simple cases, and easy to understand. But one cannot
feel satisfied here, since it has several fundamental problems:
1. It is a classical theory, and cannot give details for some thermodynamic
variable, such as the entropy.
2. It assumes the particles under statistics are non-interactive, for real
systems we know it’s impossible.
3. The formula from it are based on too strong assumptions, such as
ni → ∞, but it cannot be true in practices. In statistical physics, only
the total number of particles can goes to infinity (N → ∞).
21
9 (Optional) Classical limit conditions
9.0.1 Non degenerate condition
eα ≫ 1
gi
≫1
ni
That is, the energy level between particles is large so that there are
enough empty levels for the occupation of particles.
9.0.2 Quasi-continuous of energy levels
∆ε ≪ kB T
Summation can transform into integration.
22