Matrix Computations of PageRank
Kurt Bryan and Tanya Leise

Link matrix A

A = {{0, 0, 1, 1/2}, {1/3, 0, 0, 
            0}, {1/3, 1/2, 0, 1/2}, {1/3, 1/2, 0, 0}};

    MatrixForm[A]

RowReduce[A - IdentityMatrix[4]]  //  MatrixForm

m = 6 {2, 2/3, 3/2, 1}
q = m/Sum[m[[i]], {i, 1, 4}]   
N[%]

ev = Eigensystem[N[A]];
MatrixForm[ev]

m = ev[[2, 1]];
q = m/Sum[m[[i]], {i, 1, 4}]

s = {1, 1, 1, 1}/4;    
MatrixPower[N[A], 40] . 
      s

Improved matrix M

M =  .85 A +  .15 {s, s, s, s}; MatrixForm[M]

ev = Eigensystem[M]; MatrixForm[ev]

m = ev[[2, 1]];
q = m/Sum[m[[i]], {i, 1, 4}]

MatrixPower[M, 40] . s

x = s;
For[i = 1, i ≤ 40, 
      x =  .85  A . x +  .15 s, i++]
x

Sum[ev[[2, 2]][[i]], {i, 1, 4}]   
Sum[ev[[2, 3]][[i]], {i, 1, 
        4}] 
Sum[ev[[2, 4]][[i]], {i, 1, 4}]

Convergence of power method

A = {{0, 1, 0, 0, 0}, {1, 0, 0, 0, 0}, {0, 0, 0, 1, 1/2}, {0, 0, 1, 
            0, 1/2}, {0, 0, 0, 0, 0}};
s = {1, 1, 1, 1, 1}/5;
M =  .85 A +  .15 {s, s, s, s, s}; MatrixForm[M]

ev = Eigensystem[M]; MatrixForm[ev]

m = ev[[2, 1]];
q = m/Sum[m[[i]], {i, 1, 5}]

MatrixPower[M, 50] . s

x0={ .24,  .31,  .08,  .18,  .19}

Norm[MatrixPower[M, 0] . x0 - q, 1]
Norm[MatrixPower[M, 1] . x0 - q, 1]
Norm[MatrixPower[M, 5] . x0 - q, 1]
Norm[MatrixPower[M, 10] . x0 - q, 1]
Norm[MatrixPower[M, 50] . x0 - q, 1]

Abs[ev[[1, 2]]]

Norm[MatrixPower[M, 1] . x0 - q, 1]/
      Norm[MatrixPower[M, 0] . x0 - q, 1]
Norm[MatrixPower[M, 5] . x0 - q, 1]/
      Norm[MatrixPower[M, 4] . x0 - q, 1]
Norm[MatrixPower[M, 10] . x0 - q, 1]/
      Norm[MatrixPower[M, 9] . x0 - q, 1]
Norm[MatrixPower[M, 20] . x0 - q, 1]/
      Norm[MatrixPower[M, 19] . x0 - q, 1]