octave> markov2(0.1,0.15,0.1) # aperiodic ans = 0.90000 0.15000 0.10000 0.85000

octave> markov2(0.9999,0.9,0.9999) ans = 1.0000e-04 9.0000e-01 9.9990e-01 1.0000e-01

octave> P=[0.0001,0.9999;0.9999,0.0001]; octave> [X,L]=eig(P); octave> X # eigenvectors X = 0.66900 -0.70711 0.74326 0.70711 octave> L # eigenvalues L = 1.00000 0.00000 0.00000 -0.89990 octave> X(:,1)/sum(X(:,1)) # make it a distribution ans = 0.47371 0.52629 octave> octave> markov2(1.0,1.0,0.0) # periodic ans = 0 1 1 0

octave> markov3(0.55,0.4,0.1,0.1,0.25,0.3,0.8,0.1); ans = 0.55000 0.40000 0.10000 0.10000 0.25000 0.30000 0.35000 0.35000 0.60000

octave> markov3(0.55,0.4,0.1,0.1,0.25,0.3,0.1,0.4); # same P, different x0 ans = 0.55000 0.40000 0.10000 0.10000 0.25000 0.30000 0.35000 0.35000 0.60000

octave> markov3(0.05,0.05,0.9,0.9,0.05,0.05,0.33,0.1); ans = 0.05000 0.05000 0.90000 0.90000 0.05000 0.05000 0.05000 0.90000 0.05000

octave> markov3(0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0); ans = 0 0 1 1 0 0 0 1 0