Calculator
Enter a stochastic transition matrix, choose a focus state, and estimate periodicity using return-step lengths from successive matrix powers.
Example Data Table
This sample uses a deterministic 3-state cycle. Each state returns only at multiples of 3, so every state has period 3.
| State | Transition Row | Observed Return Steps up to 12 | Estimated Period |
|---|---|---|---|
| S1 | [0, 1, 0] | 3, 6, 9, 12 | 3 |
| S2 | [0, 0, 1] | 3, 6, 9, 12 | 3 |
| S3 | [1, 0, 0] | 3, 6, 9, 12 | 3 |
Formula Used
State period: d(i) = gcd{ n ≥ 1 : (Pn)ii > 0 }
Meaning: The period of state i is the greatest common divisor of all step counts n for which the chain can return to state i with positive probability.
Practical rule: This calculator powers the transition matrix from step 1 through your chosen maximum, reads each diagonal term, collects valid return steps, and takes their gcd.
How to Use This Calculator
- Choose the number of states in your Markov chain.
- Enter the transition probabilities for every row.
- Make sure each row sums to exactly 1.
- Select a focus state for the graph and summary.
- Set the maximum number of power steps to inspect.
- Adjust the return tolerance when tiny rounding values appear.
- Click Analyze Periodicity to generate the report above the form.
- Use the CSV and PDF buttons to export the generated analysis.
FAQs
1. What does periodicity mean in a Markov chain?
Periodicity measures the greatest common divisor of all return-step lengths for a state. If returns happen only every 2, 4, 6 steps, the period is 2.
2. What does an aperiodic state mean?
A state is aperiodic when its period equals 1. That means returns can occur at step lengths whose greatest common divisor becomes 1.
3. Do all states always have the same period?
Not always. States inside the same communicating class share the same period, but different classes can have different periods.
4. Why must every row sum to 1?
A row must sum to 1 because it represents a complete probability distribution over the next possible states from the current state.
5. Can self-loops affect periodicity?
Positive diagonal values often create step-1 returns, which immediately force the period toward 1, making a state aperiodic in many cases.
6. How many power steps should I test?
Increase max steps when return paths are long or sparse. Larger limits improve detection, but they also increase computation time.
7. Is this result exact for every matrix?
This tool estimates periodicity from matrix powers up to your chosen limit. If no return appears, the true period may need more steps.
8. Where is this analysis useful?
Yes. Cyclic queues, genetics models, board games, and communication systems often use discrete-state transitions where periodicity matters.