Basic Concepts
A Markov chain consists of a set of states (e.g., ‘hot’, ‘cold’) and transitions between those states. Each transition has an associated probability, representing the likelihood of moving from one state to another.
The key principle is that the probability of transitioning to any particular state in the next time step depends *only* on the current state. This is known as the Markov property or ‘memorylessness’.
P(Xt+1 = x | Xt = y) = P(Xt+1 = x | Xt = y)
Transition Matrix
The state transitions are often represented by a transition matrix, denoted as *P*. Each element Pij represents the probability of transitioning from state *i* to state *j* in one time step.
For a finite Markov chain with *n* states, the transition matrix will be an *n x n* matrix where each row sums to 1. This reflects that the system must transition to some state.
P = [[p11, p12, ..., p1n], [p21, p22, ..., p2n], ... , [pn1, pn2, ..., pnn]]
Calculating Probabilities
The probability of transitioning from a starting state to a particular final state after *t* steps can be calculated by multiplying the corresponding elements in the transition matrix *t* times.
For example, if you start in state 1 and want to know the probability of being in state 3 after 2 steps, you would calculate P21,3.
P(Xt = x) = (P * P * ... * P)t (repeated t times)
Applications
Markov chains are used in a wide range of applications, including weather forecasting, stock market analysis, and DNA sequencing. They model systems where the next state depends only on the current state.
In simulation, they allow us to represent complex dynamic systems with relative simplicity by focusing on transitions between discrete states.
Frequently asked questions
What is a 'state' in a Markov chain?
A state represents a specific condition or situation within the system being modeled. For example, in weather forecasting, states could be ‘sunny’, ‘rainy’, or ‘cloudy’.
Why is the ‘memoryless’ property important?
It simplifies calculations dramatically because we don't need to track a history of previous states; only the current state matters for predicting the next one.
Can Markov chains handle continuous time?
While traditionally used in discrete-time models, Markov chain techniques can be adapted for continuous time problems using concepts like diffusion and stochastic differential equations.
Try it live
Everything above runs in your browser — open SPH Fluid and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open SPH Fluid simulation