Shared2018-02-12-184558.sagewsOpen in CoCalc

A=matrix([[0,1/2,1/2],[1/2,0,1/2],[1/2,1/2,0]]);
B=matrix([[0,0,0],[0,1,0],[0,0,1]]);C=A*B;
Id=matrix.identity(3);
x0=matrix([[1],[0],[0]]);
At=A.transpose();
At*x0
At*B*At*x0;At^3*x0;At^4*x0;
[ 0] [1/2] [1/2] [1/2] [1/4] [1/4] [1/4] [3/8] [3/8] [ 3/8] [5/16] [5/16]
A=matrix([[0, 1/3,1/3,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1/3],
         [1/3, 0,1/3,1/3,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [1/3, 1/3,0,0,1/3,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 1/3,0,0,1/3,1/3, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,1/3,1/3,0,1/3, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,1/4,1/4,0, 1/4,1/4,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,1/3, 0,0,1/3,0,0, 0,0,0,0,0, 0,1/3,0,0,0, 0],
         [0, 0,0,0,0,1/3, 0,0,1/3,1/3,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 1/4,1/4,0,0,0, 0,0,0,0,1/4, 1/4,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,1/3,0,0,1/3, 1/3,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,1/3,0, 1/3,1/3,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,1/3,1/3, 0,0,1/3,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,1/3, 0,0,1/3,1/3,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 1/3,1/3,0,1/3,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,1/3,1/3,0,1/3, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,1/3,0,0, 0,0,0,1/3,0, 1/3,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,1/3,0,0, 0,0,0,0,1/3, 0,1/3,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1/3,0,1/3,0,1/3, 0],
         [0, 0,0,0,0,0, 1/3,0,0,0,0, 0,0,0,0,0, 0,1/3,0,1/3,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1/3,0,1/3, 1/3],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1/3,0,1/3,0, 1/3],
         [1/3, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1/3,1/3, 0]]);
Idf=matrix([[1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0],
         [0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1]]);
xf=matrix([0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0]);
x0=xf.transpose();
At=A.transpose();
Id22=matrix.identity(22);

L=Idf*At;
B=(Id22-L);
show(B.det());
l=xf*At*(L*B.inverse()^2+B.inverse())*x0;
show(n(l));
14190251549681956\displaystyle \frac{1419025}{1549681956}
(16.7160021845986)\displaystyle \left(\begin{array}{r} 16.7160021845986 \end{array}\right)