We present an intuitive, conceptual, and semi-rigorous introduction to the Markov Chain Monte Carlo method using a simple model of population dynamics and focusing on a few elementary distributions. We start from two states, then three states, and finally generalize to many states with both discrete and continuous distributions. Despite the mathematical simplicity, our examples include the essential concepts of the Markov Chain Monte Carlo method, including ergodicity, global balance and detailed balance, proposal or selection probability, acceptance probability, the underlying stochastic matrix, and error analysis. Our experience suggests that most senior undergraduate students in physics can follow these materials without much difficulty.

1.
K.
Binder
and
D. W.
Heermann
,
Monte Carlo Simulation in Statistical Physics: An Introduction
, 5th ed. (
Springer Berlin
,
Heidelberg
,
2010
).
2.
M.
Weigel
,
L.
Barash
,
L.
Shchur
, and
W.
Janke
, “
Understanding population annealing Monte Carlo simulations
,”
Phys. Rev. E
103
,
053301
(
2021
).
3.
S.
Kirkpatrick
,
C. D.
Gelatt
, and
M. P.
Vecchi
, “
Optimization by simulated annealing
,”
Science
220
,
671
680
(
1983
).
4.
W.
Wang
,
J.
Machta
, and
H. G.
Katzgraber
, “
Comparing Monte Carlo methods for finding ground states of Ising spin glasses: Population annealing, simulated annealing, and parallel tempering
,”
Phys. Rev. E
92
,
013303
(
2015
).
5.
R. J.
Glauber
, “
Time-dependent statistics of the Ising model
,”
J. Math. Phys.
4
,
294
307
(
1963
).
6.
T. A.
Witten
and
L. M.
Sander
, “
Diffusion-limited aggregation, a kinetic critical phenomenon
,”
Phys. Rev. Lett.
47
,
1400
1403
(
1981
).
7.
W.
Wang
,
R.
Díaz-Méndez
,
M.
Wallin
,
J.
Lidmar
, and
E.
Babaev
, “
Melting of a two-dimensional monodisperse cluster crystal to a cluster liquid
,”
Phys. Rev. E
99
,
042140
(
2019
).
8.
W. L.
Jorgensen
and
J.
Tirado-Rives
, “
Monte Carlo vs molecular dynamics for conformational sampling
,”
J. Phys. Chem.
100
,
14508
14513
(
1996
).
9.
W. L.
Miller
and
A.
Cacciuto
, “
Two-dimensional packing of soft particles and the soft generalized Thomson problem
,”
Soft Matter
7
,
7552
7559
(
2011
).
10.
C.
Jacoboni
and
L.
Reggiani
, “
The Monte Carlo method for the solution of charge transport in semiconductors with applications to covalent materials
,”
Rev. Mod. Phys.
55
,
645
705
(
1983
).
11.
M. V.
Fischetti
and
S. E.
Laux
, “
Monte Carlo analysis of electron transport in small semiconductor devices including band-structure and space-charge effects
,”
Phys. Rev. B
38
,
9721
9745
(
1988
).
12.
D. P.
Adorno
,
N.
Pizzolato
, and
C.
Fazio
, “
Elucidating the electron transport in semiconductors via Monte Carlo simulations: An inquiry-driven learning path for engineering undergraduates
,”
Eur. J. Phys.
36
,
055017
(
2015
).
13.
D.
Guo
,
X.
Wang
, and
R.
Chen
, “
New sequential Monte Carlo methods for nonlinear dynamic systems
,”
Stat. Comput.
15
,
135
147
(
2005
).
14.
B.
Shah
,
J.
Borwanker
, and
D.
Ramkrishna
, “
Monte Carlo simulation of microbial population growth
,”
Math. Biosci.
31
,
1
23
(
1976
).
15.
N.
Metropolis
and
S.
Ulam
, “
The Monte Carlo method
,”
J. Am. Stat. Assoc.
44
,
335
341
(
1949
).
16.
N.
Metropolis
,
A. W.
Rosenbluth
,
M. N.
Rosenbluth
,
A. H.
Teller
, and
E.
Teller
, “
Equation of state calculations by fast computing machines
,”
J. Chem. Phys.
21
,
1087
1092
(
1953
).
17.
K.
Hukushima
and
K.
Nemoto
, “
Exchange Monte Carlo method and application to spin glass simulations
,”
J. Phys. Soc. Jpn.
65
,
1604
1608
(
1996
).
18.
K.
Hukushima
and
Y.
Iba
, “
Population annealing and its application to a spin glass
,” in
The Monte Carlo Method in the Physical Sciences: Celebrating the 50th Anniversary of the Metropolis Algorithm
, edited by
J. E.
Gubernatis
(
AIP
,
2003
), Vol.
690
, pp.
200
206
.
19.
J.
Machta
, “
Population annealing with weighted averages: A Monte Carlo method for rough free-energy landscapes
,”
Phys. Rev. E
82
,
026704
(
2010
).
20.
W.
Wang
,
J.
Machta
, and
H. G.
Katzgraber
, “
Population annealing: Theory and application in spin glasses
,”
Phys. Rev. E
92
,
063307
(
2015
).
21.
L. Y.
Barash
,
M.
Weigel
,
M.
Borovský
,
W.
Janke
, and
L. N.
Shchur
, “
GPU accelerated population annealing algorithm
,”
Comput. Phys. Commun.
220
,
341
350
(
2017
).
22.
A.
Klein
and
A.
Godunov
,
Introductory Computational Physics
(
Cambridge U. P
.,
Cambridge
,
2006
).
23.
M.
Newman
,
Computational Physics
(
Createspace
,
North Charleston, SC
,
2013
).
24.
H.
Gould
and
J.
Tobochnik
,
Statistical and Thermal Physics with Computer Applications
(
Princeton U. P
.,
Princeton, NJ
,
2021
).
25.
J.
Tobochnik
and
H.
Gould
, “
Teaching statistical physics by thinking about models and algorithms
,”
Am. J. Phys.
76
,
353
359
(
2008
).
26.
J.-C.
Walter
and
G.
Barkema
, “
An introduction to Monte Carlo methods
,”
Physica A
418
,
78
87
(
2015
).
27.
M. E. J.
Newman
and
G. T.
Barkema
,
Monte Carlo Methods in Statistical Physics
(
Oxford U. P
.,
New York
,
1999
).
28.
See <http://mcwa.csi.cuny.edu/umass/index.html> for “an advanced introduction to the Monte Carlo method.”
29.
J. S.
Liu
,
Monte Carlo Strategies in Scientific Computing
, Springer Series in Statistics (
Springer
,
New York, NY
,
2004
).
30.
R.
Shonkwiler
and
F.
Mendivil
,
Explorations in Monte Carlo Methods
(
Springer
,
New York
,
2009
).
31.
D. P.
Landau
and
R.
Alben
, “
Monte Carlo calculations as an aid in teaching statistical mechanics
,”
Am. J. Phys.
41
,
394
400
(
1973
).
32.
A. R.
Denton
and
M. P.
Schmidt
, “
Exploring fluctuations and phase equilibria in fluid mixtures via Monte Carlo simulation
,”
Eur. J. Phys.
34
,
475
487
(
2013
).
33.
E.
Ising
, “
Beitrag zur theorie des ferromagnetismus
,”
Z. Phys.
31
,
253
258
(
1925
).
34.
S. G.
Brush
, “
History of the Lenz-Ising model
,”
Rev. Mod. Phys.
39
,
883
893
(
1967
).
35.
D.
van Ravenzwaaij
,
P.
Cassey
, and
S.
Brown
, “
A simple introduction to Markov chain Monte-Carlo sampling
,”
Psychon. Bull. Rev.
25
,
143
154
(
2018
).
36.
G.
Casella
and
R. L.
Berger
,
Statistical Inference
2nd ed. (
Duxbury Press, Pacific Grove
,
CA
,
2002
).
37.
M.
Vucelja
, “
Lifting-A nonreversible Markov chain Monte Carlo algorithm
,”
Am. J. Phys.
84
,
958
968
(
2016
).
38.
C. D.
Meyer
,
Matrix Analysis and Applied Linear Algebra
(
SIAM
,
Philadelphia
,
2000
).
39.
W.
Wang
,
H.
Meier
,
J.
Lidmar
, and
M.
Wallin
, “
Three-dimensional universality class of the Ising model with power-law correlated critical disorder
,”
Phys. Rev. B
100
,
144204
(
2019
).
40.
U.
Wolff
, “
Collective Monte Carlo updating for spin systems
,”
Phys. Rev. Lett.
62
,
361
364
(
1989
).
41.
J.
Houdayer
, “
A cluster Monte Carlo algorithm for 2-dimensional spin glasses
,”
Eur. Phys. J. B
22
,
479
484
(
2001
).
42.
W. L.
McMillan
, “
Ground state of liquid
He4,”
Phys. Rev.
138
,
A442
A451
(
1965
).
43.
J. B.
Anderson
, “
A random-walk simulation of the Schrödinger equation:
H3+,”
J. Chem. Phys.
63
,
1499
1503
(
1975
).
44.
S.
Mittal
,
M. J. E.
Westbroek
,
P. R.
King
, and
D. D.
Vvedensky
, “
Path integral Monte Carlo method for the quantum anharmonic oscillator
,”
Eur. J. Phys.
41
,
055401
(
2020
).
AAPT members receive access to the American Journal of Physics and The Physics Teacher as a member benefit. To learn more about this member benefit and becoming an AAPT member, visit the Joining AAPT page.