Value of $\beta$ in Boltzmann statistics when degeneracy of quantum states is taken into account The relationship between entropy $S$, the total number of particles $N$, the total energy $U(\beta)$, the partition function $Z(\beta)$ and a yet to be defined constant $\beta$ is:
$$S(\beta)=k_BN \cdot \ln(Z(\beta)) - \beta k_B \cdot U(\beta)$$
Which leads to:
$$\frac{dS}{d\beta} = -k_B\beta \cdot \frac{dU}{d\beta}$$
And since $dS = \frac{dU}{T}$ this means that $\beta = -\frac{1}{k_BT}$ Source starting from sheet 40
However, this derivation does not take the degeneracy of quantum states into account. If it does then $S(\beta)$ would have an extra parameter in its formula. If the number of quantum states of an energy level is $g_j$, then I'd conclude:
$$S = k_BN \cdot \ln(Z(\beta)) - k_B\beta\cdot U(\beta) + k_B \cdot \sum^n_{j=1}\bigg[\ln(g_j)\cdot \frac{N}{Z(\beta)} \cdot e^{\beta E_j}\bigg]$$
Since $\ln(g_j) = \ln\big(\frac{N}{Z(\beta)}e^{\beta E_j}\big)- \beta E_j - \frac{N}{Z(\beta)}$, this would eventually give me:
$$\frac{dS}{d\beta} = k_B\cdot\left( - \beta\cdot\frac{dU}{d\beta} + \frac{U(\beta)\cdot N}{Z(\beta)} - U(\beta) \right)$$
Derivation. But using again $dS = \frac{dU}{T}$, this relationship does not give $\beta = -\frac{1}{k_BT}$. 
Is it permitted for $\beta$ to have a different value than $-\frac{1}{k_BT}$ when quantum states is taken into account or am I misunderstanding something here?
 A: I have figured it out. 
