Home▸Probability & Statistics▸Markov Chain — Random Walker & Stationary Convergence (2D)

Markov Chain — Random Walker & Stationary Convergence (2D)

A 2D Markov chain simulator: drag states around a live transition graph, watch a single walker token hop between them by real cumulative-probability sampling, and see its empirical visit-frequency histogram converge to the theoretical stationary distribution computed by matrix power iteration.

Probability & Statistics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-markov-chain ↗ Open standalone

This is the 2D companion to the 3D Markov Chain — Transition Matrix Simulator. Instead of propagating the full probability vector through the transition matrix every frame, it runs one real random walker: each hop samples the next state from the current row of P by cumulative-probability sampling, the same Monte-Carlo mechanism used to actually simulate Markov chains and MCMC samplers. Drag the state nodes to rearrange the graph, edit the transition matrix directly, and watch the walker's empirical visit-frequency histogram — accumulated hop by hop — converge to the theoretical stationary distribution, computed independently by power-iterating the matrix to a fixed point.

⚙ Under the hood

A 2D companion to the 3D Markov Chain simulator: drag states around a live transition graph, watch a single walker token hop between them by real cumulative-probability sampling, and see its empirical visit-frequency histogram converge to the theoretical stationary distribution computed by matrix power iteration.

markov chaintransition matrixstationary distributionrandom walkmonte carlopower iterationstochastic process

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)