Third law of thermodynamics - A contradiction? The third law of thermodynamics states that a system in equilibrium has entropy $\to$ 0, as its temperature $\to$ 0, which essentially means the system is in ground state.  However consider the case of particles in a box or simple harmonic oscillators at $T = 0$, or in the absence of a bath. Naively it seems that these systems can be excited at any particular energy level while the temperature is fixed, and therefore the entropy is non-zero. Why is the third law even valid in this case?
 A: Consider your case of $N$ simple harmonic oscillators, each of which has energy $E_i = N_i+ \frac{1}{2}$. The total energy of the system is given by 
$$E = \sum_i E_i = \sum_i N_i+ \frac{N}{2}$$
while the number of energy quanta distributed is given by 
$$Q = \sum_i N_i.$$
The number of microstates accessible to these harmonic oscillators is 
$$\Omega (E,N) = \frac{(Q + N -1)!}{Q!(N-1)!} = \frac{(E + N/2 -1)!}{(E-N/2)!(N-1)!}.$$
You can show using Stirling approximation that
$$S = Nk_B \left[ \left( E/N + 1/2\right) \log \left( E/N + 1/2\right) - \left( E/N - 1/2\right) \log \left( E/N - 1/2\right) \right].$$
The temperature is found out to be
$$\frac{1}{T} = \frac{\partial S}{\partial E} = k_b \log \left(\frac{E/N + 1/2}{E/N -1/2} \right)$$
from which the energy density is given by 
$$\frac{E}{N} = \frac{1}{2} \coth \left[ \frac{1}{2k_bT}\right].$$
You can easily check here that if $T \to 0$, then $E \to \frac{N}{2}$, and consequently the entropy goes to zero. Similar calculation will apply for a particle in box also with $T \to 0$, then $E \to E_0$ and $S \to 0$, where $NE_0$ is the ground state energy. Thus the third law isn't violated in both cases. 
