How to choose the microstates so that thermodynamical entropy coincides with statistical mechanics entropy? As turned out in this question, thermodynamical entropy (which does not depend on microstates) and statistical mechanics entropy (which depends on the choice of microstates) are two different things. Suppose that we have a system in canonical ensemble. How can we choose the microstates so that the thermodynamical entropy and SM entropy coincide?
For example, consider a gas where the microstates are combinations of positions and velocities of molecules. We can view a pair (position,velocity) as an element of $\mathbb R^4$, and then discretize $\mathbb R^4$ to obtain a grid. How large should the grid size/density be?
Update: The thermodynamical entropy is actually also not uniquely defined: we have $dS=\frac{dQ_{rev}}{T}$. Therefore, it is defined up to an additive constant. So in orther for the two entropies to coincide, one should choose both the additive constant for thermodynamical entropy and the number of microstates for SM entropy.
 A: First on the additive constant: it doesn't matter. Since, as you point out, classical thermodynamics defines $\Delta S$, not $S$, the classical entropy has an arbitrary constant attached to it. But it is always $\Delta S$ that we measure or care to calculate, the additive constant is irrelevant. The statistical entropy only needs to match the classical entropy when we take the difference between the same two states.
On the calculation of the statistical entropy – The short answer: By taking the microstate to be a volume element in momentum $\times$ space (phase space) and by assigning equal weight to all microstates with the same energy, volume and number of particles, we end up with a statistical entropy that behaves exactly the same as classical entropy. That's the beauty of statistical mechanics. No additional assumptions, discretizations or other such operations required.
On the calculation of the statistical entropy – The longer answer: We do not discretize the continuous phase space, we integrate over it. The easiest demonstration is in the canonical partition function:
$$
   Q = \frac{1}{h^{3N}N!} 
       \int e^{-\mathbf{p}^2/2mkT} d^N \mathbf{p} 
       \int  e^{-E_P/mkT} d^{N} \mathbf{r} 
$$
where $\mathbf{p}$ is the vector of all $(x,y,z)$ components of momentum of all particles and $\mathbf{r}$ is the vector of all positions. Here a volume element of phase space is represented by the product
$$
   d^N\mathbf{p}~ d^N\mathbf{r}
   =
   dr_{1x} dp_{1x} dr_{1y} dp_{1y} dr_{1z} dp_{1z} \cdots
$$
This is a true differential, which is to say that the size of the grid goes to zero. The momentum integral can be solved directly:
$$
   \frac{1}{h^{3N}} \int e^{-\mathbf{p}^2/2mkT} d^N \mathbf{p}
   = \left(\frac{2\pi m k T}{h^2}\right)^{3N/2}
$$
The integral over space cannot be solved for arbitrary potential energy but in the special case $E_P=0$ (no interactions) we obtain the simple result
$$
   \int  e^{-E_P/mkT} d^{N} \mathbf{r} = V^N
$$
Combining with the momentum integral we obtain the canonical partition of the ideal gas:
$$
   Q^\text{ig} = \frac{V^N}{N!}\left(\frac{2\pi m k T}{h^2}\right)^{3N/2}
\tag{1}
$$
Since the question was about entropy, in the canonical ensemble we calculate it as
$$
   \frac{S}{k} = \ln Q - \beta \left(\frac{\ln\partial Q}{\partial\beta}\right)
$$
Applying this to the partition function of the ideal gas we obtain the an entropy that matches the classical entropy of the ideal gas to within an additive constant. The result can be found in any standard textbook. The point of this lengthier answer was to address the question about how to discretize the phase space:  there is no discretization involved.
A: Actually, thermodynamic entropy depends on the definition of your system in some sense, just as the statistical entropy depends on the micro-states.
The classic example is Gibbs’ paradox. If you have two different gases in a container that are initially divided by a separation and you remove the separation to mix them, entropy increases. However if you did not know that they were different and you assume that they are the same gas, the entropy remains constant, on a macroscopic level nothing happened.
Thus, coarse graining your system changes its thermodynamic entropy, even physically nothing changed. Entropy is always relative to the limited knowledge of your system. The same is true with energy btw.
For your question on the gas, the grid size is irrelevant as it will only contribute to an additive constant to entropy. Only differences of entropy matter. So when you look for example at the difference of entropy when the volume is increased for example, it drops out. Note that the measure you use to measure the volume of phase space matters (the “gridlines”). From Hamiltonian mechanics, there is only one (up to multiplicative factor) natural candidate that is preserved by canonical transformations (induced by the natural symplectic structure), which is the measure you must be implicitly thinking about in canonical coordinates.
Hope this helps.
