Will inserting a partition into a thermally insulated box of ideal gas decrease the entropy? Will inserting a partition into a thermally insulated box of ideal gas decrease the entropy? In the textbooks, they always say that the removal of a partition will increase the entropy, but what if inserting a partition into a thermally insulated box of ideal gas? I think the addtional constraints will decrease the accessible states. And if the energy increase through the insertion process which leads to the increase of acessible states cannot counterbalance the effect of additional constraints, then the entropy will decrease. Am I wrong?
In Frederick Reif's Fundamentals of Statistical and Thermal Physics, it is said that a removal of constraints can only result in increasing, or possibly leaving unchanged, the number of states accessible to the system. But what if constraints are added to the system? I think when additional contraints are added, the total number of accessible states decrease so the entropy will decrease. Am I wrong?
 A: Removal of a partition will increase the entropy  in the case the two subvolumes are not containing the same substance and/or two temperatures and pressures are not the same. In such a case the system, just after removal of the partition, is not at equilibrium and the irreversible transition to a new equilibrium state of the globally isolated system is accompanied by an increasing of entropy. 
In the different case of a reversible insertion or removal of the partition there is no entropy change. Insertion is always reversible, provided it is is done in a quasi-static way and in absence of significant dissipation (friction).
Notice that this last statement only depends on the extensiveness of entropy:
$$
S(2U,2V,2N)=2S(U,V,N).
$$
The previous conclusions can also be derived from statistical mechanics, after taking the proper thermodynamic limit.  
A: In the thermodynamic limit, the surface effects are being neglected compared to the bulk. And since any exchange through any (mental) partitioning of the system can only happen via the surface, this is neglected for systems in equilibrium. So whether there is a physical partition or a mental one doesn’t matter for systems in equilibrium in the thermodynamic limit. So entropy shouldn’t change with partitioning. And since we can define entropy only for systems in equilibrium, this should always hold. 
Entropy only decreases when the number of accessible states (that give the correct macroscopic values) decrease. Thus we must find a way to decrease the number of states by partitioning. From our reasoning in the previous paragraph, if we manage to somehow partition the system into constituents such that we freeze some of the energy states such that sum of the energy of individual constituents is less than the total initial energy, we will get a decrease in entropy. This means that we have gone to a partitioning where there the surface effects would have no longer been negligible. But doing so is equivalent to considering the thermodynamic limit of the earlier subsystems at a lower temperature. 
A: @GeorgioP has provided an excellent answer. 
I would only add, as a reminder, that entropy is an extensive (mass dependent) property of a system. Considering the entire contents of thermally insulated as the system, there is no change in the total entropy of the system under the conditions described by @GeorgioP due to insertion or removal of a partition. But lets say the partition divides the contents in half. Each half would then have half the total entropy of the box. The specific entropy (entropy per unit mass), would be the same in both halves.
Hope this helps.
A: Something I am stuggling with is if the entropy decreases upon insertion of a partition of the box, how do we justify the second law which says entropy [of the universe] stays constant or increases? Where did the entropy go to? Presumably it got tossed outside of the box, but I am unsure how to argue this and I don't get how what assumptions we've made would affect such an argument.
