In 1872, Ludwig Boltzmann came up with an equation relating the entropy $$S$$ of a configuration to the amount of microstates that are compatible with the configuration. The relation is simple but of great importance: \[ S = k\ln(W) \] with $$W$$ is the amount of microstates, and $$\ln$$ is the natural logarithm. Only long after his death was he recognized as one of the pioneers of statistical physics. His equation is now carved onto his tombstone.

tombstone
Boltzmann's tombstone in Zentralfriedhof, Vienna.

Assignment

In this assignment, we calculate the entropy of a 2D configuration of blocks having dimensions $$2 \times 1$$ (like domino tiles). These blocks could form a simple physics model, e.g. for diatomic molecules. We impose the following simplifying assumptions and constraints:

If we now define the width of the 2-dimensional box as $$n$$ (and impose that it is even), we can calculate the amount of microstates (and thus the entropy, using $$S = k\ln(W)$$). One possible microstate for $$n = 12$$ is shown below.

microstate
One possible microstate for $$n = 12$$.

Your task:

Example

>>> microstates(2)
3
>>> microstates(8)
153
>>> microstates(12)
2131

>>> entropy(2)
1.0986122886681098
>>> entropy(8)
5.030437921392435
>>> entropy(12)
7.664346632098617