aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/80-wahrscheinlichkeit/rechnungen/btilde.maxima
blob: 6ba2ee61fa534f61d942f87a1c72f645466f5407 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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);