This question is inspired by Reif Problem 5.5. Note that it is not a homework problem and, even if it were, my question only loosely relates to it.
A vertical cylinder contains $N$ molecules of a monatomic ideal gas and is closed off at the top by a piston of mass $M$ and area $A$. The acceleration due to gravity is $g$. The heat capacities of the piston and cylinder are negligibly small, and any frictional forces between the piston and the cylinder walls can be neglected. The whole system is thermally insulated. Initially, the piston is clamped in position so that the gas has a volume $V$ and a temperature $T$. The piston is now released and after some oscillations, comes to rest in a final equilibrium situation corresponding to a larger volume of the gas. Does the entropy increase?
Now the answer, intuitively, is yes, since the system finds a new equilibrium precisely because that equilibrium is entropy-maximizing (has the most microstates).
But consider the following reasoning (and please tell me why it's wrong). While the particular process described is not quasi-static, we can imagine a corresponding quasistatic process which takes us to the prescribed final state. Since entropy is a function of state, the change in entropy will be precisely the same. Now for such a quasistatic process, we are now able to write that $dS=dQ/T=0$ because the system is thermally insulated. Thus we seem to conclude that there is no change in entropy.
I have two questions then. The first is about the aforementioned system, and the second is about "calculating with quasistatic processes" more generally.
(1) Was my reasoning flawed in that $dq\neq0$ in the imagined quasistatic process case? That is to say, is it the case that the imagined quasistatic process which takes us to our final equilibrium cannot have $dQ=0$ (i.e. there is no quasistatic, thermally insulated process with which we can reach our final state)? If so, how can I see this?
(2) In general, when am I allowed to calculate with quasistatic processes? Are there general guidelines for constructing valid quasistatic processes which take us to a desired final state?
Edit: after thinking a little more, I think it is fair to conclude that the gas itself gains no entropy (as evidenced by my argument), but that the universe itself does gain entropy (the entropy of the environment increases). This still begs the question though: if $Q=0$ here, and the environment is a heat reservoir so that $\Delta S = Q/T$ then the environment should also not gain entropy?