Monte Carlo simulations are used to generate random states of a system according to a statistical ensemble.