%typeset_mode True
P = Matrix([[1,0,0,0,0],[1/2,0,1/2,0,0],[0,1/2,0,1/2,0],[0,0,1/2,0,1/2],[0,0,0,0,1]]); P
1210000021000210210002100000211
N(P^(50))
1.000000000000000.7499999850988390.4999999850988390.2499999850988390.0000000000000000.0000000000000001.49011611938477×10−80.0000000000000001.49011611938477×10−80.0000000000000000.0000000000000000.0000000000000002.98023223876953×10−80.0000000000000000.0000000000000000.0000000000000001.49011611938477×10−80.0000000000000001.49011611938477×10−80.0000000000000000.0000000000000000.2499999850988390.4999999850988390.7499999850988391.00000000000000
N(vector([1/5,1/5,1/5,1/5,1/5])*P^(50))
(0.499999991059303,5.96046447753906×10−9,5.96046447753906×10−9,5.96046447753906×10−9,0.499999991059303)
Q = matrix([[0,1/2,0],[1/2,0,1/2],[0,1/2,0]]); Q
0210210210210
R = matrix([[1/2,0],[0,0],[0,1/2]]); R
21000021
N = (identity_matrix(3)-Q).inverse(); N
2312112121123
c = vector([1,1,1]); c
(1,1,1)
N*c
(3,4,3)
B = N*R; B
432141412143