Solution (source code)

= Solution

The one-particle partition <function> is
$$
z_1=\frac{A}{h^3}\int_{\mathbb R^3}e^{-\beta p^2/(2m)}\,d^3p
\int_0^\infty e^{-\beta mgz}\,dz
=\frac{A}{\lambda^3\beta mg},
$$
where $\lambda=(2\pi\hbar^2\beta/m)^{1/2}$. Thus
$$
Z_N=\frac{z_1^N}{N!},\qquad
\log z_1=\text{constant}-\frac52\log\beta.
$$
Canonical <differentiation> now gives
$$
\langle E\rangle=-\partial_\beta\log Z_N=\frac{5N}{2\beta}
=\frac52Nk_BT
$$
and
$$
(\Delta E)^2=\partial_\beta^2\log Z_N
=\frac{5N}{2\beta^2}.
$$
Therefore
$$
\frac{\Delta E}{\langle E\rangle}=\sqrt{\frac{2}{5N}}.
$$
The factor $5/2$ consists of $3/2$ from <kinetic energy> and $1$ from gravitational <potential energy>.