\begin{aligned}\frac{S}{k_{\mathrm{B}}} &= \beta U - N \mu \beta + q/(\beta k_{\mathrm{B}} T) \\ &= -\beta \frac{\partial {q}}{\partial {\beta}} - z \mu \beta \frac{\partial {q}}{\partial {z}} + q \\ &= \frac{1}{{Z_{\mathrm{G}}}}\sum_{r, s}\left( -\beta (-E_s) - \mu \beta N_r  \right) e^{-\alpha N_r - \beta E_s}+ \ln Z_{\mathrm{G}} \\ &= \sum_{r, s} \ln e^{ \alpha N_r + \beta E_s } P_{r,s} + \left( \sum_{r, s} P_{r, s}  \right)\ln Z_{\mathrm{G}} \\ &= -\sum_{r, s} \ln \frac{e^{ -\alpha N_r - \beta E_s }}{Z_{\mathrm{G}}} P_{r,s} \\ &= -\sum_{r, s} P_{r, s} \ln P_{r, s}\end{aligned} \hspace{\stretch{1}}(1.0.8)
{}