A macroscopic system can be in any one of the two energy levels labeled $1$ and $2$, with probabilities $p_1$ and $p_2$ respectively. The degeneracy of the energy level labeled $1$ is $g_1$ and that of the energy level labeled 2 is $g_2$. Show that entropy of the system is given by,
\begin{eqnarray}
S &=& -k_B \sum_{i=1}^2 p_i\ln\ p_i+\sum_{i=1}^2 p_i\left[ k_B\ln\ g_i\right]
\end{eqnarray}
Exclude node summary :
n
5094:SM-HOME, 4727:Diamond Point