Suppose $N$ fair coin tosses. It is easy to represent this system in the micro-canonical ensemble as follows. There are 2^N possible results. Taking the entropy as the total number of micro state, we get
$S=N k_B \ln(2)$
$E=N k_B T \ln(2)$
and each bit contribute $k_B \ln(2)$ to the entropy.
I am trying to recover this results from the canonical ensemble, but it seems to fail. I try to obtain the partition function as follows: 1. Each bit (0 or 1) has the same energy level $E_0$. Hence the partition function is degenerate.
$Z=\sum_{i=0}^N{e^{-2\beta E_0}}=Ne^{-2\beta E_0}$
But when I take the energy using $\overline{E}=-\frac{\partial \ln{Z}}{\partial \beta}$
$\overline{E}=-\frac{1}{Ne^{-2\beta E_0}}(Ne^{-2\beta E_0})(-2 E_0)$
$\overline{E}=2E_0$
Why do I not recover the same results as the micro canonical case? Here, the average energy does not even depend on $T$.
Reverse engineering the process, to recover the micro canonical results, the partition function must be
$Z=\sum_{i=0}^N{e^{- E_0 \ln{\beta} \ln{2}}}$
then taking $\overline{E}=-\frac{\partial \ln{Z}}{\partial \beta}$ will give $\overline{E}=Nk_BT\ln{2}$. But a partition function with $\ln{\beta}$ instead of $\beta$ as a conjugate variable is hardly legit.
What am I doing wrong?