# Ein chinesisches Orakel und zyklische Matrizen über $\mathbb{Z}/2\mathbb{Z}$
%% Cell type:markdown id: tags:
Notebook zum gleichnamigen Artikel
enthält Untersuchungen der auftretenden Matrizen, erlaubt Verallgemeinerung der Zaubertricks in P. Diaconis, R. Graham, Magical Mathematics, Princeton University Press (2012), DOI: 10.1515/978-1-400-83938-4
Die nächste Funktion bringt den Kern der Matrix $M_n^m$ noch auf die Form, dass die ersten $k$ Spalten ($k$=Dimension des Kerns) die Einheitsmatrix darstellen.
%% Cell type:code id: tags:
``` sage
def transformiereKern(list_kern):
k=len(list_kern)
for i in range(0,k-1):
for j in range(i+1,k):
if (list_kern[i][j]==1):
list_kern[i]=list_kern[i]+list_kern[j]
return list_kern
```
%% Cell type:code id: tags:
``` sage
transformiereKern(ermittleKern(14,[1,1,0,1]))
```
%%%% Output: execute_result
[(1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1),
(0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0),
(0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1)]
%% Cell type:markdown id: tags:
## Beispiel 1: das Muster m=$[1,1,0,0,1]$
%% Cell type:code id: tags:
``` sage
mat=konstruiereGscamMatrix(15,[1,1,0,0,1])
```
%% Cell type:code id: tags:
``` sage
mat.right_kernel()
```
%%%% Output: execute_result
Vector space of degree 15 and dimension 4 over Finite Field of size 2
Basis matrix:
[1 0 0 0 1 0 0 1 1 0 1 0 1 1 1]
[0 1 0 0 1 1 0 1 0 1 1 1 1 0 0]
[0 0 1 0 0 1 1 0 1 0 1 1 1 1 0]
[0 0 0 1 0 0 1 1 0 1 0 1 1 1 1]
%% Cell type:code id: tags:
``` sage
transformiereKern(ermittleKern(15,[1,1,0,0,1]))
```
%%%% Output: execute_result
[(1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1),
(0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0),
(0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0),
(0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1)]
%% Cell type:markdown id: tags:
## Beispiel 2: das Muster $m=[1,1,\ldots,1]$ mit $k$ Einsen
%% Cell type:code id: tags:
``` sage
mat=konstruiereGscamMatrix(15,[1,1,1,1,1])
```
%% Cell type:code id: tags:
``` sage
mat.right_kernel()
```
%%%% Output: execute_result
Vector space of degree 15 and dimension 4 over Finite Field of size 2