Enrichment · STEM Explorations · Probability

Where does a chain of
chances end up?

A Markov chain moves between states by fixed chances: tomorrow depends only on today. Type the chance of leaving each of two states, where it starts and how many steps to take. The page works out the probability of each state after those steps and the long-run shares it settles to.

The markov chain transition simulator

The worked example is a weather chain starting sunny, with a 20 percent chance of rain after a sunny day and a 40 percent chance of sun after a rainy one. Nothing you type leaves this browser.

Loading the calculator. If nothing appears, turn on JavaScript.

What you get

Enrichment · STEM ExplorationsOpen to everyone · no sign-in

What you finish with
The probability of each state after any number of steps, the long-run shares, how fast the chain forgets its start and a table for other numbers of steps.
Who it is for
Students in probability, statistics and computer science, and families curious how a simple chain of chances behaves.
Format
Browser calculator for a phone, tablet or computer, by touch or keyboard. Prints a summary; downloads a spreadsheet (.csv); export and import a file.
Access
Open to everyone with the link: no account, no sign-in, nothing to buy and nothing to install. Everything you type stays in this browser; nothing is sent to Caveat.
Where it lives
The STEM Explorations space in Caveat Enrichment.
Support
Questions, a correction or a request: team@caveatacademic.com.

How to use it

  1. Name the chain.
  2. Type the chance of moving from A to B and from B to A, in percent.
  3. Type the chance of starting in A.
  4. Type the number of steps.
  5. Read the chances after those steps and the long-run shares, then try the table.

Run the chain

How the figures are worked out

A fixed fraction of the gap to the long-run share closes at each step.

The worked example: sunny and rainy daysLong run0.6670.4 ÷ 0.6Pull0.41 − 0.2 − 0.4Step 10.80from sunnyStep 50.670sunny chanceThe worked example: sunny and rainy daysLong run0.6670.4 ÷ 0.6Pull0.41 − 0.2 − 0.4Step 10.80from sunnyStep 50.670sunny chance
Each step pulls the chain toward its long-run shares by the same fraction.

Only today matters

In a Markov chain the next state depends only on the present one, not on how it got there. That is a simplification, but it is enough to model many things, from a day's weather to which page a reader visits next.

The long run forgets the start

For most chains the shares settle to a fixed pair of numbers whatever the starting state. How quickly depends on how often the chain switches: the closer the two chances add to one, the faster it settles.

Sources

  1. Grinstead, C. M., & Snell, J. L. Introduction to Probability, chapter 11, Markov chains. American Mathematical Society and Dartmouth. math.dartmouth.edu.
  2. Ross, S. M. Introduction to Probability Models: Markov chains and limiting probabilities.
  3. Wolfram MathWorld. Markov Chain. mathworld.wolfram.com.
  4. Norris, J. R. Markov Chains. Cambridge University Press: stationary distributions and convergence.

A model with fixed chances. It is a lesson, not a forecast. The worked example is made up. Your entries stay in this browser. Support: team@caveatacademic.com.

Written with AI, then checked before it is published. How we checkFound a mistake? Report it and we fix it, or refund you.Cancel anytime.