Markov Chains (Random Walks)

Markov Chains
A Markov matrix is a square matrix whose columns are numbers in [0,1] which sum to 1.
This is also known as a transition matrix, a stochastic matrix, or a migration matrix.
Examples
Markov matrix
A=1/31/31/301/43/4100
Not a Markov matrix
B=[−1201/2]
- First column: contains numbers that are not between 0 and 1.
- Second column: the sum of the entries is not 1.
Interpretation
The entries in a Markov matrix represent proportions or probabilities.
For example, entry aij of a migration matrix is the proportion of the population moving from location j to location i.
Example
Toloc 1loc 2Fromloc 1loc 2[1/43/410]
- 1/4 of the population in location 1 stays in location 1
- 3/4 of the population in location 1 moves to location 2
- All of the population in location 2 moves to location 1
- None of the population in location 2 stays in location 2
Markov Chain Equation
The state vector at time n is given by:
xn=x1n⋮xmn←amount at location 1 at time n←amount at location m at time n
If A is a Markov matrix, we can determine the next state vector by computing:
Steady State
If A is a Markov matrix, then there exists a steady state vector xs such that xs=Axs.
As n increases, the state vectors xn approach the steady state xs:
x0⟶Ax0x1⟶Ax1x2⟶…⟶Axn−1xn⟶…⟶Axsxs
Finding the Steady State Vector
xs can be found by solving:
(I−A)xs=0
We can solve this homogeneous equation using Gauss-Jordan elimination (just like with eigenvectors!)

Example: Markov Chains
Consider the migration matrix A=1/32/3001/21/21/201/2.
Suppose there are initially:
- 180 residents in location 1
- 180 residents in location 2
- 180 residents in location 3
Part A)
Find the population of each location after 1 and 2 units of time.
X1=AX0=1/32/3001/21/21/201/2180180180=150210180
Therefore, after one time period, location 1 has 150 residents, location 2 has 210 residents, and location 3 has 180 residents.
X2=AX1=1/32/3001/21/21/201/2150210180=140205195
Therefore, after two time periods, location 1 has 140 residents, location 2 has 205 residents, and location 3 has 195 residents.
Part B)
Find the population of each location after a very long time.
We must find a solution to (I−A)Xs=0, so we will reduce the augmented matrix:
R2+R1→R2R3+R2→R323R1→R12R2→R22/3−2/3001/2−1/2−1/201/2 2/30001/2−1/2−1/2−1/21/2 2/3000 1/20−1/2−1/20 100 010−3/4−10
Solving for when this system equals the zero vector, we obtain a general solution xs=t3/411.
Now we must find a value of t such that this vector has the same sum as x0 (and every state vector).
t(43+1+1)411tt=180+180+180=540=540=112160
Therefore, the population in the long run is:
xs=1121603/411=1620/112160/112160/11≈147196196