A comparison of two Monte Carlo methods for computations in statistical mechanics