A statistical technique for sampling probability distributions to estimate model parameters.Markov chain Monte Carlo (MCMC) is a computational technique for exploring probability distributions that are too complex to analyze directly. Instead of calculating the distribution exactly, it generates a sequence of random samples that, after enough steps, approximate the distribution. This is invaluable in physics and statistics when estimating parameters of a model from data, such as the cosmological parameters of the universe from observations of the cosmic microwave background.
The technique was developed in the 1940s by physicists at Los Alamos, including Stanislaw Ulam and Nicholas Metropolis, for nuclear weapons research, and later generalized by W.K. Hastings in 1970.
The method combines two ideas: a Markov chain, where each step depends only on the current state, and Monte Carlo sampling, which uses randomness. Starting from an initial guess, the algorithm proposes a new state, then accepts or rejects it based on a rule that ensures the chain converges to the target distribution. Over many iterations, the visited states form a representative sample, from which averages and uncertainties can be computed.
MCMC is used in cosmology to fit models of the universe to data, in particle physics to extract signal from background, and in machine learning for Bayesian inference.
The name 'Monte Carlo' was coined by Ulam, referencing his uncle's gambling habits in the Monte Carlo Casino, because the method relies on random numbers like a roulette wheel.









