Silicon Logic
SL · /markov · 26.05
§ 12 · Instrument Filed 2026.05 · Reference SL · 26 · 012

A graph of futures, weighted by chance.

Click empty space to add a state. Drag from one state to another to draw a transition. Press play — a token random-walks across your graph at the pace you set. The bars beside each state count visits; given enough time they settle into the chain's stationary distribution, which is why this little toy quietly underpins PageRank, language models, queueing theory, and most of statistical mechanics.

Click empty space to add a state · Drag node→node to add a transition · Click node to edit Empty canvas
Token Observed visits Stationary (computed)
States 0 Edges 0 Steps 0 Current
Speed
4.0/s
Run
Counters
Graph

Selected state · stationary distribution

§ 02 · Live readout
Click a node to edit it — outgoing transitions auto-normalize —
No state selected. Click any node on the canvas, or click empty canvas to create one.
Distribution observed · stationary
Empty chain. Add a few states to see the bars fill in.

Why a graph of dice rolls explains so much

§ 03 · Notes
A
A Markov chain is a process whose next state depends only on the current one — the past beyond now is forgotten. The graph is the whole specification.
B
Outgoing edges from a node must sum to one — they are probabilities. This page normalises them for you whenever you edit a weight or delete an edge.
C
Let it run. The fraction of time the token has spent in each state converges to the chain's stationary distribution π. For most graphs you build, the bars line up within a few thousand steps.
D
PageRank is exactly this — pages are nodes, links are edges, with a small probability of teleporting at random. Google sorted the early web by computing π once.
E
A chain is ergodic when every state can reach every other and there are no traps or pure oscillations. Only then does π exist and not depend on where the token started.
F
Self-loops are fine. To draw one, drag a tiny circle from a node back onto itself. Rain that often stays rain is just an edge that points home.
Implementation notes — sampling, normalisation, computing π

Each state stores an array of outgoing edges with raw weights. To sample a transition the simulator scales weights by their sum, draws a uniform random number, and walks the cumulative table — O(out-degree) per step. Weights are kept un-normalised internally so editing one slider doesn't irreversibly redistribute the others; the displayed percentages are always weight ÷ sum.

The stationary distribution is computed by power iteration: start with π uniform, then repeat π ← πP for a few hundred steps. For ergodic chains this converges to the dominant left eigenvector of P with eigenvalue 1. Disconnected components or pure cycles can produce no unique stationary — the readout in that case will simply not converge to the observed fractions, which is itself instructive.

Edge geometry is a cubic Bézier whose control points are offset perpendicular to the chord, so opposite-direction edges curve in opposite hemispheres and never overlap. Self-loops are a small circle anchored above the node. The token's position interpolates along the edge during each step, so faster speeds visibly trace the path it took.

Everything is one HTML file. Save it, open it offline, edit the presets at the bottom of the script — they are just arrays of {x,y,name} and adjacency dictionaries.