
Overview of Computer Simulation Methods 61
From Equations 2.47 and 2.48, the probability density ρ(N, U) that the system has
N particles and total energy U can be written as follows:
ρ
(
N, U
)
=
D
(
N, U
)
e
β
(
μN−U
)
, (3.90)
where D(N, U) is the density of states (number of microstates per unit energy interval
in a system with N particles and energy U). Then, for T, V, and μ fixed, we can go
further by integrating over energy for each value of N, thus obtaining the probabil-
ity p(N) that the system has N particles. In computer simulation, this probability is
recorded as a histogram obtained from averaging over many independent samples
(Wilding 2001). In a