function W =  fixedVector(P)
% finds a fixed vector for the transition matrix P for a REGULAR chain

P = transpose(P); % take the transpose, for linear algebra reasons
[V,~] = eig(P); % find the eigenvectors of the transpose
W = V(:,1)/sum(V(:,1));
% take the eigenvector corresponding to 1, and normalize it to sum to 1
% (since it has to be a probability vector) 

end