Is the total energy of a canonical ensemble system of $N$ particles, with single-particle energy levels given by $\epsilon_i$ fixed ?
We know the total energy of the system is given by : $$E=\sum_{i} n_i \epsilon_i$$
Here $n_i$ is the number of particles in the $\epsilon_i$ energy level.
However, we know the probability of a single particle having energy $\epsilon_j$ is given by :
$$P(\epsilon_j)=\frac{g_j e^{-\beta\epsilon_j}}{Z}$$
Here, $g_j$ is the degeneracy of that energy level, and $Z$ is the single particle partition function.
Moreover, we know that the probability of a single particle having energy $\epsilon_j$, is the total number of particles in that energy level, divided by the total number of particles - according to the definition of probability.
Hence, $$\frac{n_j}{N}=P(\epsilon_j)=\frac{g_j e^{-\beta\epsilon_j}}{Z}$$
This implies,
$$n_j=NP(\epsilon_j)=N\frac{g_j e^{-\beta\epsilon_j}}{Z}$$
Hence we can easily find $n_j$ for any $\epsilon_j$. So, if we know the number of particles in each of these energy levels, we can determine the exact total energy of the system $E$, in the first equation.
However, this seems problematic. If we find out the total energy of the system, and the number of particles in each energy level, we are restricting this entire system to one particular microstate. The probability of obtaining this particular microstate is $1$. The probability of obtaining any other microstate must be $0$.
However, shouldn't every possible microstate of the system have some finite probability i.e. every possible value of total energy have some finite probability?
I've asked a couple of related questions, and the amazing answers to those questions suggest that $n_j$ is not the actual number of particles in the $\epsilon_j$ level. Rather, it is the expected number of particles in that energy level. However, many answers over different websites and comments to one of my previous answers disagree and claim that $n_j$ is the exact actual number of particles in that level indeed.
Can anyone shed some light on this, and clear my doubt.