你如何编写Python代码来检查是否运行?在由 Cayley 表定义的集合 {0,1,..,n?1} 上是否关联。
我尝试的代码是:
def is_associative_cayley_table(table):
if not is_cayley_table(table):
return False
for i in range (0,len(table)):
for j in range (0,len(table)):
for k in range (0,len(table)):
if (table[table[i][j])][k])==(table[i][(table[j][k])]):
print("Okay")
else
return False
Run Code Online (Sandbox Code Playgroud) python abstract-algebra python-2.7 python-3.x finite-group-theory