Walker on a strip

46.2 μs

Assume the probability of the walker being on some x be denoted by an array called the state vector, denoted by |ψ

9.1 μs
16.5 ms

Further, every step basically shifts around the probability. Assume that the probability of a particle jumping left is pl, jumping right is pr, staying is pc=1prpc. Then, the probability of particle in x at t is

ρ(x,t)=ρ(x1,t1)pr+ρ(x+1,t1)pl+ρ(x,t1)pc

13.1 μs

Another way to look at this is to see influx and outflux.

Δρ(x,t)=ρ(x1,t1)pr+ρ(x+1,t1)plρ(x,t1)prρ(x,t1)pl

ρ(x,t)=Δρ(x,t)+ρ(x,t1)ρ(x,t)=ρ(x1,t1)pr+ρ(x+1,t1)plρ(x,t1)prρ(x,t1)pl+ρ(x,t1)=ρ(x1,t1)pr+ρ(x+1,t1)pl+(1prpl)ρ(x,t1)=ρ(x1,t1)pr+ρ(x+1,t1)pl+ρ(x,t1)pc

9.0 μs

Now this dynamics has a very important property. It is memoryless. It doesn't matter how we got there, but the previous step determines the next. Mathematically, this means,

Ms+t|ψ=(MtMs)|ψ

such maps are called Markovian maps and they can be represented as a single matrix operation on the state vector.

4.9 ms

Explicitly, the matrix is [pcpl..prpcpl..prpcpl]

8.1 μs
10.1 ms
M (generic function with 1 method)
72.6 μs
5×5 Tridiagonal{Float64, Vector{Float64}}:
 0.8  0.1   ⋅    ⋅    ⋅ 
 0.1  0.8  0.1   ⋅    ⋅ 
  ⋅   0.1  0.8  0.1   ⋅ 
  ⋅    ⋅   0.1  0.8  0.1
  ⋅    ⋅    ⋅   0.1  0.8
5.0 μs
5.7 s
18.5 s
3.3 s
3.5 s
6.2 s