Solution (source code)

= Solution

Several <microstates> can have the same extension. If $g(l)$ denotes their <state degeneracy>, grouping equal terms in the state sum gives
$$
Z=\sum_i e^{\tau l_i}
=\boxed{\sum_l g(l)e^{\tau l}}.
$$
For the <one-dimensional freely jointed chain>, a <macrostate> with $n_+$ positive links and $n_-=n-n_+$ negative links has
$$
l=(n_+-n_-)a,
\qquad
g(l)=\frac{n!}{n_+!n_-!}.
$$
Hence
$$
Z=\sum_{n_+=0}^n
\frac{n!}{n_+!n_-!}
(e^{\tau a})^{n_+}(e^{-\tau a})^{n_-}.
$$
The <binomial theorem> now gives the <fixed-tension partition function of a one-dimensional chain>
$$
\boxed{Z=(e^{\tau a}+e^{-\tau a})^n
=(2\cosh(\tau a))^n.}
$$