Fun fact: not only you get closer to a 50/50 mix of E1 and E2 (increasing temperature) but if you continue to add energy to the box you will find yourself with more atoms in the E2 state than in the E1 state.
The temperature will go from infinity to -infinity and as you keep adding energy you will approach zero temperature from the left (increasing temperature). The zero value is reached when the energy of the system can no longer be increased and all the atoms are in the E2 state.
How are you defining temperature? I assume it's not average kinetic energy of the particles. Is it that definition I learned once upon a time where T = d entropy /d energy? Is this a useful definition of temperature if it leads to this scenario?
Yes, this is in accordance with the definition of temperature as d entropy / d energy, which is the more generally-applicable definition. It's easy to see from this that temperature becomes negative if adding more energy into the system causes the entropy to decrease. In most systems that doesn't happen because there are always an increasing number of higher-energy states that open up, but in a very carefully constrained system, the added energy forces the system into a smaller number of excited states away from a higher-entropy ground state. A real-world example of this is a laser's population inversion.
A system at finite negative temperature is actually considered "hotter" than a normal system at any positive finite temperature; if you put them in thermal contact, heat will flow in the direction that increases entropy, which you get by taking energy out of the negative-temperature inverted system and adding it into the ordinary positive-temperature system. This increases the entropy of both systems.
The definition where temperature is the "average kinetic energy of the particles" is a special case, and it only really works when that energy is evenly distributed over all degrees of freedom. For example, you wouldn't consider an icy comet to be at a high temperature just because it's moving quickly, even though its particles have a great deal of kinetic energy on average!
The two-state system was the first example I learned in undergrad stat mech, and really helped me understand the first-principles definitions of entropy, temperature, etc. My parent comment was more for the casual HN reader, but if you really dig into the two state system, negative temperatures aren't all that weird.
The first thing to understand is microstates, which is just the number of ways a system can have a certain energy. Eg in a two-state system with ten particles and energies +/-(E/2), there's one microstate where the energy is -5E (all negative), ten states with -4E (one elevated), etc. Then entropy is just the log of the # of microstates, which is much easier to deal with, since microstates tend to behave exponentially. Eg entropy(E=-10) is log(1)=0, entropy(E=-9) is log(10), etc.
Then temperature like you said is d(entropy) / d(energy). Two systems with different temps brought into contact will exchange energy until the temps are equal, since this configuration maximizes entropy.
The two-state system can have negative temperatures since entropy starts decreasing with energy once more than half of them are in the higher-energy state. This can't happen in more familiar scenarios (eg ideal gas, blackbody, etc) since usually entropy always goes up with energy.
The temperature will go from infinity to -infinity and as you keep adding energy you will approach zero temperature from the left (increasing temperature). The zero value is reached when the energy of the system can no longer be increased and all the atoms are in the E2 state.