Two-State Markov Chain Calculator (Weather Model, Steady State)
The chance of being in each of two states after any number of steps, and the long-run share of time in each, from the two switching probabilities.
Results
The dashed line marks the value you entered.
What this tool does
A two-state Markov chain — sunny and rainy, working and broken, subscribed and cancelled — forgets its past: tomorrow depends only on today. The long-run split is q ÷ (p + q) whatever you start with, and the factor 1 − p − q says how fast the start is forgotten: the closer it is to 0, the sooner the chain settles. A negative factor means the chain tends to alternate. Real weather or customers rarely switch with constant probabilities, so treat the result as a model, not a forecast.
Formula
steady state: π_A = q ÷ (p + q) · after n steps: P_A(n) = π_A + (P_A(0) − π_A)(1 − p − q)ⁿ
Variables
| Symbol | Meaning | Unit |
|---|---|---|
p | Chance of going from state A to B in one step | % |
q | Chance of going from state B to A in one step | % |
n | Number of steps to look ahead | — |
s | Chance of starting in state A | % |
PA | Chance of being in state A after n steps | % |
PB | Chance of being in state B after n steps | % |
SA | Long-run share of time in state A | % |
SB | Long-run share of time in state B | % |
LA | Memory factor (1 − p − q) | — |
Worked example
- Chance of going from state A to B in one step20 %
- Chance of going from state B to A in one step40 %
- Number of steps to look ahead3
- Chance of starting in state A100 %
- Chance of being in state A after n steps68.80 %
- Chance of being in state B after n steps31.20 %
- Long-run share of time in state A66.67 %
- Long-run share of time in state B33.33 %
- Memory factor (1 − p − q)0.4000
Limitations
- The formula assumes ideal conditions: no friction losses, no air resistance and no efficiency losses unless you enter them.
- The result is an estimate based only on the values you type. Real situations often include factors this calculator does not know about.