Suppose that we have two containers containing an ideal gas and both have energy $E_1 = E_2 = E$, $V_1 = V_2 = V$ and $n_1 = n_2 = n$ which implies that they also have the same temperature (assuming that both contain the same kind of gas particles, e.g. diatomic).
The entropy of the combined system is:
$$ S = \ln(\Omega(E)) \quad \text{where} \ \ \Omega(E) =\Omega_1(E_1) \cdot \Omega_2(E_2)$$
We now place the containers in thermal contact (only heat can be exchanged) and since no macroscopic change takes place (systems have same temperatures) we are in equilibrium, which in turn means that according to the second law of thermodynamics:
$$\Delta S = S' -S=0$$
But the final entropy is:
$$ S' =\ln\left(\sum_{\epsilon=0}^{2E} \Omega_1(2E-\epsilon) \cdot \Omega_2(\epsilon)\right)$$
which is greater than $S$ in contrast with the second law of thermodynamics.
Should be the second law be better written as:
$$\Delta \langle S \rangle \geq 0$$
?