I have a question about computing the following linear algebraic operation
Suppose
$u = (1, 0, 0)$
$v = \begin{pmatrix} 1\\ 0\\ 0\end{pmatrix}$
$A = \begin{pmatrix} 0.5 &0.2 &0.3\\0.2 &0.3 &0.5\\ 0.3 &0.5 &0.2\end{pmatrix}$
and
$g(n) = u\cdot A^n\cdot v$
I want to calculate
$g(20)/g(19)$ constructing a Markov process and using Metropolis algorithm.