Consider a (very long) one-dimensional chain of $N$ moleculs, which can be in either of the energy states $\alpha$ or $\beta$. The configurations have length $a$ or $b$ respectively.
Show that the entropy of the chain with respect to the length $L$ of the chain is $$S(L) = N\ln N - n_\alpha\ln n_\alpha - n_\beta\ln n_\beta$$ where $n_\alpha = (L-bN)/(a-b)$ is the number of molecules in state $\alpha$ and $n_\beta = (L-aN)/(b-a)$ is the number of molecules in state $\beta$. (Use Sterlings formula.)
I have been thinking about this exercise for a while now and I cannot combine the length of the chain and the number of microstates.
If we have $n_\alpha$ molecules in the state $\alpha$ and $n_\beta$ in state $\beta$ we have $$\Omega(n_\alpha, n_\beta,N ) = \frac{N!}{n_\alpha ! n_\beta!}$$ microstates. But I don't know how to get from this to an entropy that's depending on the length of the whole chain.
My guess is that I only have to substitute $n_\alpha$ and $n_\beta$ by the expressions given above, but I don't really understand why they count the number of molecules in state $\alpha$ and $\beta$ respectively. Perhaps someone can help me with this? Thanks!