Skip to content

Commit bf35038

Browse files
review classic 2p game tutorial section
1 parent d19a37f commit bf35038

1 file changed

Lines changed: 77 additions & 7 deletions

File tree

doc/tutorials/interoperability_tutorials/gamut.ipynb

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,34 +89,104 @@
8989
},
9090
{
9191
"cell_type": "code",
92-
"execution_count": 5,
92+
"execution_count": 14,
9393
"id": "gamut-bos-eqm",
9494
"metadata": {},
9595
"outputs": [
9696
{
9797
"data": {
9898
"text/plain": [
99-
"[[[Rational(1, 1), Rational(0, 1)], [Rational(1, 1), Rational(0, 1)]],\n",
100-
" [[Rational(20573508175615163, 50573508175615163), Rational(30000000000000000, 50573508175615163)], [Rational(30000000000000000, 50573508175615163), Rational(20573508175615163, 50573508175615163)]],\n",
101-
" [[Rational(0, 1), Rational(1, 1)], [Rational(0, 1), Rational(1, 1)]]]"
99+
"3"
102100
]
103101
},
104-
"execution_count": 5,
102+
"execution_count": 14,
105103
"metadata": {},
106104
"output_type": "execute_result"
107105
}
108106
],
109107
"source": [
110108
"result_bos = gbt.nash.lcp_solve(g_bos)\n",
111-
"result_bos.equilibria\n"
109+
"len(result_bos.equilibria)\n"
112110
]
113111
},
114112
{
115113
"cell_type": "markdown",
116114
"id": "gamut-bos-interp",
117115
"metadata": {},
118116
"source": [
119-
"As expected, the solver finds three equilibria: two pure-strategy equilibria (both play Opera, or both play Football) and one mixed-strategy equilibrium in which each player randomises between the two options.\n"
117+
"As expected, the solver finds three equilibria: two pure-strategy equilibria (both play Opera, or both play Football) and one mixed-strategy equilibrium in which each player randomises between the two options:\n"
118+
]
119+
},
120+
{
121+
"cell_type": "code",
122+
"execution_count": 15,
123+
"id": "37294505",
124+
"metadata": {},
125+
"outputs": [
126+
{
127+
"data": {
128+
"text/latex": [
129+
"$\\left[\\left[1,0\\right],\\left[1,0\\right]\\right]$"
130+
],
131+
"text/plain": [
132+
"[[Rational(1, 1), Rational(0, 1)], [Rational(1, 1), Rational(0, 1)]]"
133+
]
134+
},
135+
"execution_count": 15,
136+
"metadata": {},
137+
"output_type": "execute_result"
138+
}
139+
],
140+
"source": [
141+
"result_bos.equilibria[0]"
142+
]
143+
},
144+
{
145+
"cell_type": "code",
146+
"execution_count": 16,
147+
"id": "293a5436",
148+
"metadata": {},
149+
"outputs": [
150+
{
151+
"data": {
152+
"text/latex": [
153+
"$\\left[\\left[\\frac{300000000000000000}{348292711498745977},\\frac{48292711498745977}{348292711498745977}\\right],\\left[\\frac{48292711498745977}{348292711498745977},\\frac{300000000000000000}{348292711498745977}\\right]\\right]$"
154+
],
155+
"text/plain": [
156+
"[[Rational(300000000000000000, 348292711498745977), Rational(48292711498745977, 348292711498745977)], [Rational(48292711498745977, 348292711498745977), Rational(300000000000000000, 348292711498745977)]]"
157+
]
158+
},
159+
"execution_count": 16,
160+
"metadata": {},
161+
"output_type": "execute_result"
162+
}
163+
],
164+
"source": [
165+
"result_bos.equilibria[1]"
166+
]
167+
},
168+
{
169+
"cell_type": "code",
170+
"execution_count": 17,
171+
"id": "d2e7a8e8",
172+
"metadata": {},
173+
"outputs": [
174+
{
175+
"data": {
176+
"text/latex": [
177+
"$\\left[\\left[0,1\\right],\\left[0,1\\right]\\right]$"
178+
],
179+
"text/plain": [
180+
"[[Rational(0, 1), Rational(1, 1)], [Rational(0, 1), Rational(1, 1)]]"
181+
]
182+
},
183+
"execution_count": 17,
184+
"metadata": {},
185+
"output_type": "execute_result"
186+
}
187+
],
188+
"source": [
189+
"result_bos.equilibria[2]"
120190
]
121191
},
122192
{

0 commit comments

Comments
 (0)