Monte Carlo simulation techniques use random numbers to examine problems that are difficult to solve analytically. A simple example is estimating pi by randomly scattering objects over an inscribed circle and square to calculate their area ratio. Markov chain Monte Carlo generates states according to their probability by using a transition probability satisfying detailed balance. The Metropolis algorithm implements this by accepting or rejecting new states based on a random number and the energy change between states. This allows generating configurations with their correct Boltzmann weight for problems like the Ising model of magnetism.