首先写出随机矩阵S
1 2 3 4 5 6
1 0 0 0 0 0 0
2 1/3 0 0 0 0 1/2
3 1/3 1/3 0 1/2 0 0
S= 4 1/3 1/3 1 0 0 1/2
5 0 0 0 0 0 0
6 0 1/3 0 1/2 1 0
谷歌矩阵 G:
其中,a=0.85 n=6
import numpy as np
s=np.array([[0,0,0,0,0,0],[1/3,0,0,0,0,1/2],[1/3,1/3,0,1/2,0,0],[1/3,1/3,1,0,0,1/2],[0,0,0,0,0,0],[0,1/3,0,1/2,1,0]])
a=np.ones((6,6))
g=0.85*s+0.15*a/6
print(a)
print(s)
print(g)