Consider a large number of $N$ localized particles in an external magnetic field $\mathbf{H}$. Each particle has spin $1 / 2$. Find the number of states accessible to the system as a function of $M_{8}$, the $z$-component of the total spin of the system. Determine the value of $M_{\mathrm{s}}$ for which the number of states is maximum.
The spin of a particle has two possible orientations $1 / 2$ and $-1 / 2$. Let the number of particles with spin $1 / 2$ whose direction is along $\mathbf{H}$ be $N_{\uparrow}$ and the number of particles with spin $-1 / 2$ whose direction is opposite to $\mathbf{H}$ be $N_{\downarrow}$; then the component of the total spin in the direction of $\mathbf{H}$ is $M_{\mathrm{s}}=\frac{1}{2}\left(N_{\uparrow}-N_{\downarrow}\right)$. By $N_{\uparrow}+N_{\downarrow}=N$, we can obtain $N_{\uparrow}=\frac{N}{2}+M_{\mathrm{s}}$ and $N_{\downarrow}=\frac{N}{2}-M_{\mathrm{s}}$. The number of states of the system is

$$
Q=\frac{N !}{N_{\uparrow} ! N_{\downarrow} !} \frac{N !}{\left[\frac{N}{2}+M_{\mathrm{s}}\right] !\left[\frac{N}{2}-M_{\mathrm{s}}\right] !}
$$

Using Stirling's formula, one obtains

$$
\begin{aligned}
\ln Q &=\ln \frac{N !}{N_{\uparrow} ! N_{\downarrow} !} \\
&=N \ln N-N_{\uparrow} \ln N_{\uparrow}-N_{\downarrow} \ln N_{\downarrow} \\
&=N \ln N-N_{\uparrow} \ln N_{\uparrow}-\left(N-N_{\uparrow}\right) \ln \left(N-N_{\uparrow}\right) .
\end{aligned}
$$

By

$$
\frac{\partial \ln Q}{\partial N_{\uparrow}}=-\ln N_{\uparrow}+\ln \left(N-N_{\uparrow}\right)=0,
$$

we get $N_{\uparrow}=\frac{N}{2}$, i.e., $M_{\mathrm{s}}=0$ when the number of states of the system is maximum.