The way I included degeneracy was correct but I made some subtle mistakes during substitution of some parameters.
The formula for $\ln(\Omega)$ when degeneracy $g_j$ is taken into account is:
$$\ln(\Omega)= N \cdot \ln(N) - N - \sum^n_{j=1}[n_j \cdot \ln(n_j) - n_j] + \sum^n_{j=1} [\ln(g_j) \cdot n_j]$$
Substituting $n_j = g_j \cdot \frac{N}{Z} \cdot e^{\beta E_j}$ (I erroneously left out the $g_j$ during this substitution) along with rewriting, splitting the summations and simplifying eventually gives me:
$$\ln(\Omega) = N \cdot \ln(Z) - \beta U$$
Which is the exact equation as when degeneracy is not taken into account, and thus I get the same value for $\beta$ when taking the derivative of $S = k_B \cdot \ln(\Omega)$ and putting it next to the equation of entropy $dS = \frac{dU}{T}$.
Details Derivation
Formula for $\ln(\Omega)$ when taking degeneracy into account
$$\ln(\Omega)= N \cdot \ln(N) - N - \sum^n_{j=1}[n_j \cdot \ln(n_j) - n_j] + \sum^n_{j=1} [\ln(g_j) \cdot n_j]$$
According to Boltzmann Statistics $n_j = g_j \frac{N}{Z} e^{\beta E_j}$. Furthermore, $\ln(n_j) = \ln\big(g_j \frac{N}{Z}\big) + \beta E_j$. Substituting these parameters:
$$\ln(\Omega)= N \cdot \ln(N) - N - \sum^n_{j=1}\bigg[g_j \frac{N}{Z} e^{\beta E_j}\cdot \bigg(\ln\big(g_j \frac{N}{Z}\big) + \beta E_j\bigg) - g_j \frac{N}{Z} e^{\beta E_j}\bigg] + \sum^n_{j=1} \bigg[\ln(g_j) \cdot g_j \frac{N}{Z} e^{\beta E_j}\bigg]$$
Splitting the 1st summation into 3 summations between the + and – signs and removing the brackets that appear after splitting:
$$\ln(\Omega)= N \cdot \ln(N) - N - \sum^n_{j=1}\bigg[g_j \frac{N}{Z} e^{\beta E_j}\cdot \ln\big(g_j \frac{N}{Z}\big)\bigg] - \beta\sum^n_{j=1}\bigg[g_j \frac{N}{Z} e^{\beta E_j} \cdot E_j)\bigg] + \sum^n_{j=1}\bigg[g_j \frac{N}{Z} e^{\beta E_j}\bigg] + \sum^n_{j=1} \bigg[\ln(g_j) \cdot g_j \frac{N}{Z} e^{\beta E_j}\bigg]$$
The 2nd summation is equal to the total energy $U$, and the 3rd summation is equal to the total number of particles $N$ which cancels the $-N$ term.
$$\ln(\Omega)= N \cdot \ln(N) - \sum^n_{j=1}\bigg[g_j \frac{N}{Z} e^{\beta E_j}\cdot \ln\big(g_j \frac{N}{Z}\big)\bigg] - \beta U + \sum^n_{j=1} \bigg[\ln(g_j) \cdot g_j \frac{N}{Z} e^{\beta E_j}\bigg]$$
In the 1st summation term, substituting $\ln\bigg(g_j \frac{N}{Z}\bigg) = \ln(g_j) + \ln\big(\frac{N}{Z}\big)$ and then splitting that summation between the newly created + sign as well and removing the appearing brackets:
$$\ln(\Omega)= N \cdot \ln(N) - \sum^n_{j=1}\bigg[g_j \frac{N}{Z} e^{\beta E_j}\cdot \ln(g_j)\bigg] - \ln\big(\frac{N}{Z}\big) \sum^n_{j=1}\bigg[g_j \frac{N}{Z} e^{\beta E_j}\bigg] -\beta U + \sum^n_{j=1} \bigg[\ln(g_j) \cdot g_j \frac{N}{Z} e^{\beta E_j}\bigg]$$
The first and 3rd summations cancel each other out. The 2nd summation is equal to $N$, giving:
$$\ln(\Omega)= N \bigg(\ln(N) - \ln\big(\frac{N}{Z}\big)\bigg) - \beta U$$
Since, $\ln(N) - \ln\big(\frac{N}{Z}\big) = \ln(Z)$, this gives:
$$\ln(\Omega) = N\cdot \ln(Z) - \beta U$$
The $Z$ and $U$ are functions of $\beta$. Equation for entropy is $S = k_B \cdot \ln(\Omega)$. Thus deriving $\frac{dS}{d\beta}$:
$$\frac{dS}{d\beta} = k_B \bigg(\frac{N}{Z} \cdot \frac{dZ}{d\beta} - \bigg(U + \beta \frac{dU}{d\beta}\bigg)\bigg)$$
Since $\frac{dZ}{d\beta} = \frac{UZ}{N}$ this gives:
$$\frac{dS}{d\beta} = -k_B \cdot \beta \frac{dU}{d\beta}$$
Knowing that $dS = \frac{dU}{T}$ (when a fixed volume is assumed), this yields:
$$\beta = - \frac{1}{k_B T}$$
A: The usual way to make statistical mechanics is to first derive a probability distribution of the states, such as:
$$ p(j) = \frac{e^{-\beta E_j}}{Z} $$
where $j$ is the index of the state and $Z$ is the normalization. This is compatible with the presence of degeneracy: simply, two states $j$ and $j'$ have the same energy, $E_j=E_{j'}$.
Then, some macroscopical physical quantities are defined. For defining the first law of thermodynamics, we define $U=<E>$ (the average of $E$) and for the second we define $S$ according to the Shannon entropy. Expressed in terms of probabilities:
$$ U = \sum_j E_j p(j) $$
and
$$ S = -k \sum_j p_j \log p_j $$
Also these formulas are compatible with the presence of degeneracy, as before.
Now, we notice that the two sums can be expressed in terms of $Z$, or, better, in terms of $F=-1/\beta \log(Z)$. 
All this is done without any issue with degeneracy, simply by assuming that there can be two (or more) states with the same energy. Any expression obtained by making use of the degeneracy must give the same results.
