How to calculate probability of a state given the partition function Given a canonical partition function $Z$, by the thermodynamic connection equations, I can say that $$A = -k_B T \ln Z$$
So, internal energy $U$ is given by
$$\langle E \rangle =U = -\frac{\partial \ ln Z}{\partial \beta}$$
My question is, how would I calculate the probability of the energy being equal to the average energy $U$, given by the above equation? How would I calculate the probability of the energy of the system being $kU$, where $k$ is some positive constant?
My question is, would the probability of the energy being
$$P(E=U) = e^{-\beta U}/Z$$
and
$$P(E=kU) = e^{-\beta kU}/Z?$$
How would you do this for an ideal gas partition function
$$Z = \frac{1}{N!} \left( \frac{2\pi m k_B T}{h^2}  \right)^{3N/2} V^N?$$
 A: If you have the partition function, then it's straightforward to get the relevant distribution expressed in phase space coordinates $\Gamma$:
$$p(\Gamma) = \frac{e^{-\beta E(\Gamma)}}{Z}$$
But that's not the question! The question is about finding the distribution of the energies themselves. For this you need to project the above $6N$-dimensional probability distribution onto a single dimension:
$$p(E)=\int \delta(E-E(\Gamma))\frac{e^{-\beta E(\Gamma)}}{Z}d\Gamma$$
Which is a complicated $6N$-dimensional integral! So in general you will see that this question is extremely difficult and only soluble numerically (and usually not even to satisfactory precision). However, the ideal gas presents one of the few soluble cases, where you know that each velocity coordinate is a normal independent and identically distributed (i.i.d.) variable. The sum of the squares of $3N$ random i.i.d. standard normal variables is known as the chi-square distribution:
$$\chi^2_{3N}(x)=\frac{x^{\frac{3N}{2}-1}e^{-\frac{x}{2}}}{2^{\frac{3N}{2}}\Gamma(\frac{3N}{2})}$$
And this gives you the probability density of observing a particular sum of squares of "dimensionless" velocities. For velocities with variance $\frac{1}{\beta m}$ (Maxwell-Boltzmann distribution) this is equal to:
$$\chi^2_{3N}(\epsilon)=\frac{\beta m(\beta m\epsilon)^{\frac{3N}{2}-1}e^{-\frac{\beta m\epsilon}{2}}}{2^{\frac{3N}{2}}\Gamma(\frac{3N}{2})}$$
Where $\epsilon$ is the squared sum of the Maxwell-Boltzmann distributed velocities. To convert it to a kinetic energy you have to scale once again by $\frac{m}{2}$, s.t. $E = \frac{m\epsilon}{2}$:
$$\chi^2_{3N}(E)=\frac{\beta (\beta E)^{\frac{3N}{2}-1}e^{-\beta E}}{\Gamma(\frac{3N}{2})}$$
Which is the distribution you were looking for.
P.S. For both of these rescalings I have used the general identity for $y=sx$: $p(y)=sp(sx)$ which is just a change of variables. I have also used some algebra to derive the above so they might not be immediately obvious but they should be readily demonstrable.
