Solution (source code)

= Solution

Choose the ground-state energy as zero and write $x=\varepsilon/(k_BT)$. The <molecular partition function> must sum individual states, so the triply degenerate excited level contributes three <Boltzmann factors>:
$$
\boxed{q=1+3e^{-x}}.
$$
The probabilities of occupying the two \b[levels] are
$$
\boxed{P_0=\frac1{1+3e^{-x}}},\qquad
\boxed{P_1=\frac{3e^{-x}}{1+3e^{-x}}}.
$$
Each of the three individual excited states has probability $e^{-x}/q$. At high temperature the four states become equiprobable, so the two levels have probabilities $1/4$ and $3/4$, not $1/2$ each. This is the distinction between a level and its <state degeneracy>.