# Energy and particle conservation in Maxwell-Boltzmann statistics

I was working with a derivation of Maxwell-Boltzmann statistics occupation probability today and I got this problem with the constraints:

We know that the particle number is conserved when we are increasing the value of $$N_i$$ by a little amount, so we write that, $$\sum_{i}^{N}\delta N_i=0$$ where $$N$$ is the total number of particles.

Also, since if the number of particles of a particular energy $$E_i$$ increases, then by energy conservation, that same energy change has to be accompanied by some other particles, in different quantum states. So, for that we write: $$\sum_{i}^{N}E_i \delta N_i=0$$ However, I am not being able to understand this last equation. For example- Suppose we have $$1000$$ particles with energy $$2 eV$$ and $$2000$$ particles with energy $$1 eV$$, the total energy of the system is $$4000\ eV$$. Now, assuming that $$1$$ and $$2$$ $$eV$$ are the only energies that can be possessed by the particles, let us decrease the number of particles in the state $$1 eV$$ by $$100$$. So now we have $$900$$ particles in the $$1 eV$$ state, and since the energy of the system has to be conserved, the number of particles increased in the state $$2 eV$$ is 50.

This is where I start facing problems. The last argument shows that the number of particles having energy $$2 eV$$ is now $$2050$$, which, if added to the other ones, gives $$2950$$ particles, whereas the total number, in the beginning, was $$3000$$.

What am I missing here?

Looking at your constraints, it seems like you're dealing with a micro-canonical ensemble description of statistical physics. The constraints you give have physical meaning. The first one $$\sum_i^N \delta N_i = 0$$ tells you that the number of particles in your system is fixed. The second one $$\sum_i^N \delta N_i = 0$$ tells you that the total energy of your system is conserved.
In you' re example you cannot satisfy the constraints, because particle conservation tells that $$\delta N_1 + \delta N_2 = 0,$$ while energy conservation implies that $$\delta N_1 + 2 \delta N_2 = 0.$$ They can' t be satisfied at the same time.