where r → → i are now randomly generated using the p ( r → → ) distribution. Since most of the times it is not easy to find a way of generating states with a given distribution, the Metropolis algorithm must be used.