So, the procedure to obtain a mean value of a given variable, using metropolis algorithm, with the canonical distribution, is to use the Metropolis algorithm to generate states given by the distribution p ( r → → ) and perform means over A r → → ∗ ∗ .