aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/80-wahrscheinlichkeit/rechnungen/btilde.maxima
diff options
context:
space:
mode:
authorLordMcFungus <mceagle117@gmail.com>2021-03-22 18:05:11 +0100
committerGitHub <noreply@github.com>2021-03-22 18:05:11 +0100
commit76d2d77ddb2bed6b7c6b8ec56648d85da4103ab7 (patch)
tree11b2d41955ee4bfa0ae5873307c143f6b4d55d26 /buch/chapters/80-wahrscheinlichkeit/rechnungen/btilde.maxima
parentmore chapter structure (diff)
parentadd title image (diff)
downloadSeminarMatrizen-76d2d77ddb2bed6b7c6b8ec56648d85da4103ab7.tar.gz
SeminarMatrizen-76d2d77ddb2bed6b7c6b8ec56648d85da4103ab7.zip
Merge pull request #1 from AndreasFMueller/master
update
Diffstat (limited to 'buch/chapters/80-wahrscheinlichkeit/rechnungen/btilde.maxima')
-rw-r--r--buch/chapters/80-wahrscheinlichkeit/rechnungen/btilde.maxima103
1 files changed, 103 insertions, 0 deletions
diff --git a/buch/chapters/80-wahrscheinlichkeit/rechnungen/btilde.maxima b/buch/chapters/80-wahrscheinlichkeit/rechnungen/btilde.maxima
new file mode 100644
index 0000000..6ba2ee6
--- /dev/null
+++ b/buch/chapters/80-wahrscheinlichkeit/rechnungen/btilde.maxima
@@ -0,0 +1,103 @@
+B: matrix(
+ [ 0 , 1/4, 3/4 ],
+ [ 1/10, 0 , 1/4 ],
+ [ 9/10, 3/4, 0 ]
+);
+F: matrix(
+ [ 0, -1, 1 ],
+ [ 1, 0, -1 ],
+ [ -1, 1, 0 ]
+);
+G: matrix(
+ [ 0, -1, 1 ],
+ [ 1, 0, -1 ],
+ [ -1, 1, 0 ]
+);
+U: matrix([1], [1], [1]);
+p: (1/3) * U;
+
+ratsimp(expand((B * G) . p));
+ratsimp(expand(transpose(U) . (B * G) . p));
+
+/* find the eigenvector */
+/* find the eigenvector */
+B0: B - identfor(B);
+
+r: expand(B0[1] / B0[1,1]);
+B0[1]: r;
+B0[2]: B0[2] - B0[2,1] * r;
+B0[3]: B0[3] - B0[3,1] * r;
+
+B0: expand(B0);
+
+r: B0[2] / B0[2,2];
+B0[2]: r;
+B0[3]: B0[3] - B0[3,2] * r;
+
+B0: ratsimp(expand(B0));
+
+B0[1]: B0[1] - B0[1,2] * B0[2];
+
+B0: ratsimp(expand(B0));
+
+l: 78 + 12 * epsilon + 80 * epsilon^2;
+
+D: ratsimp(expand(l*B0));
+n: ratsimp(expand(l -D[1,3] -D[2,3]));
+
+p: (1/n) * matrix(
+[ -B0[1,3]*l ],
+[ -B0[2,3]*l ],
+[ l ]
+);
+p: ratsimp(expand(p));
+
+/* compute the expected gain */
+G*B;
+ratsimp(expand(transpose(U). (G*B) . p));
+
+/* modified game */
+Btilde: B - epsilon * F;
+ratsimp(expand((Btilde * G) . p));
+gain: ratsimp(expand(transpose(U) . (Btilde * G) . p));
+
+/* find the eigenvector */
+B0: Btilde - identfor(Btilde);
+
+r: expand(B0[1] / B0[1,1]);
+B0[1]: r;
+B0[2]: B0[2] - B0[2,1] * r;
+B0[3]: B0[3] - B0[3,1] * r;
+
+B0: expand(B0);
+
+r: B0[2] / B0[2,2];
+B0[2]: r;
+B0[3]: B0[3] - B0[3,2] * r;
+
+B0: ratsimp(expand(B0));
+
+B0[1]: B0[1] - B0[1,2] * B0[2];
+
+B0: ratsimp(expand(B0));
+
+l: 78 + 12 * epsilon + 80 * epsilon^2;
+
+D: ratsimp(expand(l*B0));
+n: ratsimp(expand(l -D[1,3] -D[2,3]));
+
+pepsilon: (1/n) * matrix(
+[ -B0[1,3]*l ],
+[ -B0[2,3]*l ],
+[ l ]
+);
+pepsilon: ratsimp(expand(pepsilon));
+
+/* taylor series expansion of the eigenvector */
+taylor(pepsilon, epsilon, 0, 3);
+
+/* expectation */
+
+G*Btilde;
+gainepsilon: ratsimp(expand(transpose(U). (G*Btilde) . pepsilon));
+taylor(gainepsilon, epsilon, 0, 5);