In the Maxwell's demon thought experiment, initially, the gases in both boxes have the same temperature. The devil uses the door in the middle to allow the fast (hot) molecules on the left to pass to the right. But, we said the gases in both boxes have the same temperature. So, the right box is not completely hot. There exist still cold gas molecules on the right. But according to the thought experiment, the cold gas molecules are all collected on the left side of the chamber. Is this a contradiction in the paradox? How do slow molecules move as fast as other hot gas molecules?
[Physics] In Maxwell’s demon, why are all the cold gas molecules on the same side
entropystatistical mechanicsthermodynamics
Related Solutions
You can think of entropy as measuring the amount of phase space volume that the system could be occupying. (This is the set of all possible sets of positions and momenta for all the particles.)
It's correct that the set of possible momenta are unchanged, so that doesn't affect the entropy. But the set of possible positions is lower, because it becomes correlated with momentum -- the high-momentum particles can only be in half the volume as before. That's why the entropy decreases.
You also specifically asked how the entropy of side $B$ changes. This depends on how the system is set up. If you neglect particle interactions, then side $B$ ends up with only fast particles, while it began with both fast and slow particles. Since the available phase space is lower, the entropy of side $B$ decreases.
However, if you allow particle interactions, the particles in side $B$ will reach thermal equilibrium, and you'll get a distribution of velocities (i.e. some slow, some fast, and some very fast). Then the entropy of side $B$ increases.
The first way is more common in popular presentations since it's a bit cleaner, while the second is more realistic. But in both cases, the total entropy of $A$ and $B$ decreases, which is the key point.
The appropriate mathematical tool to understand this kind of question, and more particularly Dale's and buddy's answers, is large deviation theory. To quote wikipedia, "large deviations theory concerns itself with the exponential decline of the probability measures of certain kinds of extreme or tail events". In this context, "exponential decline" means: probability that decreases exponentially fast with the increase of number of particles.
TL;DR: it can be shown that the probability to observe an evolution path for a system that decreases entropy is non-zero, and it decreases exponentially fast with the number of particles; thanks to a statistical mechanics of "trajectories", based on large deviation theory.
Equilibrium statistics
In equilibrium statistical mechanics, working in the appropriate thermodynamical ensemble, for instance the microcanonical ensemble in this case, one could relate the probability to observe a macrostate $M_N$ for the $N$ particles in the system, to the entropy of the macrostate $S[M_N]$: $\mathbf{P}_{eq}\left(M_N\right)\propto\text{e}^{N\frac{\mathcal{S}[M_N]}{k_{B}}}.$ Naturally, the most probably observed macrostate, is the equilibrium state, the one which maximizes the entropy. And the probability to observe macrostates that are not the equilibrium state decreases exponentially fast as the number of particles goes to infinity, this is why we can see it as a large deviation result, in the large particle numbers limit.
Dynamical fluctuations
Using large deviation theory, we can extend this equilibrium point of view: based on the statistics of the macrostates, to a dynamical perspective based on the statistics of the trajectories. Let me explain.
In your case, you would expect to observe the macrostate of your system $(M_N(t))_{0\leq t\leq T}$, evolving on a time interval $[0,T]$ from an initial configuration $M_N(0)$ with entropy $S_0$ to a final configuration $M_N(T)$ with entropy $S_T$ such as $S_0 \leq S_T$, $S_T$ being the maximal entropy characterizing the equilibrium distribution, and the entropy of the macrostate at a time $t$, $S_t$ being a monotonous increasing function (H-Theorem for the kinetic theory of a dilute gas, for instance).
However, as long as the number of particles is finite (even if it is very large), it is possible to observe different evolutions, particularly if you wait for a very long time, assuming your system is ergodic for instance. By long, I mean large with respect to the number of particles. In particular, it has been recently established that one could formulate a dynamical large deviation result which characterizes the probability of any evolution path for the macrostate of the system (https://arxiv.org/abs/2002.10398). This result allows to evaluate for large but finite number of particles, the probability to observe any evolution path of the macrostate $(M_N(t))_{0\leq t\leq T}$, including evolution paths such as $S_t$, the entropy of the system a time $t$ is non monotonous. This probability will become exponentially small with the number of particles, and the most probable evolution, that increases entropy, will have an exponentially overwhelming probability as the number of particles goes to infinity.
Obviously, for a classical gas, N is very large, such evolution paths that do not increase entropy won't be observed: you would have to wait longer than the age of the universe to observe your system doing this. But one could imagine systems where we use statistical mechanics, where $N$ is large but not enough to "erase" dynamical fluctuations: biological systems, or astrophysical systems for instance, in which it is crucial to quantify fluctuations from the entropic fate.
Best Answer
Individual gas molecules are neither cold nor hot: They have kinetic energy.
The absolute temperature of a gas is proportional to the average of the kinetic energies of its molecules, and what's important here, is that the kinetic energies are not all the same. There is a statistical distribution of different energies in any given body of gas. Even so when the gas is all one "temperature."
https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_statistics