function simMC(M,A,P)
%simulate a MC for M steps with initial state A and tpm P
%  
X = zeros(1,M);
X(1) = A;
for m = 1:M-1
    X(m+1) = discrete(P(X(m),:));
end
plot(X,'.-b')