 We've seen that the most likely macrostate of a monatomic gas of n-atoms in a volume V at temperature T is that which minimizes the function sum over i f i log f i plus alpha times sum over i f i minus 1 plus beta times sum over i f i epsilon i minus three-halves k t. The minimization is with respect to the state space cell occupation frequencies f i and the Lagrange multipliers alpha and beta. We combine all the summations to get minus alpha minus three-halves beta k t plus sum over i f i times quantity log f i plus alpha plus beta epsilon i. For a given i, we need to minimize the corresponding term in the sum. Thinking of this as a function g of f i, we want to find where the curve bottoms out, at which point the slope is zero. This means that an infinitesimal change in f i will produce no change in the function. For the log of f i, if we change f i by delta, the log changes by delta over f i plus terms with factors of delta squared, etc. For very small delta, those terms are negligible. Then substituting f i plus delta for f i in our function, we have quantity f i plus delta times quantity log f i plus delta over f i plus alpha plus beta epsilon i. Expanding the product and grouping terms by factors of delta, we first get our original function plus a term proportional to delta and a term proportional to delta squared. We can neglect the delta squared term. Then the condition for a minimum is that the delta term must vanish. For nonzero delta, this requires that log f i plus alpha plus beta epsilon i plus one vanishes. This condition tells us log f i equals minus quantity one plus alpha plus beta epsilon i. Taking the exponential function of both sides, we have f i equals e to the minus one plus alpha plus beta epsilon i. We separate this into factors e to the minus one plus alpha times e to the minus beta epsilon i, and we call the first factor one over z. The sum over i of f i has the equal one, so one over z times the sum over i e to the minus beta epsilon i equals one, and z equals sum over i e to the minus beta epsilon i. This result in which the occupation frequency of a phase space cell, which is the probability for an atom to be in that cell, decreases exponentially with the cell energy is called a Boltzmann distribution. It's one of the most fundamental and important results in all of statistical mechanics. The normalizing factor z is called the partition function. We will see its physical significance in relation to entropy later. For some insight into the Boltzmann distribution, let's look at a simple simulation. We have n boxes, each with initially m balls. We randomly select two boxes. If the first box is not empty, we transfer a ball from it to the second box, and we do this repeatedly. Our question is, what can we say about the eventual distribution of the balls among the boxes? Let's look at a simulation in which 1,000 boxes each initially contain 10 balls. As the simulation runs, many thousands of ball transfers occur, resulting in the number of balls in different boxes varying widely. Looking at this plot, it's not easy to see what the probability is that a box will contain a given number of balls. Let's instead view the simulation's effect in terms of a histogram showing the fraction of boxes that contain a given number of balls. The horizontal axis shows the number of balls in a box. The vertical axis shows the fraction of boxes containing that many balls. Initially, 100% of the boxes contain 10 balls. As the simulation progresses, the distribution rapidly spreads out, and eventually fluctuates about the decreasing exponential curve shown as red dots. This curve is fn equals 1 over z e to the minus n over 10, where the normalizing factor 1 over z makes sum over n of fn equal to 1. And 10 is the average number of balls per box. This shows how a decreasing exponential distribution naturally arises when a set of containers randomly exchange their contents. We can think of the n atoms in our gas as energy containers. Through their collisions, they randomly exchange energy. Not surprisingly, therefore, the distribution of energy among the atoms is a decreasing exponential function. Now, let's look at the partition function. z equals sum over i e to the minus beta epsilon i. Mathematically, this is the normalizing factor for the Boltzmann distribution that makes the occupation frequencies sum to 1. Consider the case where epsilon i equals 0 for all i, corresponding to stationary atoms with no kinetic energy. Then z is the sum over all cells of 1, since e to the 0 equals 1. Since only a single point p equals 0 is available in momentum space, different cells simply correspond to different elementary volumes v0 in coordinate space. And z is just the number of these, called m, equals v over v0. In this simple case, the partition function is just the number of available phase space cells. For atoms with kinetic energy, epsilon i equals pi squared over 2m. The terms in the partition function are no longer simply 1. Instead, they are exponential functions of energy. But, let's assume z still represents the number of phase space cells available to an atom. Each cell has volume h cubed, so we can think of zh cubed as the volume of phase space available to atoms. Graphically, we have x, y, z coordinate space, and px, py, pz momentum space. A phase space cell corresponds to a tiny cube in coordinate space paired with a tiny cube in momentum space. To get a simple estimate of the partition function, let's assume that atoms are confined to a spherical region of momentum space with radius pmax. And each phase space cell has the same probability of being occupied. Let's take pmax as pmax squared over 2m equals the average kinetic energy of an atom, 3 halves kt, from which pmax equals 3m kt to the one-half power. The total phase space volume, zh cubed, is then v from coordinate space times 4pi over 3 pmax cubed from momentum space. Dividing by h cubed, we get z equals v 4pi over 3 3m kt over h squared to the three-halves power. Here, we've expressed h cubed as h squared to the three-halves. For a rigorous calculation, there is effectively no limit to the momentum of an atom. In principle, all kinetic energy could be concentrated in a single atom, giving it an astronomically large momentum value. So, we will sum over momentum space all the way to infinity. But this will not result in an infinite value for z. The summation includes the Boltzmann factor, e to the minus beta over 2m pi squared. This rapidly decreases with increasing momentum and effectively creates a soft limit on the number of phase space cells available to an atom. For small h, the discrete summation over phase space cells is very well approximated by a continuous summation over phase space volume in the form of an integral. For x, y, z coordinate space, this simply gives us a factor of v. For momentum space, we consider a sphere of radius p. This is area 4 pi p squared. If p increases by dp, this creates a shell of volume 4 pi p squared dp. So, zh cubed equals v times the integral from 0 to infinity of e to the minus beta over 2m p squared 4 pi p squared dp. This equals v times the three-halves power of 2 pi m over beta. This non-trivial integral can easily be done using a computer algebra tool. Dividing by h cubed, we have z equals v over h cubed times the three-halves power of 2 pi m over beta. Or, using h cubed equals h squared to the three-halves power, we can move h into the parentheses. This result accounts for the first constraint that the sum over i of fi equals 1. The second constraint is that the average energy of an atom, the sum over i of fi epsilon i equals three-halves kt. So, 1 over z sum over i e to the minus beta epsilon i times epsilon i equals three-halves kt. We multiply by h cubed so that the summation over cells becomes a summation over elementary volumes. Then we use the previous integral approximation. The only change is the factor of 1 over z and the additional energy factor of epsilon, which introduces a factor of p squared over 2m into the integral. This evaluates to v over z 3 square root 2 over beta times the three-halves power of pi m over beta. Again, a computer algebra tool comes in handy for working out the details. Here's that result again. And our expression for z. When we divide by z on the right, this will bring a factor of h cubed into the numerator, which cancels the h cubed on the left. The v factors cancel, as do factors of pi m to the three-halves and beta to the three-halves. This leaves the average energy of an atom equals 3 square root 2 over 2 to the three-halves power times 1 over beta. This reduces to three-halves 1 over beta. Setting this equal to three-halves kt, we find beta equals 1 over kt. This gives us our final version of the Boltzmann distribution. fi equals 1 over z e to the minus epsilon i over kt. The probability an atom will have a kinetic energy epsilon decreases exponentially with energy. The decrease is more rapid at lower temperatures and less rapid at higher temperatures. Substituting for beta in our partition function expression, we arrive at z equals v times the three-halves power of 2 pi mkt over h squared. Compared to our approximate formula, which was based on a simple volume calculation, we see that they have the same dependence on all parameters, v, m, k, t, and h. They differ only in the constants, with the approximate formula being about 38% larger than the precise formula. This justifies our interpretation of the partition function as the effective number of phase space cells available to an atom.