function [P,pv]=creap(n)
% Input: dimensione n
% Output: P e' tridiagonale stocastica, pv e' il probability vector
P=0.1*diag(ones(n-1,1),1)+0.8*diag(ones(n-1,1),-1)+0.1*diag(ones(n,1));
P(1,1)=0.9;P(n,n)=0.2;

pv=ones(n,1);
for i=2:n, pv(i)=pv(i-1)/8; end; 
pv=pv/sum(pv);

