Walker on a strip
Assume the probability of the walker being on some x be denoted by an array called the state vector, denoted by 
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
xxxxxxxxxx1
1
ψ = zeros(Float64, 100); ψ[50] = 1; ψFurther, every step basically shifts around the probability. Assume that the probability of a particle jumping left is 
Another way to look at this is to see influx and outflux.
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,
such maps are called Markovian maps and they can be represented as a single matrix operation on the state vector.
Explicitly, the matrix is  
xxxxxxxxxx1
1
using LinearAlgebraM (generic function with 1 method)xxxxxxxxxx1
1
M(pl, pr, n) = Tridiagonal(fill(pr, n-1), fill(1-pr-pl, n), fill(pl, n-1))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.8xxxxxxxxxx1
1
M(0.1, 0.1, 5)xxxxxxxxxx1
1
using Plotsxxxxxxxxxx8
1
let2
    ψ = zeros(Float64, 100); ψ[50] = 1; ψ3
    m = M(0.1, 0.1, 100)4
     for i in 1:1005
        ψ .= m*ψ6
        plot(-50:49, ψ, ylims=(0,1))7
    end8
endx
12
1
let2
    ψ = zeros(Float64, 99); ψ[50] = 100; ψ3
    m = M(0.3, 0.3, 99)4
    q = plot([0], [100], ylims=(0,120))5
    a =  for i in 1:506
        ψ .= round.(m*ψ)7
        p=plot(-49:49, ψ, ylims=(0,50))8
        push!(q[1][1], sum(ψ))9
        plot(p,q, layout=(2,1))10
    end11
    gif(a)12
endx
1
let2
    ψ = zeros(Float64, 99); ψ[50] = 100; ψ3
    m = M(0.1, 0.1, 99)4
    q = plot([0], [100], ylims=(0,120))5
    a =  for i in 1:506
        ψ .= round.(m*ψ)7
        p=plot(-49:49, ψ, ylims=(0,50))8
        push!(q[1][1], sum(ψ))9
        plot(p,q, layout=(2,1))10
    end11
    gif(a)12
endx
1
let2
    ψ = zeros(Float64, 99); ψ[[46,54]] .= 75; ψ3
    m = M(0.3, 0.3, 99)4
    q = plot([0], [150], ylims=(0,170))5
    a =  for i in 1:1006
        ψ .= round.(m*ψ)7
        p=plot(-49:49, ψ, ylims=(0,50))8
        push!(q[1][1], sum(ψ))9
        plot(p,q, layout=(2,1))10
    end11
    gif(a)12
end