aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/30-endlichekoerper/rechnungen
diff options
context:
space:
mode:
Diffstat (limited to 'buch/chapters/30-endlichekoerper/rechnungen')
-rw-r--r--buch/chapters/30-endlichekoerper/rechnungen/invbeispiel.maxima97
-rw-r--r--buch/chapters/30-endlichekoerper/rechnungen/inverse.maxima35
-rw-r--r--buch/chapters/30-endlichekoerper/rechnungen/multiplikation.maxima38
3 files changed, 170 insertions, 0 deletions
diff --git a/buch/chapters/30-endlichekoerper/rechnungen/invbeispiel.maxima b/buch/chapters/30-endlichekoerper/rechnungen/invbeispiel.maxima
new file mode 100644
index 0000000..4770926
--- /dev/null
+++ b/buch/chapters/30-endlichekoerper/rechnungen/invbeispiel.maxima
@@ -0,0 +1,97 @@
+/*
+ * invbeispiel.maxima
+ *
+ * (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+ */
+
+m: X^3 + 2*X^2 + 2*X + 3;
+
+modulus:7;
+factor(m);
+modulus:false;
+
+M: matrix(
+ [ 0, 0, 0, -3 ],
+ [ 1, 0, 0, -2 ],
+ [ 0, 1, 0, -2 ],
+ [ 0, 0, 1, -1 ]
+);
+M: mod(M, 7);
+M0: identfor(M);
+M1: M;
+M2: M.M1;
+M3: M.M2;
+
+a0: 1;
+a1: 2;
+a2: 9;
+a3: 1;
+
+a: a0 + a1*X + a2*X^2 + a3*X^3;
+
+A: a0*M0 + a1*M1 + a2*M2 + a3*M3;
+A: mod(A, 7);
+
+T: matrix(
+ [ A[1,1], A[1,2], A[1,3], A[1,4], 1, 0, 0, 0 ],
+ [ A[2,1], A[2,2], A[2,3], A[2,4], 0, 1, 0, 0 ],
+ [ A[3,1], A[3,2], A[3,3], A[3,4], 0, 0, 1, 0 ],
+ [ A[4,1], A[4,2], A[4,3], A[4,4], 0, 0, 0, 1 ]
+);
+
+t: inv_mod(T[1,1], 7);
+T[1]: mod(t * T[1], 7);
+T[2]: mod(T[2] - T[2,1]*T[1], 7);
+T[3]: mod(T[3] - T[3,1]*T[1], 7);
+T[4]: mod(T[4] - T[4,1]*T[1], 7);
+
+t: inv_mod(T[2,2], 7);
+T[2]: mod(t * T[2], 7);
+T[3]: mod(T[3] - T[3,2] * T[2], 7);
+T[4]: mod(T[4] - T[4,2] * T[2], 7);
+
+t: inv_mod(T[3,3], 7);
+T[3]: mod(t * T[3], 7);
+T[4]: mod(T[4] - T[4,3] * T[3], 7);
+
+t: inv_mod(T[4,4], 7);
+T[4]: mod(t * T[4], 7);
+T;
+
+T[3]: mod(T[3] - T[3,4] * T[4], 7);
+T[2]: mod(T[2] - T[2,4] * T[4], 7);
+T[1]: mod(T[1] - T[1,4] * T[4], 7);
+
+T[2]: mod(T[2] - T[2,3] * T[3], 7);
+T[1]: mod(T[1] - T[1,3] * T[3], 7);
+
+T[1]: mod(T[1] - T[1,2] * T[2], 7);
+
+T;
+
+C: matrix(
+ [ T[1,5], T[1,6], T[1,7], T[1,8] ],
+ [ T[2,5], T[2,6], T[2,7], T[2,8] ],
+ [ T[3,5], T[3,6], T[3,7], T[3,8] ],
+ [ T[4,5], T[4,6], T[4,7], T[4,8] ]
+);
+
+mod(A.C, 7);
+
+b0: C[1,1];
+b1: C[2,1];
+b2: C[3,1];
+b3: C[4,1];
+
+Cc: mod(b0*M0 + b1*M1 + b2*M2 + b3*M3, 7);
+C - Cc;
+
+b: b0 + b1*X + b2*X^2 + b3*X^3;
+p: expand(a*b);
+
+p: expand(p - 5 * m * X^3);
+p: expand(p - 40 * m * X^2);
+p: expand(p + 35 * m * X);
+p: expand(p + 9 * m);
+
+mod(28 * M0 + 125*M1 - 18*M2,7);
diff --git a/buch/chapters/30-endlichekoerper/rechnungen/inverse.maxima b/buch/chapters/30-endlichekoerper/rechnungen/inverse.maxima
new file mode 100644
index 0000000..5f3682f
--- /dev/null
+++ b/buch/chapters/30-endlichekoerper/rechnungen/inverse.maxima
@@ -0,0 +1,35 @@
+/*
+ * inverse.maxima
+ *
+ * (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+ */
+n: 5;
+m: X^5 + 15*X^3 - 30*X^2 + 45;
+
+M: matrix(
+ [ 0, 0, 0, 0, -45 ],
+ [ 1, 0, 0, 0, 0 ],
+ [ 0, 1, 0, 0, 30 ],
+ [ 0, 0, 1, 0, -15 ],
+ [ 0, 0, 0, 1, 0 ]
+);
+M2: M.M;
+M3: M.M2;
+M4: M.M3;
+
+y: a0 + a1*X + a2*X^2 + a3*X^3 + a4*X^4;
+Y: a0*identfor(M) + a1*M + a2*M2 + a3*M3 + a4*M4;
+
+B: invert(Y);
+
+b0: B[1,1];
+b1: B[2,1];
+b2: B[3,1];
+b3: B[4,1];
+b4: B[5,1];
+
+Z: b0*identfor(M) + b1*M + b2*M2 + b3*M3 + b4*M4;
+z: b0 + b1*X + b2*X^2 + b3*X^3 + b4*X^4;
+
+w: expand(y*z);
+remainder(w, m, X);
diff --git a/buch/chapters/30-endlichekoerper/rechnungen/multiplikation.maxima b/buch/chapters/30-endlichekoerper/rechnungen/multiplikation.maxima
new file mode 100644
index 0000000..e09f848
--- /dev/null
+++ b/buch/chapters/30-endlichekoerper/rechnungen/multiplikation.maxima
@@ -0,0 +1,38 @@
+/*
+ * multiplikation.maxima
+ *
+ * (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+ */
+
+Malpha: matrix(
+[ 0, 0, 0, 0, 0, 0, -m0 ],
+[ 1, 0, 0, 0, 0, 0, -m1 ],
+[ 0, 1, 0, 0, 0, 0, -m2 ],
+[ 0, 0, 1, 0, 0, 0, -m3 ],
+[ 0, 0, 0, 1, 0, 0, -m4 ],
+[ 0, 0, 0, 0, 1, 0, -m5 ],
+[ 0, 0, 0, 0, 0, 1, -m6 ]
+);
+
+Malpha2: expand(Malpha . Malpha);
+Malpha3: expand(Malpha . Malpha2);
+Malpha4: expand(Malpha . Malpha3);
+Malpha5: expand(Malpha . Malpha4);
+Malpha6: expand(Malpha . Malpha5);
+Malpha7: expand(Malpha . Malpha6);
+Malpha8: expand(Malpha . Malpha7);
+
+p: m0 * identfor(Malpha)
++ m1 * Malpha
++ m2 * Malpha2
++ m3 * Malpha3
++ m4 * Malpha4
++ m5 * Malpha5
++ m6 * Malpha6
++ Malpha7;
+expand(p);
+
+
+m(X) := m0 + m1*X + m2*X^2 + m3*X^3 + m4*X^4 + m5*X^5 + m6*X^6 + X^7;
+
+invert(Malpha);