x = rand(3,1);
x = x/sum(x);

A = [0.95 0.01 0.02;
     0.05 0.96 0;
     0    0.03 0.98];

p = [];
for k = 0:99
    p = [p, A^k*x];
end

plot([0:99],p');
legend('young','old','dead');
xlabel('year'); ylabel('population fraction');