Solution (source code)

= Solution

For an ideal gas, translation makes the <molecular partition function> proportional to volume. Define the <molecular partition function density> and number concentration by
$$
f_i=\frac{q_i}{V},\qquad c_i=\frac{N_i}{V}.
$$
Then
$$
\boxed{\mu_i=\varepsilon^{0,i}-k_BT\ln\frac{f_i}{c_i}}.
$$
Both $f_i$ and $c_i$ have units of inverse volume, so their ratio is dimensionless. If concentrations are specified in moles per volume instead, replace $c_i$ in this microscopic expression by $N_A$ times that molar concentration, with consistent volume units.