The question is about this paper. A "demon" will have certain energies, where these energies follow the Boltzmann distribution:
$$P(s) = \frac{1}{Z}\exp(-\beta E_s)$$
Where $\beta$ is the inverse temperature (the quantity of interest) and $Z$ is the normalization factor:
$$ Z = \sum_s \exp(-\beta E_s) $$
The writer of the article, Creutz, argues that given the expectation value of the energy, one can find the value of $\beta$:
$$ \beta = \frac{1}{4} \log(1 + \frac{4}{<E>}) \tag{1}$$
Above holds only when $E_s \in \{0, 4, 8\}$
Or, in the case of a continuous spectrum of E:
$$\beta = \frac{1}{<E>} \tag{2}$$
I have absolutely no idea how to find relation (1). If I try to invert the equation for $<E>$:
$$<E> = \sum_s E_s P(s)$$
I find that I have to invert a relation of many exponentials, where I cannot find a closed form of the expression. I have found relation (2), which I have included in the question.
Question
How do I derive the above relation (1)?
Attempts
For case (1):
$$<E> = \sum_s E_s P(s) = \frac{\sum_s E_s\exp(\beta E_s)}{\sum_s \exp(-\beta E_s)} $$
Apparently, (1) is a solution of above equation. The solution looks like a sum of exponentials (let's assume that there are only two energies available, where $E \in \{0,1\}$):
$$<E> = \frac{0*\exp(0) + \exp(-\beta)}{\exp(0) + \exp(-\beta)} = \frac{\exp(-\beta)}{1+\exp(-\beta)}$$
Let's attempt to invert above relation:
$$<E>(1+\exp(-\beta)) = \exp(-\beta)$$
$$\log(<E> + \exp(-\beta)) = -\beta$$
That's not a closed form solution.
For case (2)
Atleast we can now use integrals instead of sums.
$$<E> = \frac{1}{Z}\int_0^\infty E_s \exp(-\beta E_s) dE_s$$
The integral can be solved via integration by parts to yield:
$$ <E> = \frac{1}{Z}\frac{1}{\beta^2} \tag{3}$$
To find Z:
$$1 = \int_0^\infty \frac{1}{Z} P(s) ds = \frac{1}{\beta Z} \rightarrow Z = \frac{1}{\beta}$$
Plugging that back in (3):
$$ <E> = \frac{1}{\beta}$$
Finds the relation as shown in the paper.